Fix invokeinterface sharpened with kRuntimeCall.
Bug: 174260111
Bug: 173677667
Test: 728-imt-conflict-zygote
Test: atest com.android.bootimageprofile.BootImageProfileTest#testSystemServerProfile
Test: adb install com.google.android.art.apex
Change-Id: Ie600a0c8c8eb38d9084b796bac9184c06ea0a2f4
diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc
index fcc4e06..cdd5d22 100644
--- a/compiler/optimizing/code_generator_arm_vixl.cc
+++ b/compiler/optimizing/code_generator_arm_vixl.cc
@@ -3540,6 +3540,11 @@
} else {
__ Mov(RegisterFrom(hidden_reg), RegisterFrom(current_method));
}
+ } else if (invoke->GetHiddenArgumentLoadKind() == MethodLoadKind::kRuntimeCall) {
+ // We pass the method from the IMT in case of a conflict. This will ensure
+ // we go into the runtime to resolve the actual method.
+ CHECK_NE(temp.GetCode(), lr.GetCode());
+ __ Mov(RegisterFrom(hidden_reg), temp);
} else {
codegen_->LoadMethod(invoke->GetHiddenArgumentLoadKind(), hidden_reg, invoke);
}