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

Unified Diff: src/ast/ast-numbering.cc

Issue 2223283002: [Interpreter] Create ScopeInfos in ast-numbering phase. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_varchecks
Patch Set: Created 4 years, 4 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 | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698