| 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 568 |
| 569 | 569 |
| 570 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { | 570 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
| 571 DeclarationScope* scope = node->scope(); | 571 DeclarationScope* scope = node->scope(); |
| 572 if (scope->new_target_var()) DisableCrankshaft(kSuperReference); | 572 if (scope->new_target_var()) DisableCrankshaft(kSuperReference); |
| 573 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); | 573 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); |
| 574 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { | 574 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
| 575 DisableCrankshaft(kContextAllocatedArguments); | 575 DisableCrankshaft(kContextAllocatedArguments); |
| 576 } | 576 } |
| 577 | 577 |
| 578 int rest_index; | 578 if (scope->rest_parameter() != nullptr) { |
| 579 if (scope->rest_parameter(&rest_index)) { | |
| 580 DisableCrankshaft(kRestParameter); | 579 DisableCrankshaft(kRestParameter); |
| 581 } | 580 } |
| 582 | 581 |
| 583 if (FLAG_ignition && scope->NeedsContext() && scope->is_script_scope()) { | 582 if (FLAG_ignition && scope->NeedsContext() && scope->is_script_scope()) { |
| 584 // Create ScopeInfo while on the main thread to avoid allocation during | 583 // Create ScopeInfo while on the main thread to avoid allocation during |
| 585 // potentially concurrent bytecode generation. | 584 // potentially concurrent bytecode generation. |
| 586 node->scope()->GetScopeInfo(isolate_); | 585 node->scope()->GetScopeInfo(isolate_); |
| 587 } | 586 } |
| 588 | 587 |
| 589 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { | 588 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 603 } | 602 } |
| 604 | 603 |
| 605 | 604 |
| 606 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 605 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 607 FunctionLiteral* function) { | 606 FunctionLiteral* function) { |
| 608 AstNumberingVisitor visitor(isolate, zone); | 607 AstNumberingVisitor visitor(isolate, zone); |
| 609 return visitor.Renumber(function); | 608 return visitor.Renumber(function); |
| 610 } | 609 } |
| 611 } // namespace internal | 610 } // namespace internal |
| 612 } // namespace v8 | 611 } // namespace v8 |
| OLD | NEW |