lithium-allocator-inl.h 1.66 KB
Newer Older
1
// Copyright 2011 the V8 project authors. All rights reserved.
2 3
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
4

5 6
#ifndef V8_CRANKSHAFT_LITHIUM_ALLOCATOR_INL_H_
#define V8_CRANKSHAFT_LITHIUM_ALLOCATOR_INL_H_
7

8
#include "src/crankshaft/lithium-allocator.h"
9 10

#if V8_TARGET_ARCH_IA32
11
#include "src/crankshaft/ia32/lithium-ia32.h" // NOLINT
12
#elif V8_TARGET_ARCH_X64
13
#include "src/crankshaft/x64/lithium-x64.h" // NOLINT
14
#elif V8_TARGET_ARCH_ARM64
15
#include "src/crankshaft/arm64/lithium-arm64.h" // NOLINT
16
#elif V8_TARGET_ARCH_ARM
17
#include "src/crankshaft/arm/lithium-arm.h" // NOLINT
18
#elif V8_TARGET_ARCH_PPC
19
#include "src/crankshaft/ppc/lithium-ppc.h"  // NOLINT
20
#elif V8_TARGET_ARCH_MIPS
21
#include "src/crankshaft/mips/lithium-mips.h" // NOLINT
22
#elif V8_TARGET_ARCH_MIPS64
23
#include "src/crankshaft/mips64/lithium-mips64.h" // NOLINT
danno@chromium.org's avatar
danno@chromium.org committed
24
#elif V8_TARGET_ARCH_X87
25
#include "src/crankshaft/x87/lithium-x87.h" // NOLINT
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#else
#error "Unknown architecture."
#endif

namespace v8 {
namespace internal {

bool LAllocator::IsGapAt(int index) { return chunk_->IsGapAt(index); }


LInstruction* LAllocator::InstructionAt(int index) {
  return chunk_->instructions()->at(index);
}


LGap* LAllocator::GapAt(int index) {
  return chunk_->GetGapAt(index);
}


46 47
void LAllocator::SetLiveRangeAssignedRegister(LiveRange* range, int reg) {
  if (range->Kind() == DOUBLE_REGISTERS) {
48 49
    assigned_double_registers_->Add(reg);
  } else {
50
    DCHECK(range->Kind() == GENERAL_REGISTERS);
51 52
    assigned_registers_->Add(reg);
  }
53
  range->set_assigned_register(reg, chunk()->zone());
54 55 56
}


57 58
}  // namespace internal
}  // namespace v8
59

60
#endif  // V8_CRANKSHAFT_LITHIUM_ALLOCATOR_INL_H_