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

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

Issue 2654423004: [async-functions] support await expressions in finally statements (Closed)
Patch Set: I'd like to build with -Wunused-variables locally, but how!? Created 3 years, 11 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/ast/ast-expression-rewriter.cc ('k') | src/ast/ast-traversal-visitor.h » ('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 6c48a0740ff97f868846fd99166428d92058b039..5fba8806cdfff5d66b56d211fb2f272bfac7f016 100644
--- a/src/ast/ast-numbering.cc
+++ b/src/ast/ast-numbering.cc
@@ -220,7 +220,6 @@ void AstNumberingVisitor::VisitYield(Yield* node) {
yield_count_++;
IncrementNodeCount();
node->set_base_id(ReserveIdRange(Yield::num_ids()));
- Visit(node->generator_object());
Visit(node->expression());
}
@@ -422,6 +421,11 @@ void AstNumberingVisitor::VisitGetIterator(GetIterator* node) {
ReserveFeedbackSlots(node);
}
+void AstNumberingVisitor::VisitInternalVariable(InternalVariable* node) {
+ IncrementNodeCount();
+ DisableFullCodegenAndCrankshaft(kNoReason);
+}
+
void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) {
IncrementNodeCount();
DisableSelfOptimization();
@@ -641,7 +645,28 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
DisableFullCodegenAndCrankshaft(kClassConstructorFunction);
}
+ if (scope->is_function_scope()) {
+ Variable* function_var = scope->function_var();
+ if (function_var != nullptr && !function_var->IsUnallocated()) {
+ // Initialization of local function-named variable is no longer part of
+ // the AST, and this initialization is not handled in full-codegen or
+ // crankshaft.
+ DisableFullCodegenAndCrankshaft(kNoReason);
+ }
+ }
+
+ if (IsGeneratorFunction(node->kind()) || scope->is_module_scope()) {
+ // Generator functions and Modules have an initial yield which is not
+ // included in the AST.
+ DCHECK_EQ(0, yield_count_);
+ yield_count_ = 1;
+ }
+
VisitDeclarations(scope->declarations());
+ if (node->parameter_init_block() != nullptr) {
+ DisableFullCodegenAndCrankshaft(kNonSimpleParameters);
+ VisitBlock(node->parameter_init_block());
+ }
VisitStatements(node->body());
node->set_ast_properties(&properties_);
« no previous file with comments | « src/ast/ast-expression-rewriter.cc ('k') | src/ast/ast-traversal-visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698