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

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

Issue 936003002: Make AstGraphBuilder::function_context a SetOncePointer again. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-graph-builder-stack-overflow
Patch Set: Created 5 years, 10 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 30bdcfb29702987ee000983ae7aa011ae28c19d1..d0043e11bc6bdbe46acef715e8adaa84be0f45a1 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -379,7 +379,6 @@ AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
globals_(0, local_zone),
execution_control_(nullptr),
execution_context_(nullptr),
- function_context_(nullptr),
input_buffer_size_(0),
input_buffer_(nullptr),
exit_control_(nullptr),
@@ -400,8 +399,10 @@ Node* AstGraphBuilder::GetFunctionClosure() {
Node* AstGraphBuilder::GetFunctionContext() {
- DCHECK(function_context_ != nullptr);
- return function_context_;
+ if (!function_context_.is_set()) {
+ function_context_.set(NewOuterContextParam());
+ }
+ return function_context_.get();
}
@@ -442,8 +443,8 @@ bool AstGraphBuilder::CreateGraph() {
}
// Initialize the incoming context.
- function_context_ = NewOuterContextParam();
- ContextScope incoming(this, scope, function_context_);
+ Node* outer_context = GetFunctionContext();
+ ContextScope incoming(this, scope, outer_context);
// Build receiver check for sloppy mode if necessary.
// TODO(mstarzinger/verwaest): Should this be moved back into the CallIC?
@@ -456,7 +457,7 @@ bool AstGraphBuilder::CreateGraph() {
if (heap_slots > 0) {
// Push a new inner context scope for the function.
Node* closure = GetFunctionClosure();
- Node* inner_context = BuildLocalFunctionContext(function_context_, closure);
+ Node* inner_context = BuildLocalFunctionContext(outer_context, closure);
ContextScope top_context(this, scope, inner_context);
CreateGraphBody();
} else {
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698