| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
| 9 #include "src/scopes.h" | 9 #include "src/scopes.h" |
| 10 | 10 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 node->set_base_id(ReserveIdRange(VariableProxy::num_ids())); | 161 node->set_base_id(ReserveIdRange(VariableProxy::num_ids())); |
| 162 } | 162 } |
| 163 | 163 |
| 164 | 164 |
| 165 void AstNumberingVisitor::VisitThisFunction(ThisFunction* node) { | 165 void AstNumberingVisitor::VisitThisFunction(ThisFunction* node) { |
| 166 IncrementNodeCount(); | 166 IncrementNodeCount(); |
| 167 node->set_base_id(ReserveIdRange(ThisFunction::num_ids())); | 167 node->set_base_id(ReserveIdRange(ThisFunction::num_ids())); |
| 168 } | 168 } |
| 169 | 169 |
| 170 | 170 |
| 171 void AstNumberingVisitor::VisitSuperReference(SuperReference* node) { | 171 void AstNumberingVisitor::VisitSuperPropertyReference( |
| 172 SuperPropertyReference* node) { |
| 172 IncrementNodeCount(); | 173 IncrementNodeCount(); |
| 173 DisableOptimization(kSuperReference); | 174 DisableOptimization(kSuperReference); |
| 174 node->set_base_id(ReserveIdRange(SuperReference::num_ids())); | 175 node->set_base_id(ReserveIdRange(SuperPropertyReference::num_ids())); |
| 175 Visit(node->this_var()); | 176 Visit(node->this_var()); |
| 176 Visit(node->home_object_var()); | 177 Visit(node->home_object_var()); |
| 177 } | 178 } |
| 178 | 179 |
| 179 | 180 |
| 181 void AstNumberingVisitor::VisitSuperCallReference(SuperCallReference* node) { |
| 182 IncrementNodeCount(); |
| 183 DisableOptimization(kSuperReference); |
| 184 node->set_base_id(ReserveIdRange(SuperCallReference::num_ids())); |
| 185 Visit(node->this_var()); |
| 186 Visit(node->new_target_var()); |
| 187 Visit(node->this_function_var()); |
| 188 } |
| 189 |
| 190 |
| 180 void AstNumberingVisitor::VisitImportDeclaration(ImportDeclaration* node) { | 191 void AstNumberingVisitor::VisitImportDeclaration(ImportDeclaration* node) { |
| 181 IncrementNodeCount(); | 192 IncrementNodeCount(); |
| 182 DisableOptimization(kImportDeclaration); | 193 DisableOptimization(kImportDeclaration); |
| 183 VisitVariableProxy(node->proxy()); | 194 VisitVariableProxy(node->proxy()); |
| 184 } | 195 } |
| 185 | 196 |
| 186 | 197 |
| 187 void AstNumberingVisitor::VisitExpressionStatement(ExpressionStatement* node) { | 198 void AstNumberingVisitor::VisitExpressionStatement(ExpressionStatement* node) { |
| 188 IncrementNodeCount(); | 199 IncrementNodeCount(); |
| 189 Visit(node->expression()); | 200 Visit(node->expression()); |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 } | 552 } |
| 542 | 553 |
| 543 | 554 |
| 544 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 555 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 545 FunctionLiteral* function) { | 556 FunctionLiteral* function) { |
| 546 AstNumberingVisitor visitor(isolate, zone); | 557 AstNumberingVisitor visitor(isolate, zone); |
| 547 return visitor.Renumber(function); | 558 return visitor.Renumber(function); |
| 548 } | 559 } |
| 549 } | 560 } |
| 550 } // namespace v8::internal | 561 } // namespace v8::internal |
| OLD | NEW |