Chromium Code Reviews| 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_); |