| 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 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2382 | 2382 |
| 2383 | 2383 |
| 2384 LiveRange* RegisterAllocator::SplitRangeAt(LiveRange* range, | 2384 LiveRange* RegisterAllocator::SplitRangeAt(LiveRange* range, |
| 2385 LifetimePosition pos) { | 2385 LifetimePosition pos) { |
| 2386 DCHECK(!range->IsFixed()); | 2386 DCHECK(!range->IsFixed()); |
| 2387 TraceAlloc("Splitting live range %d at %d\n", range->id(), pos.Value()); | 2387 TraceAlloc("Splitting live range %d at %d\n", range->id(), pos.Value()); |
| 2388 | 2388 |
| 2389 if (pos.Value() <= range->Start().Value()) return range; | 2389 if (pos.Value() <= range->Start().Value()) return range; |
| 2390 | 2390 |
| 2391 // We can't properly connect liveranges if split occured at the end | 2391 // We can't properly connect liveranges if split occured at the end |
| 2392 // of control instruction. | 2392 // a block. |
| 2393 DCHECK(pos.IsInstructionStart() || | 2393 DCHECK(pos.IsInstructionStart() || |
| 2394 !InstructionAt(pos.InstructionIndex())->IsControl()); | 2394 code() |
| 2395 ->GetInstructionBlock(pos.InstructionIndex()) |
| 2396 ->last_instruction_index() != pos.InstructionIndex()); |
| 2395 | 2397 |
| 2396 int vreg = GetVirtualRegister(); | 2398 int vreg = GetVirtualRegister(); |
| 2397 if (!AllocationOk()) return nullptr; | 2399 if (!AllocationOk()) return nullptr; |
| 2398 auto result = LiveRangeFor(vreg); | 2400 auto result = LiveRangeFor(vreg); |
| 2399 range->SplitAt(pos, result, local_zone()); | 2401 range->SplitAt(pos, result, local_zone()); |
| 2400 return result; | 2402 return result; |
| 2401 } | 2403 } |
| 2402 | 2404 |
| 2403 | 2405 |
| 2404 LiveRange* RegisterAllocator::SplitBetween(LiveRange* range, | 2406 LiveRange* RegisterAllocator::SplitBetween(LiveRange* range, |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2544 } else { | 2546 } else { |
| 2545 DCHECK(range->Kind() == GENERAL_REGISTERS); | 2547 DCHECK(range->Kind() == GENERAL_REGISTERS); |
| 2546 assigned_registers_->Add(reg); | 2548 assigned_registers_->Add(reg); |
| 2547 } | 2549 } |
| 2548 range->set_assigned_register(reg, code_zone()); | 2550 range->set_assigned_register(reg, code_zone()); |
| 2549 } | 2551 } |
| 2550 | 2552 |
| 2551 } // namespace compiler | 2553 } // namespace compiler |
| 2552 } // namespace internal | 2554 } // namespace internal |
| 2553 } // namespace v8 | 2555 } // namespace v8 |
| OLD | NEW |