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

Unified Diff: src/full-codegen.h

Issue 981203003: Stack allocate lexical locals + hoist stack slots (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Feedback + rebased Created 5 years, 8 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/compiler/ast-graph-builder.cc ('k') | src/full-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.h
diff --git a/src/full-codegen.h b/src/full-codegen.h
index 1a38c268e1b390b9f95d68666793b8639521fa25..ab41c894635288dbdde33519f5b95abe63a259f2 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 {
@@ -220,8 +221,9 @@ class FullCodeGenerator: public AstVisitor {
virtual ~NestedBlock() {}
virtual NestedStatement* Exit(int* stack_depth, int* context_length) {
- if (statement()->AsBlock()->scope() != NULL) {
- ++(*context_length);
+ auto block_scope = statement()->AsBlock()->scope();
+ if (block_scope != nullptr) {
+ if (block_scope->ContextLocalCount() > 0) ++(*context_length);
}
return previous_;
}
@@ -968,9 +970,9 @@ class FullCodeGenerator: public AstVisitor {
MacroAssembler* masm() const { return codegen_->masm(); }
FullCodeGenerator* codegen_;
- Scope* scope_;
Scope* saved_scope_;
BailoutId exit_id_;
+ bool needs_block_context_;
};
MacroAssembler* masm_;
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698