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
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc
index 8a9acf1..bd14f2b 100644
--- a/compiler/optimizing/load_store_elimination.cc
+++ b/compiler/optimizing/load_store_elimination.cc
@@ -271,21 +271,21 @@
}
}
- HInstruction* GetDefaultValue(Primitive::Type type) {
+ HInstruction* GetDefaultValue(DataType::Type type) {
switch (type) {
- case Primitive::kPrimNot:
+ case DataType::Type::kReference:
return GetGraph()->GetNullConstant();
- case Primitive::kPrimBoolean:
- case Primitive::kPrimByte:
- case Primitive::kPrimChar:
- case Primitive::kPrimShort:
- case Primitive::kPrimInt:
+ case DataType::Type::kBool:
+ case DataType::Type::kInt8:
+ case DataType::Type::kUint16:
+ case DataType::Type::kInt16:
+ case DataType::Type::kInt32:
return GetGraph()->GetIntConstant(0);
- case Primitive::kPrimLong:
+ case DataType::Type::kInt64:
return GetGraph()->GetLongConstant(0);
- case Primitive::kPrimFloat:
+ case DataType::Type::kFloat32:
return GetGraph()->GetFloatConstant(0);
- case Primitive::kPrimDouble:
+ case DataType::Type::kFloat64:
return GetGraph()->GetDoubleConstant(0);
default:
UNREACHABLE();
@@ -328,8 +328,7 @@
// This acts like GVN but with better aliasing analysis.
heap_values[idx] = instruction;
} else {
- if (Primitive::PrimitiveKind(heap_value->GetType())
- != Primitive::PrimitiveKind(instruction->GetType())) {
+ if (DataType::Kind(heap_value->GetType()) != DataType::Kind(instruction->GetType())) {
// The only situation where the same heap location has different type is when
// we do an array get on an instruction that originates from the null constant
// (the null could be behind a field access, an array access, a null check or