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/instruction_simplifier_arm64.cc b/compiler/optimizing/instruction_simplifier_arm64.cc
index 7c9bfb1..1c3b79d 100644
--- a/compiler/optimizing/instruction_simplifier_arm64.cc
+++ b/compiler/optimizing/instruction_simplifier_arm64.cc
@@ -38,8 +38,8 @@
DCHECK(CanFitInShifterOperand(bitfield_op));
DCHECK(!bitfield_op->HasEnvironmentUses());
- Primitive::Type type = use->GetType();
- if (type != Primitive::kPrimInt && type != Primitive::kPrimLong) {
+ DataType::Type type = use->GetType();
+ if (type != DataType::Type::kInt32 && type != DataType::Type::kInt64) {
return false;
}
@@ -150,7 +150,7 @@
}
void InstructionSimplifierArm64Visitor::VisitArraySet(HArraySet* instruction) {
- size_t access_size = Primitive::ComponentSize(instruction->GetComponentType());
+ size_t access_size = DataType::Size(instruction->GetComponentType());
size_t data_offset = mirror::Array::DataOffset(access_size).Uint32Value();
if (TryExtractArrayAccessAddress(instruction,
instruction->GetArray(),
@@ -185,15 +185,15 @@
}
void InstructionSimplifierArm64Visitor::VisitTypeConversion(HTypeConversion* instruction) {
- Primitive::Type result_type = instruction->GetResultType();
- Primitive::Type input_type = instruction->GetInputType();
+ DataType::Type result_type = instruction->GetResultType();
+ DataType::Type input_type = instruction->GetInputType();
if (input_type == result_type) {
// We let the arch-independent code handle this.
return;
}
- if (Primitive::IsIntegralType(result_type) && Primitive::IsIntegralType(input_type)) {
+ if (DataType::IsIntegralType(result_type) && DataType::IsIntegralType(input_type)) {
TryMergeIntoUsersShifterOperand(instruction);
}
}