Commit bb1b54a7 authored by verwaest's avatar verwaest Committed by Commit bot

Only walk the hidden prototype chain for private nonexistent symbols

BUG=chromium:479528
LOG=n

Review URL: https://codereview.chromium.org/1185373004

Cr-Commit-Position: refs/heads/master@{#29075}
parent 72cdb993
...@@ -53,6 +53,16 @@ Handle<Code> NamedLoadHandlerCompiler::ComputeLoadNonexistent( ...@@ -53,6 +53,16 @@ Handle<Code> NamedLoadHandlerCompiler::ComputeLoadNonexistent(
while (true) { while (true) {
if (current_map->is_dictionary_map()) cache_name = name; if (current_map->is_dictionary_map()) cache_name = name;
if (current_map->prototype()->IsNull()) break; if (current_map->prototype()->IsNull()) break;
if (name->IsPrivate()) {
// TODO(verwaest): Use nonexistent_private_symbol.
cache_name = name;
JSReceiver* prototype = JSReceiver::cast(current_map->prototype());
if (!prototype->map()->is_hidden_prototype() &&
!prototype->map()->IsGlobalObjectMap()) {
break;
}
}
last = handle(JSObject::cast(current_map->prototype())); last = handle(JSObject::cast(current_map->prototype()));
current_map = handle(last->map()); current_map = handle(last->map());
} }
...@@ -428,8 +438,11 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreTransition( ...@@ -428,8 +438,11 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreTransition(
if (is_nonexistent) { if (is_nonexistent) {
// Find the top object. // Find the top object.
Handle<JSObject> last; Handle<JSObject> last;
PrototypeIterator::WhereToEnd end =
name->IsPrivate() ? PrototypeIterator::END_AT_NON_HIDDEN
: PrototypeIterator::END_AT_NULL;
PrototypeIterator iter(isolate(), holder()); PrototypeIterator iter(isolate(), holder());
while (!iter.IsAtEnd()) { while (!iter.IsAtEnd(end)) {
last = Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)); last = Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
iter.Advance(); iter.Advance();
} }
......
// Copyright 2015 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.
// Flags: --allow-natives-syntax
var __v_7 = {"__proto__": this};
__v_9 = %CreatePrivateSymbol("__v_9");
this[__v_9] = "moo";
function __f_5() {
__v_7[__v_9] = "bow-wow";
}
__f_5();
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