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 if (node->result()->is_assigned()) { |
| 139 Visit(node->result()); |
| 140 } |
| 141 VisitDeclarations(node->scope()->declarations()); |
| 142 VisitStatements(node->statements()); |
| 143 } |
| 144 |
| 145 |
135 void AstNumberingVisitor::VisitLiteral(Literal* node) { | 146 void AstNumberingVisitor::VisitLiteral(Literal* node) { |
136 IncrementNodeCount(); | 147 IncrementNodeCount(); |
137 node->set_base_id(ReserveIdRange(Literal::num_ids())); | 148 node->set_base_id(ReserveIdRange(Literal::num_ids())); |
138 } | 149 } |
139 | 150 |
140 | 151 |
141 void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { | 152 void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { |
142 IncrementNodeCount(); | 153 IncrementNodeCount(); |
143 node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids())); | 154 node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids())); |
144 } | 155 } |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 } | 579 } |
569 | 580 |
570 | 581 |
571 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 582 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
572 FunctionLiteral* function) { | 583 FunctionLiteral* function) { |
573 AstNumberingVisitor visitor(isolate, zone); | 584 AstNumberingVisitor visitor(isolate, zone); |
574 return visitor.Renumber(function); | 585 return visitor.Renumber(function); |
575 } | 586 } |
576 } // namespace internal | 587 } // namespace internal |
577 } // namespace v8 | 588 } // namespace v8 |
OLD | NEW |