| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 TRACE("jt [%d] B%d\n", static_cast<int>(stack.size()), | 73 TRACE("jt [%d] B%d\n", static_cast<int>(stack.size()), |
| 74 block->rpo_number().ToInt()); | 74 block->rpo_number().ToInt()); |
| 75 bool fallthru = true; | 75 bool fallthru = true; |
| 76 RpoNumber fw = block->rpo_number(); | 76 RpoNumber fw = block->rpo_number(); |
| 77 for (int i = block->code_start(); i < block->code_end(); ++i) { | 77 for (int i = block->code_start(); i < block->code_end(); ++i) { |
| 78 Instruction* instr = code->InstructionAt(i); | 78 Instruction* instr = code->InstructionAt(i); |
| 79 if (!instr->AreMovesRedundant()) { | 79 if (!instr->AreMovesRedundant()) { |
| 80 // can't skip instructions with non redundant moves. | 80 // can't skip instructions with non redundant moves. |
| 81 TRACE(" parallel move\n"); | 81 TRACE(" parallel move\n"); |
| 82 fallthru = false; | 82 fallthru = false; |
| 83 } else if (instr->IsSourcePosition()) { | |
| 84 // skip source positions. | |
| 85 TRACE(" src pos\n"); | |
| 86 continue; | |
| 87 } else if (FlagsModeField::decode(instr->opcode()) != kFlags_none) { | 83 } else if (FlagsModeField::decode(instr->opcode()) != kFlags_none) { |
| 88 // can't skip instructions with flags continuations. | 84 // can't skip instructions with flags continuations. |
| 89 TRACE(" flags\n"); | 85 TRACE(" flags\n"); |
| 90 fallthru = false; | 86 fallthru = false; |
| 91 } else if (instr->IsNop()) { | 87 } else if (instr->IsNop()) { |
| 92 // skip nops. | 88 // skip nops. |
| 93 TRACE(" nop\n"); | 89 TRACE(" nop\n"); |
| 94 continue; | 90 continue; |
| 95 } else if (instr->arch_opcode() == kArchJmp) { | 91 } else if (instr->arch_opcode() == kArchJmp) { |
| 96 // try to forward the jump instruction. | 92 // try to forward the jump instruction. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 if (block->IsDeferred()) { | 183 if (block->IsDeferred()) { |
| 188 block->set_ao_number(RpoNumber::FromInt(ao)); | 184 block->set_ao_number(RpoNumber::FromInt(ao)); |
| 189 if (!skip[block->rpo_number().ToInt()]) ao++; | 185 if (!skip[block->rpo_number().ToInt()]) ao++; |
| 190 } | 186 } |
| 191 } | 187 } |
| 192 } | 188 } |
| 193 | 189 |
| 194 } // namespace compiler | 190 } // namespace compiler |
| 195 } // namespace internal | 191 } // namespace internal |
| 196 } // namespace v8 | 192 } // namespace v8 |
| OLD | NEW |