| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index 4b52f26a84e7aa75bd9886d9e6beef2efc7b579e..85c097fb9943cf99158fc261845522b938d2fc29 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -6522,6 +6522,24 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
|
| HValue* value,
|
| BailoutId ast_id) {
|
| Handle<GlobalObject> global(current_info()->global_object());
|
| +
|
| + if (FLAG_harmony_scoping) {
|
| + Handle<GlobalContextTable> global_contexts(
|
| + global->native_context()->global_context_table());
|
| + GlobalContextTable::LookupResult lookup;
|
| + if (GlobalContextTable::Lookup(global_contexts, var->name(), &lookup)) {
|
| + Handle<Context> global_context =
|
| + GlobalContextTable::GetContext(global_contexts, lookup.context_index);
|
| + HStoreNamedField* instr = Add<HStoreNamedField>(
|
| + Add<HConstant>(global_context),
|
| + HObjectAccess::ForContextSlot(lookup.slot_index), value);
|
| + USE(instr);
|
| + DCHECK(instr->HasObservableSideEffects());
|
| + Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
|
| + return;
|
| + }
|
| + }
|
| +
|
| LookupIterator it(global, var->name(), LookupIterator::OWN_SKIP_INTERCEPTOR);
|
| GlobalPropertyAccess type = LookupGlobalProperty(var, &it, STORE);
|
| if (type == kUseCell) {
|
|
|