Chromium Code Reviews| Index: src/hydrogen.h |
| diff --git a/src/hydrogen.h b/src/hydrogen.h |
| index 6c1aba5db66d709231b996207965af7146b758e9..661d8ac30e3934ea07a863d094abb5224abeed3c 100644 |
| --- a/src/hydrogen.h |
| +++ b/src/hydrogen.h |
| @@ -233,14 +233,21 @@ class HPredecessorIterator BASE_EMBEDDED { |
| class HInstructionIterator BASE_EMBEDDED { |
| public: |
| - explicit HInstructionIterator(HBasicBlock* block) : instr_(block->first()) { } |
| + explicit HInstructionIterator(HBasicBlock* block) |
| + : instr_(block->first()) { |
| + next_ = Done() ? NULL : instr_->next(); |
| + } |
| bool Done() { return instr_ == NULL; } |
|
titzer
2013/07/09 08:34:39
While you're here, would you mind adding "inline"
Hannes Payer (out of office)
2013/07/09 09:01:33
Done.
|
| HInstruction* Current() { return instr_; } |
| - void Advance() { instr_ = instr_->next(); } |
| + void Advance() { |
| + instr_ = next_; |
| + next_ = Done() ? NULL : instr_->next(); |
| + } |
| private: |
| HInstruction* instr_; |
| + HInstruction* next_; |
| }; |