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

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

Issue 2654423004: [async-functions] support await expressions in finally statements (Closed)
Patch Set: Get everything working (except possibly inspector tests) 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
Index: src/ast/ast-numbering.cc
diff --git a/src/ast/ast-numbering.cc b/src/ast/ast-numbering.cc
index fd793f4b80dd679fc4f0c44c3523360d441b2ba1..5f6846a7f6eb79abc62d7e80dd9bcf5bcc0116fb 100644
--- a/src/ast/ast-numbering.cc
+++ b/src/ast/ast-numbering.cc
@@ -219,7 +219,6 @@ void AstNumberingVisitor::VisitYield(Yield* node) {
yield_count_++;
IncrementNodeCount();
node->set_base_id(ReserveIdRange(Yield::num_ids()));
- Visit(node->generator_object());
Visit(node->expression());
}
@@ -421,6 +420,11 @@ void AstNumberingVisitor::VisitGetIterator(GetIterator* node) {
ReserveFeedbackSlots(node);
}
+void AstNumberingVisitor::VisitInternalVariable(InternalVariable* node) {
+ IncrementNodeCount();
+ DisableFullCodegenAndCrankshaft(kNoReason);
+}
+
void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) {
IncrementNodeCount();
DisableSelfOptimization();
@@ -640,7 +644,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.
caitp 2017/01/30 04:20:29 I'm guessing there isn't a whole lot of cases wher
+ 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_);

Powered by Google App Engine
This is Rietveld 408576698