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

Unified Diff: src/hydrogen.cc

Issue 696783005: harmony-scoping: Implement LoadIC handler for loads from global contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cleanup Created 6 years, 1 month 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
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);

Powered by Google App Engine
This is Rietveld 408576698