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 #ifndef V8_LITHIUM_INL_H_ | 5 #ifndef V8_LITHIUM_INL_H_ |
6 #define V8_LITHIUM_INL_H_ | 6 #define V8_LITHIUM_INL_H_ |
7 | 7 |
8 #include "src/lithium.h" | 8 #include "src/lithium.h" |
9 | 9 |
10 #if V8_TARGET_ARCH_IA32 | 10 #if V8_TARGET_ARCH_IA32 |
(...skipping 20 matching lines...) Expand all Loading... |
31 TempIterator::TempIterator(LInstruction* instr) | 31 TempIterator::TempIterator(LInstruction* instr) |
32 : instr_(instr), limit_(instr->TempCount()), current_(0) { | 32 : instr_(instr), limit_(instr->TempCount()), current_(0) { |
33 SkipUninteresting(); | 33 SkipUninteresting(); |
34 } | 34 } |
35 | 35 |
36 | 36 |
37 bool TempIterator::Done() { return current_ >= limit_; } | 37 bool TempIterator::Done() { return current_ >= limit_; } |
38 | 38 |
39 | 39 |
40 LOperand* TempIterator::Current() { | 40 LOperand* TempIterator::Current() { |
41 ASSERT(!Done()); | 41 DCHECK(!Done()); |
42 return instr_->TempAt(current_); | 42 return instr_->TempAt(current_); |
43 } | 43 } |
44 | 44 |
45 | 45 |
46 void TempIterator::SkipUninteresting() { | 46 void TempIterator::SkipUninteresting() { |
47 while (current_ < limit_ && instr_->TempAt(current_) == NULL) ++current_; | 47 while (current_ < limit_ && instr_->TempAt(current_) == NULL) ++current_; |
48 } | 48 } |
49 | 49 |
50 | 50 |
51 void TempIterator::Advance() { | 51 void TempIterator::Advance() { |
52 ++current_; | 52 ++current_; |
53 SkipUninteresting(); | 53 SkipUninteresting(); |
54 } | 54 } |
55 | 55 |
56 | 56 |
57 InputIterator::InputIterator(LInstruction* instr) | 57 InputIterator::InputIterator(LInstruction* instr) |
58 : instr_(instr), limit_(instr->InputCount()), current_(0) { | 58 : instr_(instr), limit_(instr->InputCount()), current_(0) { |
59 SkipUninteresting(); | 59 SkipUninteresting(); |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 bool InputIterator::Done() { return current_ >= limit_; } | 63 bool InputIterator::Done() { return current_ >= limit_; } |
64 | 64 |
65 | 65 |
66 LOperand* InputIterator::Current() { | 66 LOperand* InputIterator::Current() { |
67 ASSERT(!Done()); | 67 DCHECK(!Done()); |
68 ASSERT(instr_->InputAt(current_) != NULL); | 68 DCHECK(instr_->InputAt(current_) != NULL); |
69 return instr_->InputAt(current_); | 69 return instr_->InputAt(current_); |
70 } | 70 } |
71 | 71 |
72 | 72 |
73 void InputIterator::Advance() { | 73 void InputIterator::Advance() { |
74 ++current_; | 74 ++current_; |
75 SkipUninteresting(); | 75 SkipUninteresting(); |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 void InputIterator::SkipUninteresting() { | 79 void InputIterator::SkipUninteresting() { |
80 while (current_ < limit_) { | 80 while (current_ < limit_) { |
81 LOperand* current = instr_->InputAt(current_); | 81 LOperand* current = instr_->InputAt(current_); |
82 if (current != NULL && !current->IsConstantOperand()) break; | 82 if (current != NULL && !current->IsConstantOperand()) break; |
83 ++current_; | 83 ++current_; |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 | 87 |
88 UseIterator::UseIterator(LInstruction* instr) | 88 UseIterator::UseIterator(LInstruction* instr) |
89 : input_iterator_(instr), env_iterator_(instr->environment()) {} | 89 : input_iterator_(instr), env_iterator_(instr->environment()) {} |
90 | 90 |
91 | 91 |
92 bool UseIterator::Done() { | 92 bool UseIterator::Done() { |
93 return input_iterator_.Done() && env_iterator_.Done(); | 93 return input_iterator_.Done() && env_iterator_.Done(); |
94 } | 94 } |
95 | 95 |
96 | 96 |
97 LOperand* UseIterator::Current() { | 97 LOperand* UseIterator::Current() { |
98 ASSERT(!Done()); | 98 DCHECK(!Done()); |
99 LOperand* result = input_iterator_.Done() ? env_iterator_.Current() | 99 LOperand* result = input_iterator_.Done() ? env_iterator_.Current() |
100 : input_iterator_.Current(); | 100 : input_iterator_.Current(); |
101 ASSERT(result != NULL); | 101 DCHECK(result != NULL); |
102 return result; | 102 return result; |
103 } | 103 } |
104 | 104 |
105 | 105 |
106 void UseIterator::Advance() { | 106 void UseIterator::Advance() { |
107 input_iterator_.Done() ? env_iterator_.Advance() : input_iterator_.Advance(); | 107 input_iterator_.Done() ? env_iterator_.Advance() : input_iterator_.Advance(); |
108 } | 108 } |
109 } | 109 } |
110 } // namespace v8::internal | 110 } // namespace v8::internal |
111 | 111 |
112 #endif // V8_LITHIUM_INL_H_ | 112 #endif // V8_LITHIUM_INL_H_ |
OLD | NEW |