Chromium Code Reviews| 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/base/adapters.h" | 5 #include "src/base/adapters.h" |
| 6 #include "src/compiler/linkage.h" | 6 #include "src/compiler/linkage.h" |
| 7 #include "src/compiler/register-allocator.h" | 7 #include "src/compiler/register-allocator.h" |
| 8 #include "src/string-stream.h" | 8 #include "src/string-stream.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2190 | 2190 |
| 2191 | 2191 |
| 2192 void LiveRangeBuilder::ProcessPhis(const InstructionBlock* block, | 2192 void LiveRangeBuilder::ProcessPhis(const InstructionBlock* block, |
| 2193 BitVector* live) { | 2193 BitVector* live) { |
| 2194 for (PhiInstruction* phi : block->phis()) { | 2194 for (PhiInstruction* phi : block->phis()) { |
| 2195 // The live range interval already ends at the first instruction of the | 2195 // The live range interval already ends at the first instruction of the |
| 2196 // block. | 2196 // block. |
| 2197 int phi_vreg = phi->virtual_register(); | 2197 int phi_vreg = phi->virtual_register(); |
| 2198 live->Remove(phi_vreg); | 2198 live->Remove(phi_vreg); |
| 2199 InstructionOperand* hint = nullptr; | 2199 InstructionOperand* hint = nullptr; |
| 2200 Instruction* instr = GetLastInstruction( | 2200 const InstructionBlock::Predecessors& predecessors = block->predecessors(); |
|
Jarin
2016/02/25 11:13:42
Could you add a comment with an explanation here?
Mircea Trofin
2016/02/25 15:22:52
Done.
| |
| 2201 code(), code()->InstructionBlockAt(block->predecessors()[0])); | 2201 const InstructionBlock* predecessor_block = |
| 2202 code()->InstructionBlockAt(predecessors[0]); | |
| 2203 const Instruction* instr = GetLastInstruction(code(), predecessor_block); | |
| 2204 if (predecessor_block->IsDeferred()) { | |
| 2205 for (size_t i = 1; i < predecessors.size(); ++i) { | |
|
titzer
2016/02/25 12:14:42
Could also simplify to
for (size_t i = 0; i < pre
Mircea Trofin
2016/02/25 15:22:51
Done.
| |
| 2206 predecessor_block = code()->InstructionBlockAt(predecessors[i]); | |
| 2207 if (predecessor_block->IsDeferred()) continue; | |
| 2208 | |
| 2209 instr = GetLastInstruction(code(), predecessor_block); | |
| 2210 break; | |
| 2211 } | |
| 2212 } | |
| 2213 DCHECK_NOT_NULL(instr); | |
| 2214 | |
| 2202 for (MoveOperands* move : *instr->GetParallelMove(Instruction::END)) { | 2215 for (MoveOperands* move : *instr->GetParallelMove(Instruction::END)) { |
| 2203 InstructionOperand& to = move->destination(); | 2216 InstructionOperand& to = move->destination(); |
| 2204 if (to.IsUnallocated() && | 2217 if (to.IsUnallocated() && |
| 2205 UnallocatedOperand::cast(to).virtual_register() == phi_vreg) { | 2218 UnallocatedOperand::cast(to).virtual_register() == phi_vreg) { |
| 2206 hint = &move->source(); | 2219 hint = &move->source(); |
| 2207 break; | 2220 break; |
| 2208 } | 2221 } |
| 2209 } | 2222 } |
| 2210 DCHECK(hint != nullptr); | 2223 DCHECK(hint != nullptr); |
| 2211 LifetimePosition block_start = LifetimePosition::GapFromInstructionIndex( | 2224 LifetimePosition block_start = LifetimePosition::GapFromInstructionIndex( |
| (...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3580 spill_operand); | 3593 spill_operand); |
| 3581 } | 3594 } |
| 3582 } | 3595 } |
| 3583 } | 3596 } |
| 3584 } | 3597 } |
| 3585 | 3598 |
| 3586 | 3599 |
| 3587 } // namespace compiler | 3600 } // namespace compiler |
| 3588 } // namespace internal | 3601 } // namespace internal |
| 3589 } // namespace v8 | 3602 } // namespace v8 |
| OLD | NEW |