OSDN Git Service

MIPS64: No call if ArraySet does not need a type check
authorDavid Brazdil <dbrazdil@google.com>
Mon, 21 Sep 2015 17:39:16 +0000 (18:39 +0100)
committerDavid Brazdil <dbrazdil@google.com>
Mon, 21 Sep 2015 17:39:16 +0000 (18:39 +0100)
The MIPS64 back-end did not use the ArraySet::NeedsTypeCheck query to
decide whether to invoke runtime or not like the other back-ends do.

Change-Id: Ie4ef9ee3ca97947256cd59983a2c1c3e3af58c83

compiler/optimizing/code_generator_mips64.cc

index 799827a..f4f53d5 100644 (file)
@@ -1444,12 +1444,11 @@ void InstructionCodeGeneratorMIPS64::VisitArrayLength(HArrayLength* instruction)
 }
 
 void LocationsBuilderMIPS64::VisitArraySet(HArraySet* instruction) {
-  Primitive::Type value_type = instruction->GetComponentType();
-  bool is_object = value_type == Primitive::kPrimNot;
+  bool needs_runtime_call = instruction->NeedsTypeCheck();
   LocationSummary* locations = new (GetGraph()->GetArena()) LocationSummary(
       instruction,
-      is_object ? LocationSummary::kCall : LocationSummary::kNoCall);
-  if (is_object) {
+      needs_runtime_call ? LocationSummary::kCall : LocationSummary::kNoCall);
+  if (needs_runtime_call) {
     InvokeRuntimeCallingConvention calling_convention;
     locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
     locations->SetInAt(1, Location::RegisterLocation(calling_convention.GetRegisterAt(1)));