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

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

Issue 2343633002: [interpreter] Add a fast path for dynamic local load (Closed)
Patch Set: Fix extension slot word size in equality 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
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 27158cd8bfa6d281bd420b119d0805561ca2b84e..43ab0e3abe0e0103ac6fde664fcd89138360f67c 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1967,7 +1967,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: {
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698