OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/jump-threading.h" | 5 #include "src/compiler/jump-threading.h" |
6 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace compiler { | 10 namespace compiler { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 if (fallthru) { | 107 if (fallthru) { |
108 int next = 1 + block->rpo_number().ToInt(); | 108 int next = 1 + block->rpo_number().ToInt(); |
109 if (next < code->InstructionBlockCount()) fw = RpoNumber::FromInt(next); | 109 if (next < code->InstructionBlockCount()) fw = RpoNumber::FromInt(next); |
110 } | 110 } |
111 state.Forward(fw); | 111 state.Forward(fw); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 #if DEBUG | 115 #if DEBUG |
116 for (RpoNumber num : result) DCHECK(num.IsValid()); | 116 for (RpoNumber num : result) { |
| 117 CHECK(num.IsValid()); |
| 118 } |
117 #endif | 119 #endif |
118 | 120 |
119 for (int i = 0; i < static_cast<int>(result.size()); i++) { | 121 if (FLAG_trace_turbo_jt) { |
120 TRACE(("RPO%d B%d ", i, | 122 for (int i = 0; i < static_cast<int>(result.size()); i++) { |
121 code->InstructionBlockAt(RpoNumber::FromInt(i))->id().ToInt())); | 123 TRACE(("RPO%d B%d ", i, |
122 int to = result[i].ToInt(); | 124 code->InstructionBlockAt(RpoNumber::FromInt(i))->id().ToInt())); |
123 if (i != to) { | 125 int to = result[i].ToInt(); |
124 TRACE(("-> B%d\n", | 126 if (i != to) { |
125 code->InstructionBlockAt(RpoNumber::FromInt(to))->id().ToInt())); | 127 TRACE(("-> B%d\n", |
126 } else { | 128 code->InstructionBlockAt(RpoNumber::FromInt(to))->id().ToInt())); |
127 TRACE(("\n")); | 129 } else { |
| 130 TRACE(("\n")); |
| 131 } |
128 } | 132 } |
129 } | 133 } |
130 | 134 |
131 return state.forwarded; | 135 return state.forwarded; |
132 } | 136 } |
133 | 137 |
134 | 138 |
135 void JumpThreading::ApplyForwarding(ZoneVector<RpoNumber>& result, | 139 void JumpThreading::ApplyForwarding(ZoneVector<RpoNumber>& result, |
136 InstructionSequence* code) { | 140 InstructionSequence* code) { |
137 if (!FLAG_turbo_jt) return; | 141 if (!FLAG_turbo_jt) return; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 if (block->IsDeferred()) { | 189 if (block->IsDeferred()) { |
186 block->set_ao_number(RpoNumber::FromInt(ao)); | 190 block->set_ao_number(RpoNumber::FromInt(ao)); |
187 if (!skip[block->rpo_number().ToInt()]) ao++; | 191 if (!skip[block->rpo_number().ToInt()]) ao++; |
188 } | 192 } |
189 } | 193 } |
190 } | 194 } |
191 | 195 |
192 } // namespace compiler | 196 } // namespace compiler |
193 } // namespace internal | 197 } // namespace internal |
194 } // namespace v8 | 198 } // namespace v8 |
OLD | NEW |