ARM/MIPS: Avoid dead dex cache arrays base for intrinsics.
Test: Run ART test suite on host and Nexus 6.
Change-Id: Ie2ad70f1e3f125eae5dad53a6384d405e0311505
diff --git a/compiler/optimizing/pc_relative_fixups_x86.cc b/compiler/optimizing/pc_relative_fixups_x86.cc
index ad0921d..75587af 100644
--- a/compiler/optimizing/pc_relative_fixups_x86.cc
+++ b/compiler/optimizing/pc_relative_fixups_x86.cc
@@ -203,7 +203,7 @@
bool base_added = false;
if (invoke_static_or_direct != nullptr &&
invoke_static_or_direct->HasPcRelativeDexCache() &&
- !WillHaveCallFreeIntrinsicsCodeGen(invoke)) {
+ !IsCallFreeIntrinsic<IntrinsicLocationsBuilderX86>(invoke, codegen_)) {
InitializePCRelativeBasePointer();
// Add the extra parameter base_.
invoke_static_or_direct->AddSpecialInput(base_);
@@ -240,22 +240,6 @@
}
}
- bool WillHaveCallFreeIntrinsicsCodeGen(HInvoke* invoke) {
- if (invoke->GetIntrinsic() != Intrinsics::kNone) {
- // This invoke may have intrinsic code generation defined. However, we must
- // now also determine if this code generation is truly there and call-free
- // (not unimplemented, no bail on instruction features, or call on slow path).
- // This is done by actually calling the locations builder on the instruction
- // and clearing out the locations once result is known. We assume this
- // call only has creating locations as side effects!
- IntrinsicLocationsBuilderX86 builder(codegen_);
- bool success = builder.TryDispatch(invoke) && !invoke->GetLocations()->CanCall();
- invoke->SetLocations(nullptr);
- return success;
- }
- return false;
- }
-
CodeGeneratorX86* codegen_;
// The generated HX86ComputeBaseMethodAddress in the entry block needed as an