| Index: vm/intermediate_language.h
|
| ===================================================================
|
| --- vm/intermediate_language.h (revision 9874)
|
| +++ vm/intermediate_language.h (working copy)
|
| @@ -1950,6 +1950,7 @@
|
| public:
|
| explicit ForwardInstructionIterator(BlockEntryInstr* block_entry)
|
| : block_entry_(block_entry), current_(block_entry) {
|
| + ASSERT(block_entry_->last_instruction()->next() == NULL);
|
| Advance();
|
| }
|
|
|
| @@ -1958,9 +1959,7 @@
|
| current_ = current_->next();
|
| }
|
|
|
| - bool Done() const {
|
| - return current_ == block_entry_->last_instruction()->next();
|
| - }
|
| + bool Done() const { return current_ == NULL; }
|
|
|
| // Removes 'current_' from graph and sets 'current_' to previous instruction.
|
| void RemoveCurrentFromGraph();
|
| @@ -1973,6 +1972,28 @@
|
| };
|
|
|
|
|
| +class BackwardInstructionIterator : public ValueObject {
|
| + public:
|
| + explicit BackwardInstructionIterator(BlockEntryInstr* block_entry)
|
| + : block_entry_(block_entry), current_(block_entry->last_instruction()) {
|
| + ASSERT(block_entry_->previous() == NULL);
|
| + }
|
| +
|
| + void Advance() {
|
| + ASSERT(!Done());
|
| + current_ = current_->previous();
|
| + }
|
| +
|
| + bool Done() const { return current_ == block_entry_; }
|
| +
|
| + Instruction* Current() const { return current_; }
|
| +
|
| + private:
|
| + BlockEntryInstr* block_entry_;
|
| + Instruction* current_;
|
| +};
|
| +
|
| +
|
| class GraphEntryInstr : public BlockEntryInstr {
|
| public:
|
| explicit GraphEntryInstr(TargetEntryInstr* normal_entry)
|
|
|