| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 RewritableExpression* node) { | 554 RewritableExpression* node) { |
| 555 IncrementNodeCount(); | 555 IncrementNodeCount(); |
| 556 node->set_base_id(ReserveIdRange(RewritableExpression::num_ids())); | 556 node->set_base_id(ReserveIdRange(RewritableExpression::num_ids())); |
| 557 Visit(node->expression()); | 557 Visit(node->expression()); |
| 558 } | 558 } |
| 559 | 559 |
| 560 | 560 |
| 561 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { | 561 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
| 562 DeclarationScope* scope = node->scope(); | 562 DeclarationScope* scope = node->scope(); |
| 563 if (scope->new_target_var()) DisableCrankshaft(kSuperReference); | 563 if (scope->new_target_var()) DisableCrankshaft(kSuperReference); |
| 564 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); | 564 if (scope->calls_eval()) DisableCrankshaft(kFunctionCallsEval); |
| 565 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { | 565 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
| 566 DisableCrankshaft(kContextAllocatedArguments); | 566 DisableCrankshaft(kContextAllocatedArguments); |
| 567 } | 567 } |
| 568 | 568 |
| 569 if (scope->rest_parameter() != nullptr) { | 569 if (scope->rest_parameter() != nullptr) { |
| 570 DisableCrankshaft(kRestParameter); | 570 DisableCrankshaft(kRestParameter); |
| 571 } | 571 } |
| 572 | 572 |
| 573 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { | 573 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { |
| 574 // TODO(neis): We may want to allow Turbofan optimization here if | 574 // TODO(neis): We may want to allow Turbofan optimization here if |
| (...skipping 12 matching lines...) Expand all Loading... |
| 587 } | 587 } |
| 588 | 588 |
| 589 | 589 |
| 590 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 590 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 591 FunctionLiteral* function) { | 591 FunctionLiteral* function) { |
| 592 AstNumberingVisitor visitor(isolate, zone); | 592 AstNumberingVisitor visitor(isolate, zone); |
| 593 return visitor.Renumber(function); | 593 return visitor.Renumber(function); |
| 594 } | 594 } |
| 595 } // namespace internal | 595 } // namespace internal |
| 596 } // namespace v8 | 596 } // namespace v8 |
| OLD | NEW |