| Index: src/interpreter/bytecode-generator.cc
|
| diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
|
| index dc36fb1aa5f7cdf075dbd0addb6f55e3e41e1e1b..a4efcce1da5666fd827a87ad739051af6deeef5e 100644
|
| --- a/src/interpreter/bytecode-generator.cc
|
| +++ b/src/interpreter/bytecode-generator.cc
|
| @@ -153,11 +153,10 @@ Handle<BytecodeArray> BytecodeGenerator::MakeBytecode(CompilationInfo* info) {
|
|
|
| builder()->set_parameter_count(info->num_parameters_including_this());
|
| builder()->set_locals_count(scope()->num_stack_slots());
|
| - // TODO(rmcilroy): Set correct context count.
|
| - builder()->set_context_count(info->num_heap_slots() > 0 ? 1 : 0);
|
| + builder()->set_context_count(scope()->MaxNestedContextChainLength());
|
|
|
| // Build function context only if there are context allocated variables.
|
| - if (info->num_heap_slots() > 0) {
|
| + if (scope()->NeedsContext()) {
|
| // Push a new inner context scope for the function.
|
| VisitNewLocalFunctionContext();
|
| ContextScope top_context(this, true);
|
|
|