OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 while (!result->IsBlockEntry()) result = result->previous(); | 636 while (!result->IsBlockEntry()) result = result->previous(); |
637 return result->AsBlockEntry(); | 637 return result->AsBlockEntry(); |
638 } | 638 } |
639 | 639 |
640 | 640 |
641 void ForwardInstructionIterator::RemoveCurrentFromGraph() { | 641 void ForwardInstructionIterator::RemoveCurrentFromGraph() { |
642 current_ = current_->RemoveFromGraph(true); // Set current_ to previous. | 642 current_ = current_->RemoveFromGraph(true); // Set current_ to previous. |
643 } | 643 } |
644 | 644 |
645 | 645 |
| 646 void BackwardInstructionIterator::RemoveCurrentFromGraph() { |
| 647 current_ = current_->RemoveFromGraph(false); // Set current_ to next. |
| 648 } |
| 649 |
| 650 |
646 // Default implementation of visiting basic blocks. Can be overridden. | 651 // Default implementation of visiting basic blocks. Can be overridden. |
647 void FlowGraphVisitor::VisitBlocks() { | 652 void FlowGraphVisitor::VisitBlocks() { |
648 ASSERT(current_iterator_ == NULL); | 653 ASSERT(current_iterator_ == NULL); |
649 for (intptr_t i = 0; i < block_order_.length(); ++i) { | 654 for (intptr_t i = 0; i < block_order_.length(); ++i) { |
650 BlockEntryInstr* entry = block_order_[i]; | 655 BlockEntryInstr* entry = block_order_[i]; |
651 entry->Accept(this); | 656 entry->Accept(this); |
652 ForwardInstructionIterator it(entry); | 657 ForwardInstructionIterator it(entry); |
653 current_iterator_ = ⁢ | 658 current_iterator_ = ⁢ |
654 for (; !it.Done(); it.Advance()) { | 659 for (; !it.Done(); it.Advance()) { |
655 it.Current()->Accept(this); | 660 it.Current()->Accept(this); |
(...skipping 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3396 case Token::kTRUNCDIV: return 0; | 3401 case Token::kTRUNCDIV: return 0; |
3397 case Token::kMOD: return 1; | 3402 case Token::kMOD: return 1; |
3398 default: UNIMPLEMENTED(); return -1; | 3403 default: UNIMPLEMENTED(); return -1; |
3399 } | 3404 } |
3400 } | 3405 } |
3401 | 3406 |
3402 | 3407 |
3403 #undef __ | 3408 #undef __ |
3404 | 3409 |
3405 } // namespace dart | 3410 } // namespace dart |
OLD | NEW |