| Index: src/crankshaft/hydrogen.cc
|
| diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
|
| index e5332a2f5d1a961c6a9eb69da3b29d6390bd22d0..107021cecba8d728c7f2dcd9a422a70cf250c105 100644
|
| --- a/src/crankshaft/hydrogen.cc
|
| +++ b/src/crankshaft/hydrogen.cc
|
| @@ -6866,9 +6866,16 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
|
| HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX));
|
| Handle<TypeFeedbackVector> vector =
|
| handle(current_feedback_vector(), isolate());
|
| - HStoreNamedGeneric* instr =
|
| - Add<HStoreNamedGeneric>(global_object, var->name(), value,
|
| - function_language_mode(), vector, slot);
|
| + HValue* name = Add<HConstant>(var->name());
|
| + HValue* vector_value = Add<HConstant>(vector);
|
| + HValue* slot_value = Add<HConstant>(vector->GetIndex(slot));
|
| + Callable callable = CodeFactory::StoreICInOptimizedCode(
|
| + isolate(), function_language_mode());
|
| + HValue* stub = Add<HConstant>(callable.code());
|
| + HValue* values[] = {context(), global_object, name,
|
| + value, slot_value, vector_value};
|
| + HCallWithDescriptor* instr = Add<HCallWithDescriptor>(
|
| + stub, 0, callable.descriptor(), ArrayVector(values));
|
| USE(instr);
|
| DCHECK(instr->HasObservableSideEffects());
|
| Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
|
| @@ -7203,8 +7210,16 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
|
| return result;
|
| }
|
|
|
| - HStoreNamedGeneric* result = New<HStoreNamedGeneric>(
|
| - object, name, value, function_language_mode(), vector, slot);
|
| + HValue* name_value = Add<HConstant>(name);
|
| + HValue* vector_value = Add<HConstant>(vector);
|
| + HValue* slot_value = Add<HConstant>(vector->GetIndex(slot));
|
| + Callable callable = CodeFactory::StoreICInOptimizedCode(
|
| + isolate(), function_language_mode());
|
| + HValue* stub = Add<HConstant>(callable.code());
|
| + HValue* values[] = {context(), object, name_value,
|
| + value, slot_value, vector_value};
|
| + HCallWithDescriptor* result = New<HCallWithDescriptor>(
|
| + stub, 0, callable.descriptor(), ArrayVector(values));
|
| return result;
|
| }
|
| }
|
|
|