summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/register_allocator_linear_scan.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2017-09-21 22:50:39 +0100
committerVladimir Marko <vmarko@google.com>2017-09-25 15:45:01 +0100
commit0ebe0d83138bba1996e9c8007969b5381d972b32 (patch)
treea5ee66ebc5b587ade97e56ac8fc7d832fbbed4af /compiler/optimizing/register_allocator_linear_scan.cc
parente1e347dace0ded83774999bb26c37527dcdb1d5a (diff)
downloadart-0ebe0d83138bba1996e9c8007969b5381d972b32.tar.gz
art-0ebe0d83138bba1996e9c8007969b5381d972b32.tar.bz2
art-0ebe0d83138bba1996e9c8007969b5381d972b32.zip
ART: Introduce compiler data type.
Replace most uses of the runtime's Primitive in compiler with a new class DataType. This prepares for introducing new types, such as Uint8, that the runtime does not need to know about. Test: m test-art-host-gtest Test: testrunner.py --host Bug: 23964345 Change-Id: Iec2ad82454eec678fffcd8279a9746b90feb9b0c
Diffstat (limited to 'compiler/optimizing/register_allocator_linear_scan.cc')
-rw-r--r--compiler/optimizing/register_allocator_linear_scan.cc40
1 files changed, 20 insertions, 20 deletions
diff --git a/compiler/optimizing/register_allocator_linear_scan.cc b/compiler/optimizing/register_allocator_linear_scan.cc
index ab8d540359..2012cd5847 100644
--- a/compiler/optimizing/register_allocator_linear_scan.cc
+++ b/compiler/optimizing/register_allocator_linear_scan.cc
@@ -83,8 +83,8 @@ RegisterAllocatorLinearScan::RegisterAllocatorLinearScan(ArenaAllocator* allocat
static bool ShouldProcess(bool processing_core_registers, LiveInterval* interval) {
if (interval == nullptr) return false;
- bool is_core_register = (interval->GetType() != Primitive::kPrimDouble)
- && (interval->GetType() != Primitive::kPrimFloat);
+ bool is_core_register = (interval->GetType() != DataType::Type::kFloat64)
+ && (interval->GetType() != DataType::Type::kFloat32);
return processing_core_registers == is_core_register;
}
@@ -132,9 +132,9 @@ void RegisterAllocatorLinearScan::BlockRegister(Location location, size_t start,
LiveInterval* interval = location.IsRegister()
? physical_core_register_intervals_[reg]
: physical_fp_register_intervals_[reg];
- Primitive::Type type = location.IsRegister()
- ? Primitive::kPrimInt
- : Primitive::kPrimFloat;
+ DataType::Type type = location.IsRegister()
+ ? DataType::Type::kInt32
+ : DataType::Type::kFloat32;
if (interval == nullptr) {
interval = LiveInterval::MakeFixedInterval(allocator_, reg, type);
if (location.IsRegister()) {
@@ -237,7 +237,7 @@ void RegisterAllocatorLinearScan::ProcessInstruction(HInstruction* instruction)
switch (temp.GetPolicy()) {
case Location::kRequiresRegister: {
LiveInterval* interval =
- LiveInterval::MakeTempInterval(allocator_, Primitive::kPrimInt);
+ LiveInterval::MakeTempInterval(allocator_, DataType::Type::kInt32);
temp_intervals_.push_back(interval);
interval->AddTempUse(instruction, i);
unhandled_core_intervals_.push_back(interval);
@@ -246,10 +246,10 @@ void RegisterAllocatorLinearScan::ProcessInstruction(HInstruction* instruction)
case Location::kRequiresFpuRegister: {
LiveInterval* interval =
- LiveInterval::MakeTempInterval(allocator_, Primitive::kPrimDouble);
+ LiveInterval::MakeTempInterval(allocator_, DataType::Type::kFloat64);
temp_intervals_.push_back(interval);
interval->AddTempUse(instruction, i);
- if (codegen_->NeedsTwoRegisters(Primitive::kPrimDouble)) {
+ if (codegen_->NeedsTwoRegisters(DataType::Type::kFloat64)) {
interval->AddHighInterval(/* is_temp */ true);
LiveInterval* high = interval->GetHighInterval();
temp_intervals_.push_back(high);
@@ -266,8 +266,8 @@ void RegisterAllocatorLinearScan::ProcessInstruction(HInstruction* instruction)
}
}
- bool core_register = (instruction->GetType() != Primitive::kPrimDouble)
- && (instruction->GetType() != Primitive::kPrimFloat);
+ bool core_register = (instruction->GetType() != DataType::Type::kFloat64)
+ && (instruction->GetType() != DataType::Type::kFloat32);
if (locations->NeedsSafepoint()) {
if (codegen_->IsLeafMethod()) {
@@ -1104,24 +1104,24 @@ void RegisterAllocatorLinearScan::AllocateSpillSlotFor(LiveInterval* interval) {
ArenaVector<size_t>* spill_slots = nullptr;
switch (interval->GetType()) {
- case Primitive::kPrimDouble:
+ case DataType::Type::kFloat64:
spill_slots = &double_spill_slots_;
break;
- case Primitive::kPrimLong:
+ case DataType::Type::kInt64:
spill_slots = &long_spill_slots_;
break;
- case Primitive::kPrimFloat:
+ case DataType::Type::kFloat32:
spill_slots = &float_spill_slots_;
break;
- case Primitive::kPrimNot:
- case Primitive::kPrimInt:
- case Primitive::kPrimChar:
- case Primitive::kPrimByte:
- case Primitive::kPrimBoolean:
- case Primitive::kPrimShort:
+ case DataType::Type::kReference:
+ case DataType::Type::kInt32:
+ case DataType::Type::kUint16:
+ case DataType::Type::kInt8:
+ case DataType::Type::kBool:
+ case DataType::Type::kInt16:
spill_slots = &int_spill_slots_;
break;
- case Primitive::kPrimVoid:
+ case DataType::Type::kVoid:
LOG(FATAL) << "Unexpected type for interval " << interval->GetType();
}