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/ast-numbering.h" | 5 #include "src/ast/ast-numbering.h" |
6 | 6 |
7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 Visit(node->right()); | 363 Visit(node->right()); |
364 ReserveFeedbackSlots(node); | 364 ReserveFeedbackSlots(node); |
365 } | 365 } |
366 | 366 |
367 | 367 |
368 void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) { | 368 void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) { |
369 IncrementNodeCount(); | 369 IncrementNodeCount(); |
370 node->set_base_id(ReserveIdRange(CompareOperation::num_ids())); | 370 node->set_base_id(ReserveIdRange(CompareOperation::num_ids())); |
371 Visit(node->left()); | 371 Visit(node->left()); |
372 Visit(node->right()); | 372 Visit(node->right()); |
| 373 ReserveFeedbackSlots(node); |
373 } | 374 } |
374 | 375 |
375 | 376 |
376 void AstNumberingVisitor::VisitSpread(Spread* node) { UNREACHABLE(); } | 377 void AstNumberingVisitor::VisitSpread(Spread* node) { UNREACHABLE(); } |
377 | 378 |
378 | 379 |
379 void AstNumberingVisitor::VisitEmptyParentheses(EmptyParentheses* node) { | 380 void AstNumberingVisitor::VisitEmptyParentheses(EmptyParentheses* node) { |
380 UNREACHABLE(); | 381 UNREACHABLE(); |
381 } | 382 } |
382 | 383 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 VisitCaseClause(cases->at(i)); | 438 VisitCaseClause(cases->at(i)); |
438 } | 439 } |
439 } | 440 } |
440 | 441 |
441 | 442 |
442 void AstNumberingVisitor::VisitCaseClause(CaseClause* node) { | 443 void AstNumberingVisitor::VisitCaseClause(CaseClause* node) { |
443 IncrementNodeCount(); | 444 IncrementNodeCount(); |
444 node->set_base_id(ReserveIdRange(CaseClause::num_ids())); | 445 node->set_base_id(ReserveIdRange(CaseClause::num_ids())); |
445 if (!node->is_default()) Visit(node->label()); | 446 if (!node->is_default()) Visit(node->label()); |
446 VisitStatements(node->statements()); | 447 VisitStatements(node->statements()); |
| 448 ReserveFeedbackSlots(node); |
447 } | 449 } |
448 | 450 |
449 | 451 |
450 void AstNumberingVisitor::VisitForStatement(ForStatement* node) { | 452 void AstNumberingVisitor::VisitForStatement(ForStatement* node) { |
451 IncrementNodeCount(); | 453 IncrementNodeCount(); |
452 DisableSelfOptimization(); | 454 DisableSelfOptimization(); |
453 node->set_base_id(ReserveIdRange(ForStatement::num_ids())); | 455 node->set_base_id(ReserveIdRange(ForStatement::num_ids())); |
454 if (node->init() != NULL) Visit(node->init()); // Not part of loop. | 456 if (node->init() != NULL) Visit(node->init()); // Not part of loop. |
455 node->set_first_yield_id(yield_count_); | 457 node->set_first_yield_id(yield_count_); |
456 if (node->cond() != NULL) Visit(node->cond()); | 458 if (node->cond() != NULL) Visit(node->cond()); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 } | 604 } |
603 | 605 |
604 | 606 |
605 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 607 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
606 FunctionLiteral* function) { | 608 FunctionLiteral* function) { |
607 AstNumberingVisitor visitor(isolate, zone); | 609 AstNumberingVisitor visitor(isolate, zone); |
608 return visitor.Renumber(function); | 610 return visitor.Renumber(function); |
609 } | 611 } |
610 } // namespace internal | 612 } // namespace internal |
611 } // namespace v8 | 613 } // namespace v8 |
OLD | NEW |