Index: src/ic/ic.cc |
diff --git a/src/ic/ic.cc b/src/ic/ic.cc |
index 6ecc0771ec83146d0d623e6058dcf0fd16f8ec0e..21005673233702c34aaff58f6934a850de206300 100644 |
--- a/src/ic/ic.cc |
+++ b/src/ic/ic.cc |
@@ -1720,7 +1720,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. |
@@ -1821,11 +1825,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(); |