| Index: src/full-codegen.h
|
| diff --git a/src/full-codegen.h b/src/full-codegen.h
|
| index 1439942db8ae33785ce817ba91d3c669e34cddf9..ed409b695fcc05457cb9c06e48725e5d7379fad3 100644
|
| --- a/src/full-codegen.h
|
| +++ b/src/full-codegen.h
|
| @@ -16,6 +16,7 @@
|
| #include "src/compiler.h"
|
| #include "src/globals.h"
|
| #include "src/objects.h"
|
| +#include "src/scopes.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
| @@ -216,9 +217,13 @@ class FullCodeGenerator: public AstVisitor {
|
| virtual ~NestedBlock() {}
|
|
|
| virtual NestedStatement* Exit(int* stack_depth, int* context_length) {
|
| - if (statement()->AsBlock()->scope() != NULL) {
|
| + Scope* block_scope = statement()->AsBlock()->scope();
|
| + if (block_scope != nullptr && block_scope->ContextLocalCount() > 0) {
|
| ++(*context_length);
|
| }
|
| + if (block_scope != nullptr) {
|
| + *stack_depth += block_scope->num_stack_slots();
|
| + }
|
| return previous_;
|
| }
|
| };
|
| @@ -906,11 +911,15 @@ class FullCodeGenerator: public AstVisitor {
|
| MacroAssembler* masm() const { return codegen_->masm(); }
|
|
|
| FullCodeGenerator* codegen_;
|
| - Scope* scope_;
|
| Scope* saved_scope_;
|
| BailoutId exit_id_;
|
| + bool needs_block_context_;
|
| + bool num_stack_slots_;
|
| };
|
|
|
| + void AllocateLocals(int local_count);
|
| + void DeallocateLocals(int local_count);
|
| +
|
| MacroAssembler* masm_;
|
| CompilationInfo* info_;
|
| Scope* scope_;
|
|
|