| 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/linkage.h" | 5 #include "src/compiler/linkage.h" |
| 6 #include "src/compiler/register-allocator.h" | 6 #include "src/compiler/register-allocator.h" |
| 7 #include "src/string-stream.h" | 7 #include "src/string-stream.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2437 } | 2437 } |
| 2438 | 2438 |
| 2439 | 2439 |
| 2440 LiveRange* RegisterAllocator::SplitRangeAt(LiveRange* range, | 2440 LiveRange* RegisterAllocator::SplitRangeAt(LiveRange* range, |
| 2441 LifetimePosition pos) { | 2441 LifetimePosition pos) { |
| 2442 DCHECK(!range->IsFixed()); | 2442 DCHECK(!range->IsFixed()); |
| 2443 TraceAlloc("Splitting live range %d at %d\n", range->id(), pos.Value()); | 2443 TraceAlloc("Splitting live range %d at %d\n", range->id(), pos.Value()); |
| 2444 | 2444 |
| 2445 if (pos.Value() <= range->Start().Value()) return range; | 2445 if (pos.Value() <= range->Start().Value()) return range; |
| 2446 | 2446 |
| 2447 // We can't properly connect liveranges if split occured at the end | 2447 // We can't properly connect liveranges if splitting occurred at the end |
| 2448 // of control instruction. | 2448 // a block. |
| 2449 DCHECK(pos.IsInstructionStart() || | 2449 DCHECK(pos.IsInstructionStart() || |
| 2450 !InstructionAt(pos.InstructionIndex())->IsControl()); | 2450 (code()->GetInstructionBlock(pos.InstructionIndex())) |
| 2451 ->last_instruction_index() != pos.InstructionIndex()); |
| 2451 | 2452 |
| 2452 int vreg = GetVirtualRegister(); | 2453 int vreg = GetVirtualRegister(); |
| 2453 auto result = LiveRangeFor(vreg); | 2454 auto result = LiveRangeFor(vreg); |
| 2454 range->SplitAt(pos, result, local_zone()); | 2455 range->SplitAt(pos, result, local_zone()); |
| 2455 return result; | 2456 return result; |
| 2456 } | 2457 } |
| 2457 | 2458 |
| 2458 | 2459 |
| 2459 LiveRange* RegisterAllocator::SplitBetween(LiveRange* range, | 2460 LiveRange* RegisterAllocator::SplitBetween(LiveRange* range, |
| 2460 LifetimePosition start, | 2461 LifetimePosition start, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2582 } else { | 2583 } else { |
| 2583 DCHECK(range->Kind() == GENERAL_REGISTERS); | 2584 DCHECK(range->Kind() == GENERAL_REGISTERS); |
| 2584 assigned_registers_->Add(reg); | 2585 assigned_registers_->Add(reg); |
| 2585 } | 2586 } |
| 2586 range->set_assigned_register(reg, operand_cache()); | 2587 range->set_assigned_register(reg, operand_cache()); |
| 2587 } | 2588 } |
| 2588 | 2589 |
| 2589 } // namespace compiler | 2590 } // namespace compiler |
| 2590 } // namespace internal | 2591 } // namespace internal |
| 2591 } // namespace v8 | 2592 } // namespace v8 |
| OLD | NEW |