From 0ebe0d83138bba1996e9c8007969b5381d972b32 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 21 Sep 2017 22:50:39 +0100 Subject: 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 --- compiler/optimizing/scheduler.cc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'compiler/optimizing/scheduler.cc') diff --git a/compiler/optimizing/scheduler.cc b/compiler/optimizing/scheduler.cc index 38cd51bef6..5212e866cf 100644 --- a/compiler/optimizing/scheduler.cc +++ b/compiler/optimizing/scheduler.cc @@ -16,9 +16,11 @@ #include -#include "prepare_for_register_allocation.h" #include "scheduler.h" +#include "data_type-inl.h" +#include "prepare_for_register_allocation.h" + #ifdef ART_ENABLE_CODEGEN_arm64 #include "scheduler_arm64.h" #endif @@ -399,17 +401,7 @@ bool SchedulingGraph::HasImmediateOtherDependency(const HInstruction* instructio } static const std::string InstructionTypeId(const HInstruction* instruction) { - std::string id; - Primitive::Type type = instruction->GetType(); - if (type == Primitive::kPrimNot) { - id.append("l"); - } else { - id.append(Primitive::Descriptor(instruction->GetType())); - } - // Use lower-case to be closer to the `HGraphVisualizer` output. - id[0] = std::tolower(id[0]); - id.append(std::to_string(instruction->GetId())); - return id; + return DataType::TypeId(instruction->GetType()) + std::to_string(instruction->GetId()); } // Ideally we would reuse the graph visualizer code, but it is not available -- cgit v1.2.3-59-g8ed1b