| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/ast/ast-numbering.h" | 5 #include "src/ast/ast-numbering.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 if (scope->new_target_var()) DisableCrankshaft(kSuperReference); | 587 if (scope->new_target_var()) DisableCrankshaft(kSuperReference); |
| 588 if (scope->calls_eval()) DisableCrankshaft(kFunctionCallsEval); | 588 if (scope->calls_eval()) DisableCrankshaft(kFunctionCallsEval); |
| 589 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { | 589 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
| 590 DisableCrankshaft(kContextAllocatedArguments); | 590 DisableCrankshaft(kContextAllocatedArguments); |
| 591 } | 591 } |
| 592 | 592 |
| 593 if (scope->rest_parameter() != nullptr) { | 593 if (scope->rest_parameter() != nullptr) { |
| 594 DisableCrankshaft(kRestParameter); | 594 DisableCrankshaft(kRestParameter); |
| 595 } | 595 } |
| 596 | 596 |
| 597 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { | 597 if (IsResumableFunction(node->kind())) { |
| 598 DisableCrankshaft(kGenerator); | 598 DisableCrankshaft(kGenerator); |
| 599 } | 599 } |
| 600 | 600 |
| 601 if (IsClassConstructor(node->kind())) { | 601 if (IsClassConstructor(node->kind())) { |
| 602 DisableCrankshaft(kClassConstructorFunction); | 602 DisableCrankshaft(kClassConstructorFunction); |
| 603 } | 603 } |
| 604 | 604 |
| 605 VisitDeclarations(scope->declarations()); | 605 VisitDeclarations(scope->declarations()); |
| 606 VisitStatements(node->body()); | 606 VisitStatements(node->body()); |
| 607 | 607 |
| 608 node->set_ast_properties(&properties_); | 608 node->set_ast_properties(&properties_); |
| 609 node->set_dont_optimize_reason(dont_optimize_reason()); | 609 node->set_dont_optimize_reason(dont_optimize_reason()); |
| 610 node->set_yield_count(yield_count_); | 610 node->set_yield_count(yield_count_); |
| 611 return !HasStackOverflow(); | 611 return !HasStackOverflow(); |
| 612 } | 612 } |
| 613 | 613 |
| 614 | 614 |
| 615 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 615 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 616 FunctionLiteral* function) { | 616 FunctionLiteral* function) { |
| 617 AstNumberingVisitor visitor(isolate, zone); | 617 AstNumberingVisitor visitor(isolate, zone); |
| 618 return visitor.Renumber(function); | 618 return visitor.Renumber(function); |
| 619 } | 619 } |
| 620 } // namespace internal | 620 } // namespace internal |
| 621 } // namespace v8 | 621 } // namespace v8 |
| OLD | NEW |