Fix location summary for LoadClass
Don't request a register for the current method if we're gonna call the
runtime.
Change-Id: I9760d15108bd95efb2a34e6eacd84b60841781d7
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index 07758e9..415b37d 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -3026,15 +3026,18 @@
}
void InstructionCodeGeneratorARM64::VisitLoadClass(HLoadClass* cls) {
- Register out = OutputRegister(cls);
- Register current_method = InputRegisterAt(cls, 0);
if (cls->NeedsAccessCheck()) {
codegen_->MoveConstant(cls->GetLocations()->GetTemp(0), cls->GetTypeIndex());
codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pInitializeTypeAndVerifyAccess),
cls,
cls->GetDexPc(),
nullptr);
- } else if (cls->IsReferrersClass()) {
+ return;
+ }
+
+ Register out = OutputRegister(cls);
+ Register current_method = InputRegisterAt(cls, 0);
+ if (cls->IsReferrersClass()) {
DCHECK(!cls->CanCallRuntime());
DCHECK(!cls->MustGenerateClinitCheck());
__ Ldr(out, MemOperand(current_method, ArtMethod::DeclaringClassOffset().Int32Value()));