diff options
author | 2017-09-21 22:50:39 +0100 | |
---|---|---|
committer | 2017-09-25 15:45:01 +0100 | |
commit | 0ebe0d83138bba1996e9c8007969b5381d972b32 (patch) | |
tree | a5ee66ebc5b587ade97e56ac8fc7d832fbbed4af /compiler/optimizing/bounds_check_elimination.cc | |
parent | e1e347dace0ded83774999bb26c37527dcdb1d5a (diff) |
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/bounds_check_elimination.cc')
-rw-r--r-- | compiler/optimizing/bounds_check_elimination.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index a170734ff2..a7f7bce07a 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -927,7 +927,7 @@ class BCEVisitor : public HGraphVisitor { void VisitPhi(HPhi* phi) OVERRIDE { if (phi->IsLoopHeaderPhi() - && (phi->GetType() == Primitive::kPrimInt) + && (phi->GetType() == DataType::Type::kInt32) && HasSameInputAtBackEdges(phi)) { HInstruction* instruction = phi->InputAt(1); HInstruction *left; @@ -1261,8 +1261,8 @@ class BCEVisitor : public HGraphVisitor { DCHECK_GE(min_c, 0); } else { HInstruction* lower = new (GetGraph()->GetArena()) - HAdd(Primitive::kPrimInt, base, GetGraph()->GetIntConstant(min_c)); - upper = new (GetGraph()->GetArena()) HAdd(Primitive::kPrimInt, base, upper); + HAdd(DataType::Type::kInt32, base, GetGraph()->GetIntConstant(min_c)); + upper = new (GetGraph()->GetArena()) HAdd(DataType::Type::kInt32, base, upper); block->InsertInstructionBefore(lower, bounds_check); block->InsertInstructionBefore(upper, bounds_check); InsertDeoptInBlock(bounds_check, new (GetGraph()->GetArena()) HAbove(lower, upper)); @@ -1801,7 +1801,7 @@ class BCEVisitor : public HGraphVisitor { // Scan all instructions in a new deoptimization block. for (HInstructionIterator it(true_block->GetInstructions()); !it.Done(); it.Advance()) { HInstruction* instruction = it.Current(); - Primitive::Type type = instruction->GetType(); + DataType::Type type = instruction->GetType(); HPhi* phi = nullptr; // Scan all uses of an instruction and replace each later use with a phi node. const HUseList<HInstruction*>& uses = instruction->GetUses(); @@ -1844,20 +1844,20 @@ class BCEVisitor : public HGraphVisitor { */ HPhi* NewPhi(HBasicBlock* new_preheader, HInstruction* instruction, - Primitive::Type type) { + DataType::Type type) { HGraph* graph = GetGraph(); HInstruction* zero; switch (type) { - case Primitive::kPrimNot: zero = graph->GetNullConstant(); break; - case Primitive::kPrimFloat: zero = graph->GetFloatConstant(0); break; - case Primitive::kPrimDouble: zero = graph->GetDoubleConstant(0); break; + case DataType::Type::kReference: zero = graph->GetNullConstant(); break; + case DataType::Type::kFloat32: zero = graph->GetFloatConstant(0); break; + case DataType::Type::kFloat64: zero = graph->GetDoubleConstant(0); break; default: zero = graph->GetConstant(type, 0); break; } HPhi* phi = new (graph->GetArena()) HPhi(graph->GetArena(), kNoRegNumber, /*number_of_inputs*/ 2, HPhi::ToPhiType(type)); phi->SetRawInputAt(0, instruction); phi->SetRawInputAt(1, zero); - if (type == Primitive::kPrimNot) { + if (type == DataType::Type::kReference) { phi->SetReferenceTypeInfo(instruction->GetReferenceTypeInfo()); } new_preheader->AddPhi(phi); |