Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Unified Diff: src/ic/handler-compiler.cc

Issue 1185373004: Only walk the hidden prototype chain for private nonexistent symbols (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-479528.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/handler-compiler.cc
diff --git a/src/ic/handler-compiler.cc b/src/ic/handler-compiler.cc
index 4d9d46acda7e44fb618b2f628294d5515efb8507..04b8fb0c8cd436e804b86af5ca5d29500952f3db 100644
--- a/src/ic/handler-compiler.cc
+++ b/src/ic/handler-compiler.cc
@@ -53,6 +53,16 @@ Handle<Code> NamedLoadHandlerCompiler::ComputeLoadNonexistent(
while (true) {
if (current_map->is_dictionary_map()) cache_name = name;
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()));
current_map = handle(last->map());
}
@@ -428,8 +438,11 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreTransition(
if (is_nonexistent) {
// Find the top object.
Handle<JSObject> last;
+ PrototypeIterator::WhereToEnd end =
+ name->IsPrivate() ? PrototypeIterator::END_AT_NON_HIDDEN
+ : PrototypeIterator::END_AT_NULL;
PrototypeIterator iter(isolate(), holder());
- while (!iter.IsAtEnd()) {
+ while (!iter.IsAtEnd(end)) {
last = Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
iter.Advance();
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-479528.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698