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-numbering.h" | 5 #include "src/ast-numbering.h" |
6 | 6 |
7 #include "src/ast.h" | 7 #include "src/ast.h" |
8 #include "src/scopes.h" | 8 #include "src/scopes.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 | 126 |
127 void AstNumberingVisitor::VisitNativeFunctionLiteral( | 127 void AstNumberingVisitor::VisitNativeFunctionLiteral( |
128 NativeFunctionLiteral* node) { | 128 NativeFunctionLiteral* node) { |
129 IncrementNodeCount(); | 129 IncrementNodeCount(); |
130 DisableOptimization(kNativeFunctionLiteral); | 130 DisableOptimization(kNativeFunctionLiteral); |
131 node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids())); | 131 node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids())); |
132 } | 132 } |
133 | 133 |
134 | 134 |
| 135 void AstNumberingVisitor::VisitDoExpression(DoExpression* node) { |
| 136 IncrementNodeCount(); |
| 137 node->set_base_id(ReserveIdRange(DoExpression::num_ids())); |
| 138 Visit(node->block()); |
| 139 Visit(node->result()); |
| 140 } |
| 141 |
| 142 |
135 void AstNumberingVisitor::VisitLiteral(Literal* node) { | 143 void AstNumberingVisitor::VisitLiteral(Literal* node) { |
136 IncrementNodeCount(); | 144 IncrementNodeCount(); |
137 node->set_base_id(ReserveIdRange(Literal::num_ids())); | 145 node->set_base_id(ReserveIdRange(Literal::num_ids())); |
138 } | 146 } |
139 | 147 |
140 | 148 |
141 void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { | 149 void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { |
142 IncrementNodeCount(); | 150 IncrementNodeCount(); |
143 node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids())); | 151 node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids())); |
144 } | 152 } |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 } | 576 } |
569 | 577 |
570 | 578 |
571 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 579 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
572 FunctionLiteral* function) { | 580 FunctionLiteral* function) { |
573 AstNumberingVisitor visitor(isolate, zone); | 581 AstNumberingVisitor visitor(isolate, zone); |
574 return visitor.Renumber(function); | 582 return visitor.Renumber(function); |
575 } | 583 } |
576 } // namespace internal | 584 } // namespace internal |
577 } // namespace v8 | 585 } // namespace v8 |
OLD | NEW |