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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2343633002: [interpreter] Add a fast path for dynamic local load (Closed)
Patch Set: Disable clang format for the new test Created 4 years, 3 months 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/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index d88ea4bce48396a30845c9cb36ff20d4531189fe..f548613249efbf3b490ab364faaf0a3f36092a51 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1963,7 +1963,19 @@ void BytecodeGenerator::VisitVariableLoad(Variable* variable,
break;
}
case VariableLocation::LOOKUP: {
- builder()->LoadLookupSlot(variable->name(), typeof_mode);
+ switch (variable->mode()) {
+ case DYNAMIC_LOCAL: {
+ Variable* local_variable = variable->local_if_not_shadowed();
+ int depth =
+ execution_context()->ContextChainDepth(local_variable->scope());
+ builder()->LoadLookupContextSlot(variable->name(), typeof_mode,
+ local_variable->index(), depth);
+ BuildHoleCheckForVariableLoad(variable);
+ break;
+ }
+ default:
+ builder()->LoadLookupSlot(variable->name(), typeof_mode);
+ }
break;
}
case VariableLocation::MODULE: {

Powered by Google App Engine
This is Rietveld 408576698