| 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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 if (scope->calls_eval()) DisableCrankshaft(kFunctionCallsEval); | 585 if (scope->calls_eval()) DisableCrankshaft(kFunctionCallsEval); |
| 586 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { | 586 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
| 587 DisableCrankshaft(kContextAllocatedArguments); | 587 DisableCrankshaft(kContextAllocatedArguments); |
| 588 } | 588 } |
| 589 | 589 |
| 590 if (scope->rest_parameter() != nullptr) { | 590 if (scope->rest_parameter() != nullptr) { |
| 591 DisableCrankshaft(kRestParameter); | 591 DisableCrankshaft(kRestParameter); |
| 592 } | 592 } |
| 593 | 593 |
| 594 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { | 594 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { |
| 595 // TODO(neis): We may want to allow Turbofan optimization here if | 595 // Generators can be optimized if --turbo-from-bytecode is set. |
| 596 // --turbo-from-bytecode is set and we know that Ignition is used. | 596 if (FLAG_turbo_from_bytecode) { |
| 597 // Unfortunately we can't express that here. | 597 DisableCrankshaft(kGenerator); |
| 598 DisableOptimization(kGenerator); | 598 } else { |
| 599 DisableOptimization(kGenerator); |
| 600 } |
| 599 } | 601 } |
| 600 | 602 |
| 601 VisitDeclarations(scope->declarations()); | 603 VisitDeclarations(scope->declarations()); |
| 602 VisitStatements(node->body()); | 604 VisitStatements(node->body()); |
| 603 | 605 |
| 604 node->set_ast_properties(&properties_); | 606 node->set_ast_properties(&properties_); |
| 605 node->set_dont_optimize_reason(dont_optimize_reason()); | 607 node->set_dont_optimize_reason(dont_optimize_reason()); |
| 606 node->set_yield_count(yield_count_); | 608 node->set_yield_count(yield_count_); |
| 607 return !HasStackOverflow(); | 609 return !HasStackOverflow(); |
| 608 } | 610 } |
| 609 | 611 |
| 610 | 612 |
| 611 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 613 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 612 FunctionLiteral* function) { | 614 FunctionLiteral* function) { |
| 613 AstNumberingVisitor visitor(isolate, zone); | 615 AstNumberingVisitor visitor(isolate, zone); |
| 614 return visitor.Renumber(function); | 616 return visitor.Renumber(function); |
| 615 } | 617 } |
| 616 } // namespace internal | 618 } // namespace internal |
| 617 } // namespace v8 | 619 } // namespace v8 |
| OLD | NEW |