Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index 6184bb9e46b25c6a22015b216a3e60046a537f2d..e3bbac50e0ccd6cc789711f353d81be305769d92 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -5376,6 +5376,20 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { |
| } |
| Handle<GlobalObject> global(current_info()->global_object()); |
| + |
| + Handle<GlobalContextTable> global_contexts( |
|
Igor Sheludko
2014/11/11 09:49:51
It looks like this piece of code should be inside
Dmitry Lomov (no reviews)
2014/11/11 11:16:20
Done for consistency, even though it does not real
|
| + global->native_context()->global_context_table()); |
| + GlobalContextTable::LookupResult lookup; |
| + if (GlobalContextTable::Lookup(global_contexts, variable->name(), |
| + &lookup)) { |
| + Handle<Context> global_context = GlobalContextTable::GetContext( |
| + global_contexts, lookup.context_index); |
| + HInstruction* result = New<HLoadNamedField>( |
| + Add<HConstant>(global_context), static_cast<HValue*>(NULL), |
| + HObjectAccess::ForContextSlot(lookup.slot_index)); |
| + return ast_context()->ReturnInstruction(result, expr->id()); |
| + } |
| + |
| LookupIterator it(global, variable->name(), |
| LookupIterator::OWN_SKIP_INTERCEPTOR); |
| GlobalPropertyAccess type = LookupGlobalProperty(variable, &it, LOAD); |