OSDN Git Service

Fix mips32oc ArraySet null constant assignment
authorPavle Batuta <pavle.batuta@imgtec.com>
Tue, 3 Nov 2015 12:23:54 +0000 (13:23 +0100)
committerPavle Batuta <pavle.batuta@imgtec.com>
Wed, 4 Nov 2015 08:37:09 +0000 (09:37 +0100)
Fix assigning a null constant to an array index. Previously this
would unnecessarily invoke pAputObject.

This commit fixes previous test failure: 521-checker-array-set-null.

Change-Id: I02ff5296fa3a48b021c0dfd9bb10628ba6e5d5e5

compiler/optimizing/code_generator_mips.cc
test/Android.run-test.mk

index 29d08be..8106499 100644 (file)
@@ -1732,12 +1732,11 @@ void InstructionCodeGeneratorMIPS::VisitArrayLength(HArrayLength* instruction) {
 }
 
 void LocationsBuilderMIPS::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)));
index 9ff620b..8744674 100644 (file)
@@ -445,7 +445,6 @@ TEST_ART_BROKEN_DEFAULT_RUN_TESTS :=
 TEST_ART_BROKEN_OPTIMIZING_MIPS_RUN_TESTS := \
     441-checker-inliner \
     510-checker-try-catch \
-    521-checker-array-set-null \
     536-checker-intrinsic-optimization \
 
 ifeq (mips,$(TARGET_ARCH))