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

Unified Diff: src/compiler/ast-graph-builder.h

Issue 804463002: Stack-allocate block variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: moar progress Created 6 years 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 | « no previous file | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.h
diff --git a/src/compiler/ast-graph-builder.h b/src/compiler/ast-graph-builder.h
index 27b8e3063c40d70c0da45aea47b6868e6fcbbbb5..6f218a9d8810122e52c0ba9a3ec3882ed264862c 100644
--- a/src/compiler/ast-graph-builder.h
+++ b/src/compiler/ast-graph-builder.h
@@ -422,12 +422,19 @@ class AstGraphBuilder::ContextScope BASE_EMBEDDED {
outer_(owner->current_context()),
scope_(scope) {
owner_->set_execution_context(this); // Push.
- owner_->set_current_context(context);
+ if (context != nullptr) {
+ owner_->set_current_context(context);
+ need_context = true;
+ } else {
+ need_context = false;
+ }
}
~ContextScope() {
owner_->set_execution_context(next_); // Pop.
- owner_->set_current_context(outer_);
+ if (need_context) {
+ owner_->set_current_context(outer_);
+ }
}
// Current scope during visitation.
@@ -438,6 +445,7 @@ class AstGraphBuilder::ContextScope BASE_EMBEDDED {
ContextScope* next_;
Node* outer_;
Scope* scope_;
+ bool need_context;
};
Scope* AstGraphBuilder::current_scope() const {
« no previous file with comments | « no previous file | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698