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/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 351 |
352 | 352 |
353 void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) { | 353 void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) { |
354 IncrementNodeCount(); | 354 IncrementNodeCount(); |
355 node->set_base_id(ReserveIdRange(CompareOperation::num_ids())); | 355 node->set_base_id(ReserveIdRange(CompareOperation::num_ids())); |
356 Visit(node->left()); | 356 Visit(node->left()); |
357 Visit(node->right()); | 357 Visit(node->right()); |
358 } | 358 } |
359 | 359 |
360 | 360 |
| 361 void AstNumberingVisitor::VisitSpreadOperation(SpreadOperation* node) { |
| 362 IncrementNodeCount(); |
| 363 node->set_base_id(ReserveIdRange(SpreadOperation::num_ids())); |
| 364 Visit(node->expression()); |
| 365 } |
| 366 |
| 367 |
361 void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) { | 368 void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) { |
362 IncrementNodeCount(); | 369 IncrementNodeCount(); |
363 DisableSelfOptimization(); | 370 DisableSelfOptimization(); |
364 ReserveFeedbackSlots(node); | 371 ReserveFeedbackSlots(node); |
365 node->set_base_id(ReserveIdRange(ForInStatement::num_ids())); | 372 node->set_base_id(ReserveIdRange(ForInStatement::num_ids())); |
366 Visit(node->each()); | 373 Visit(node->each()); |
367 Visit(node->enumerable()); | 374 Visit(node->enumerable()); |
368 Visit(node->body()); | 375 Visit(node->body()); |
369 } | 376 } |
370 | 377 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 } | 559 } |
553 | 560 |
554 | 561 |
555 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 562 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
556 FunctionLiteral* function) { | 563 FunctionLiteral* function) { |
557 AstNumberingVisitor visitor(isolate, zone); | 564 AstNumberingVisitor visitor(isolate, zone); |
558 return visitor.Renumber(function); | 565 return visitor.Renumber(function); |
559 } | 566 } |
560 } | 567 } |
561 } // namespace v8::internal | 568 } // namespace v8::internal |
OLD | NEW |