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: { |