Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 06eb53e92a499233fd83a0a73502eceeebf72b28..54f8f887204da8e36da365fc84a8d607a0ca5b2d 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -656,19 +656,20 @@ void BytecodeGenerator::GenerateBytecode() { |
} |
void BytecodeGenerator::GenerateBytecodeBody() { |
+ DCHECK_EQ(scope(), info()->scope()); |
Michael Starzinger
2016/08/03 13:02:19
nit: Can we change BytecodeGenerator::scope() to r
|
// Build the arguments object if it is used. |
- VisitArgumentsObject(scope()->arguments()); |
+ VisitArgumentsObject(info()->scope()->arguments()); |
// Build rest arguments array if it is used. |
int rest_index; |
- Variable* rest_parameter = scope()->rest_parameter(&rest_index); |
+ Variable* rest_parameter = info()->scope()->rest_parameter(&rest_index); |
VisitRestArgumentsArray(rest_parameter); |
// Build assignment to {.this_function} variable if it is used. |
- VisitThisFunctionVariable(scope()->this_function_var()); |
+ VisitThisFunctionVariable(info()->scope()->this_function_var()); |
// Build assignment to {new.target} variable if it is used. |
- VisitNewTargetVariable(scope()->new_target_var()); |
+ VisitNewTargetVariable(info()->scope()->new_target_var()); |
// TODO(rmcilroy): Emit tracing call if requested to do so. |
if (FLAG_trace) { |
@@ -676,7 +677,7 @@ void BytecodeGenerator::GenerateBytecodeBody() { |
} |
// Visit declarations within the function scope. |
- VisitDeclarations(scope()->declarations()); |
+ VisitDeclarations(info()->scope()->declarations()); |
// Perform a stack-check before the body. |
builder()->StackCheck(info()->literal()->start_position()); |
@@ -3016,7 +3017,7 @@ void BytecodeGenerator::VisitNewLocalFunctionContext() { |
} |
void BytecodeGenerator::VisitBuildLocalActivationContext() { |
- Scope* scope = this->scope(); |
+ DeclarationScope* scope = this->scope()->AsDeclarationScope(); |
Michael Starzinger
2016/08/03 13:02:19
nit: See comment above.
|
if (scope->has_this_declaration() && scope->receiver()->IsContextSlot()) { |
Variable* variable = scope->receiver(); |
@@ -3165,7 +3166,8 @@ void BytecodeGenerator::VisitNewTargetVariable(Variable* variable) { |
void BytecodeGenerator::VisitFunctionClosureForContext() { |
AccumulatorResultScope accumulator_execution_result(this); |
- Scope* closure_scope = execution_context()->scope()->ClosureScope(); |
+ DeclarationScope* closure_scope = |
+ execution_context()->scope()->GetClosureScope(); |
if (closure_scope->is_script_scope() || |
closure_scope->is_module_scope()) { |
// Contexts nested in the native context have a canonical empty function as |