Commit a5b0d640 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

Fix DCHECK in HasFastProperties

Objects with both dictionary and non-dictionary maps can store their
hash in the {properties} field when they have no other properties.

Bug: chromium:778952
Change-Id: I8ac8c31eaac32116415e3c65cef8dee260dca2c9
Reviewed-on: https://chromium-review.googlesource.com/747272Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49056}
parent dd26478e
......@@ -4570,8 +4570,9 @@ void JSReceiver::initialize_properties() {
}
bool JSReceiver::HasFastProperties() const {
DCHECK_EQ(raw_properties_or_hash()->IsDictionary(),
map()->is_dictionary_map());
DCHECK(
raw_properties_or_hash()->IsSmi() ||
(raw_properties_or_hash()->IsDictionary() == map()->is_dictionary_map()));
return !map()->is_dictionary_map();
}
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
assertThrows(function() {
const p = new Proxy({}, {});
(new Set).add(p); // Compute the hash code for p.
null[p] = 0;
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment