| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 DisableOptimization(kDebuggerStatement); | 118 DisableOptimization(kDebuggerStatement); |
| 119 node->set_base_id(ReserveIdRange(DebuggerStatement::num_ids())); | 119 node->set_base_id(ReserveIdRange(DebuggerStatement::num_ids())); |
| 120 } | 120 } |
| 121 | 121 |
| 122 | 122 |
| 123 void AstNumberingVisitor::VisitNativeFunctionLiteral( | 123 void AstNumberingVisitor::VisitNativeFunctionLiteral( |
| 124 NativeFunctionLiteral* node) { | 124 NativeFunctionLiteral* node) { |
| 125 IncrementNodeCount(); | 125 IncrementNodeCount(); |
| 126 DisableOptimization(kNativeFunctionLiteral); | 126 DisableOptimization(kNativeFunctionLiteral); |
| 127 node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids())); | 127 node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids())); |
| 128 ReserveFeedbackSlots(node); | |
| 129 } | 128 } |
| 130 | 129 |
| 131 | 130 |
| 132 void AstNumberingVisitor::VisitDoExpression(DoExpression* node) { | 131 void AstNumberingVisitor::VisitDoExpression(DoExpression* node) { |
| 133 IncrementNodeCount(); | 132 IncrementNodeCount(); |
| 134 node->set_base_id(ReserveIdRange(DoExpression::num_ids())); | 133 node->set_base_id(ReserveIdRange(DoExpression::num_ids())); |
| 135 Visit(node->block()); | 134 Visit(node->block()); |
| 136 Visit(node->result()); | 135 Visit(node->result()); |
| 137 } | 136 } |
| 138 | 137 |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 Visit(arguments->at(i)); | 588 Visit(arguments->at(i)); |
| 590 } | 589 } |
| 591 } | 590 } |
| 592 | 591 |
| 593 | 592 |
| 594 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { | 593 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { |
| 595 IncrementNodeCount(); | 594 IncrementNodeCount(); |
| 596 node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids())); | 595 node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids())); |
| 597 // We don't recurse into the declarations or body of the function literal: | 596 // We don't recurse into the declarations or body of the function literal: |
| 598 // you have to separately Renumber() each FunctionLiteral that you compile. | 597 // you have to separately Renumber() each FunctionLiteral that you compile. |
| 599 ReserveFeedbackSlots(node); | |
| 600 } | 598 } |
| 601 | 599 |
| 602 | 600 |
| 603 void AstNumberingVisitor::VisitRewritableExpression( | 601 void AstNumberingVisitor::VisitRewritableExpression( |
| 604 RewritableExpression* node) { | 602 RewritableExpression* node) { |
| 605 IncrementNodeCount(); | 603 IncrementNodeCount(); |
| 606 node->set_base_id(ReserveIdRange(RewritableExpression::num_ids())); | 604 node->set_base_id(ReserveIdRange(RewritableExpression::num_ids())); |
| 607 Visit(node->expression()); | 605 Visit(node->expression()); |
| 608 } | 606 } |
| 609 | 607 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 } | 649 } |
| 652 | 650 |
| 653 | 651 |
| 654 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 652 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 655 FunctionLiteral* function) { | 653 FunctionLiteral* function) { |
| 656 AstNumberingVisitor visitor(isolate, zone); | 654 AstNumberingVisitor visitor(isolate, zone); |
| 657 return visitor.Renumber(function); | 655 return visitor.Renumber(function); |
| 658 } | 656 } |
| 659 } // namespace internal | 657 } // namespace internal |
| 660 } // namespace v8 | 658 } // namespace v8 |
| OLD | NEW |