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

Unified Diff: src/ic/ic.cc

Issue 1062163005: track global accesses to constant types (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « src/hydrogen.cc ('k') | src/lookup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index a6ae92a892c06ac9dcc88ecf093a0201e9f0eb12..ce3a862da1d7ecf09c3d8adc86fb1293a3c04b47 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -1714,7 +1714,11 @@ void StoreIC::UpdateCaches(LookupIterator* lookup, Handle<Object> value,
static Handle<Code> PropertyCellStoreHandler(
Isolate* isolate, Handle<JSObject> receiver, Handle<GlobalObject> holder,
Handle<Name> name, Handle<PropertyCell> cell, PropertyCellType type) {
- StoreGlobalStub stub(isolate, type == PropertyCellType::kConstant,
+ auto constant_type = Nothing<PropertyCellConstantType>();
+ if (type == PropertyCellType::kConstantType) {
+ constant_type = Just(cell->GetConstantType());
+ }
+ StoreGlobalStub stub(isolate, type, constant_type,
receiver->IsJSGlobalProxy());
auto code = stub.GetCodeCopyFromTemplate(holder, cell);
// TODO(verwaest): Move caching of these NORMAL stubs outside as well.
@@ -1815,11 +1819,12 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup,
DCHECK(holder.is_identical_to(receiver) ||
receiver->map()->prototype() == *holder);
auto cell = lookup->GetPropertyCell();
- auto union_type = PropertyCell::UpdatedType(
+ auto updated_type = PropertyCell::UpdatedType(
cell, value, lookup->property_details());
- return PropertyCellStoreHandler(isolate(), receiver,
- Handle<GlobalObject>::cast(holder),
- lookup->name(), cell, union_type);
+ auto code = PropertyCellStoreHandler(
+ isolate(), receiver, Handle<GlobalObject>::cast(holder),
+ lookup->name(), cell, updated_type);
+ return code;
}
DCHECK(holder.is_identical_to(receiver));
return isolate()->builtins()->StoreIC_Normal();
« no previous file with comments | « src/hydrogen.cc ('k') | src/lookup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698