Index: src/ast/ast-numbering.cc |
diff --git a/src/ast/ast-numbering.cc b/src/ast/ast-numbering.cc |
index 100814691f8cb1a3428aab1fcc5b0a9d7756c7de..1b9905a2c6c1d0d23076e965f2983a0d4f6b07d6 100644 |
--- a/src/ast/ast-numbering.cc |
+++ b/src/ast/ast-numbering.cc |
@@ -233,6 +233,14 @@ void AstNumberingVisitor::VisitCountOperation(CountOperation* node) { |
void AstNumberingVisitor::VisitBlock(Block* node) { |
IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(Block::num_ids())); |
+ |
+ if (FLAG_ignition && node->scope() != nullptr && |
Michael Starzinger
2016/08/09 07:38:26
Just for posterity: We could consider adding Block
|
+ node->scope()->NeedsContext()) { |
+ // Create ScopeInfo while on the main thread to avoid allocation during |
+ // potentially concurrent bytecode generation. |
+ node->scope()->GetScopeInfo(isolate_); |
+ } |
+ |
if (node->scope() != NULL) VisitDeclarations(node->scope()->declarations()); |
VisitStatements(node->statements()); |
} |
@@ -572,6 +580,12 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
DisableCrankshaft(kRestParameter); |
} |
+ if (FLAG_ignition && scope->NeedsContext() && scope->is_script_scope()) { |
+ // Create ScopeInfo while on the main thread to avoid allocation during |
+ // potentially concurrent bytecode generation. |
+ node->scope()->GetScopeInfo(isolate_); |
+ } |
+ |
if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { |
// TODO(neis): We may want to allow Turbofan optimization here if |
// --turbo-from-bytecode is set and we know that Ignition is used. |