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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 | 552 |
553 void AstNumberingVisitor::VisitRewritableExpression( | 553 void AstNumberingVisitor::VisitRewritableExpression( |
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 Scope* 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()) DisableOptimization(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 int rest_index; | 569 int rest_index; |
570 if (scope->rest_parameter(&rest_index)) { | 570 if (scope->rest_parameter(&rest_index)) { |
571 DisableCrankshaft(kRestParameter); | 571 DisableCrankshaft(kRestParameter); |
572 } | 572 } |
(...skipping 15 matching lines...) Expand all Loading... |
588 } | 588 } |
589 | 589 |
590 | 590 |
591 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 591 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
592 FunctionLiteral* function) { | 592 FunctionLiteral* function) { |
593 AstNumberingVisitor visitor(isolate, zone); | 593 AstNumberingVisitor visitor(isolate, zone); |
594 return visitor.Renumber(function); | 594 return visitor.Renumber(function); |
595 } | 595 } |
596 } // namespace internal | 596 } // namespace internal |
597 } // namespace v8 | 597 } // namespace v8 |
OLD | NEW |