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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 | 134 |
135 return state.forwarded; | 135 return state.forwarded; |
136 } | 136 } |
137 | 137 |
138 | 138 |
139 void JumpThreading::ApplyForwarding(ZoneVector<RpoNumber>& result, | 139 void JumpThreading::ApplyForwarding(ZoneVector<RpoNumber>& result, |
140 InstructionSequence* code) { | 140 InstructionSequence* code) { |
141 if (!FLAG_turbo_jt) return; | 141 if (!FLAG_turbo_jt) return; |
142 | 142 |
143 Zone local_zone(code->zone()->isolate()); | 143 Zone local_zone; |
144 ZoneVector<bool> skip(static_cast<int>(result.size()), false, &local_zone); | 144 ZoneVector<bool> skip(static_cast<int>(result.size()), false, &local_zone); |
145 | 145 |
146 // Skip empty blocks when the previous block doesn't fall through. | 146 // Skip empty blocks when the previous block doesn't fall through. |
147 bool prev_fallthru = true; | 147 bool prev_fallthru = true; |
148 for (auto const block : code->instruction_blocks()) { | 148 for (auto const block : code->instruction_blocks()) { |
149 int block_num = block->rpo_number().ToInt(); | 149 int block_num = block->rpo_number().ToInt(); |
150 skip[block_num] = !prev_fallthru && result[block_num].ToInt() != block_num; | 150 skip[block_num] = !prev_fallthru && result[block_num].ToInt() != block_num; |
151 | 151 |
152 bool fallthru = true; | 152 bool fallthru = true; |
153 for (int i = block->code_start(); i < block->code_end(); ++i) { | 153 for (int i = block->code_start(); i < block->code_end(); ++i) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 if (block->IsDeferred()) { | 189 if (block->IsDeferred()) { |
190 block->set_ao_number(RpoNumber::FromInt(ao)); | 190 block->set_ao_number(RpoNumber::FromInt(ao)); |
191 if (!skip[block->rpo_number().ToInt()]) ao++; | 191 if (!skip[block->rpo_number().ToInt()]) ao++; |
192 } | 192 } |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 } // namespace compiler | 196 } // namespace compiler |
197 } // namespace internal | 197 } // namespace internal |
198 } // namespace v8 | 198 } // namespace v8 |
OLD | NEW |