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

Unified Diff: src/ic.cc

Issue 19006002: Flag rewriting an IC while writing to a global constant property as a failure caused by the constan… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index c3ed767d9f6cd7581beb4537e05c8cc770c7c353..9625d2123eda7ebfea1a1c52ce6a320a06b6cdb3 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -191,6 +191,17 @@ static bool TryRemoveInvalidPrototypeDependentStub(Code* target,
if (Name::cast(name) != stub_name) return false;
}
+ if (receiver->IsGlobalObject()) {
+ if (!name->IsName()) return false;
+ Isolate* isolate = target->GetIsolate();
+ LookupResult lookup(isolate);
+ GlobalObject* global = GlobalObject::cast(receiver);
+ global->LocalLookupRealNamedProperty(Name::cast(name), &lookup);
+ if (!lookup.IsFound()) return false;
+ PropertyCell* cell = global->GetPropertyCell(&lookup);
+ return cell->type()->IsConstant();
+ }
+
InlineCacheHolderFlag cache_holder =
Code::ExtractCacheHolderFromFlags(target->flags());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698