Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 1 | // Copyright 2011 the V8 project authors. All rights reserved. |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 4 | |
| 5 | #ifndef V8_LITHIUM_ALLOCATOR_INL_H_ |
| 6 | #define V8_LITHIUM_ALLOCATOR_INL_H_ |
| 7 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 8 | #include "src/lithium-allocator.h" |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 9 | |
| 10 | #if V8_TARGET_ARCH_IA32 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 11 | #include "src/ia32/lithium-ia32.h" // NOLINT |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 12 | #elif V8_TARGET_ARCH_X64 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 13 | #include "src/x64/lithium-x64.h" // NOLINT |
| 14 | #elif V8_TARGET_ARCH_ARM64 |
| 15 | #include "src/arm64/lithium-arm64.h" // NOLINT |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 16 | #elif V8_TARGET_ARCH_ARM |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 17 | #include "src/arm/lithium-arm.h" // NOLINT |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame] | 18 | #elif V8_TARGET_ARCH_MIPS |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 19 | #include "src/mips/lithium-mips.h" // NOLINT |
| 20 | #elif V8_TARGET_ARCH_MIPS64 |
| 21 | #include "src/mips64/lithium-mips64.h" // NOLINT |
| 22 | #elif V8_TARGET_ARCH_X87 |
| 23 | #include "src/x87/lithium-x87.h" // NOLINT |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 24 | #else |
| 25 | #error "Unknown architecture." |
| 26 | #endif |
| 27 | |
| 28 | namespace v8 { |
| 29 | namespace internal { |
| 30 | |
| 31 | bool LAllocator::IsGapAt(int index) { return chunk_->IsGapAt(index); } |
| 32 | |
| 33 | |
| 34 | LInstruction* LAllocator::InstructionAt(int index) { |
| 35 | return chunk_->instructions()->at(index); |
| 36 | } |
| 37 | |
| 38 | |
| 39 | LGap* LAllocator::GapAt(int index) { |
| 40 | return chunk_->GetGapAt(index); |
| 41 | } |
| 42 | |
| 43 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 44 | void LAllocator::SetLiveRangeAssignedRegister(LiveRange* range, int reg) { |
| 45 | if (range->Kind() == DOUBLE_REGISTERS) { |
| 46 | assigned_double_registers_->Add(reg); |
| 47 | } else { |
| 48 | DCHECK(range->Kind() == GENERAL_REGISTERS); |
| 49 | assigned_registers_->Add(reg); |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 50 | } |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 51 | range->set_assigned_register(reg, chunk()->zone()); |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 55 | } } // namespace v8::internal |
| 56 | |
| 57 | #endif // V8_LITHIUM_ALLOCATOR_INL_H_ |