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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 317 |
318 | 318 |
319 void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) { | 319 void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) { |
320 IncrementNodeCount(); | 320 IncrementNodeCount(); |
321 node->set_base_id(ReserveIdRange(CompareOperation::num_ids())); | 321 node->set_base_id(ReserveIdRange(CompareOperation::num_ids())); |
322 Visit(node->left()); | 322 Visit(node->left()); |
323 Visit(node->right()); | 323 Visit(node->right()); |
324 } | 324 } |
325 | 325 |
326 | 326 |
327 void AstNumberingVisitor::VisitSpread(Spread* node) { UNREACHABLE(); } | 327 void AstNumberingVisitor::VisitSpread(Spread* node) { |
| 328 IncrementNodeCount(); |
| 329 DisableOptimization(kSpread); |
| 330 Visit(node->expression()); |
| 331 } |
328 | 332 |
329 | 333 |
330 void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) { | 334 void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) { |
331 IncrementNodeCount(); | 335 IncrementNodeCount(); |
332 DisableSelfOptimization(); | 336 DisableSelfOptimization(); |
333 ReserveFeedbackSlots(node); | 337 ReserveFeedbackSlots(node); |
334 node->set_base_id(ReserveIdRange(ForInStatement::num_ids())); | 338 node->set_base_id(ReserveIdRange(ForInStatement::num_ids())); |
335 Visit(node->each()); | 339 Visit(node->each()); |
336 Visit(node->enumerable()); | 340 Visit(node->enumerable()); |
337 Visit(node->body()); | 341 Visit(node->body()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 } | 525 } |
522 | 526 |
523 | 527 |
524 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 528 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
525 FunctionLiteral* function) { | 529 FunctionLiteral* function) { |
526 AstNumberingVisitor visitor(isolate, zone); | 530 AstNumberingVisitor visitor(isolate, zone); |
527 return visitor.Renumber(function); | 531 return visitor.Renumber(function); |
528 } | 532 } |
529 } | 533 } |
530 } // namespace v8::internal | 534 } // namespace v8::internal |
OLD | NEW |