summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2023-08-25 08:00:59 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2023-08-30 06:36:05 +0000
commit931ebb25cf5a07cf39d238db91831b5eff65a500 (patch)
tree0077fe8e682d8532522c8493e5ee903b37c17986 /compiler/optimizing
parent2a09bf4a70c8142724e0492dca94fde2ef96406c (diff)
riscv64: Fix register usage in `GenerateStaticOrDirectCall()`.
Test: aosp_cf_riscv64_phone boots with manually enabled HInvokeStaticOrDirect code generation. Bug: 283082089 Change-Id: Ibc0d98fd0f194d35694a990e5829c7611153f4f2
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/code_generator_riscv64.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/optimizing/code_generator_riscv64.cc b/compiler/optimizing/code_generator_riscv64.cc
index e22c1a64a1..2187957db8 100644
--- a/compiler/optimizing/code_generator_riscv64.cc
+++ b/compiler/optimizing/code_generator_riscv64.cc
@@ -4179,13 +4179,13 @@ void CodeGeneratorRISCV64::GenerateStaticOrDirectCall(HInvokeStaticOrDirect* inv
kNativeStackAlignment,
GetCriticalNativeDirectCallFrameSize>(invoke);
if (invoke->GetMethodLoadKind() == MethodLoadKind::kBootImageLinkTimePcRelative) {
- __ Jalr(TMP);
+ // Entrypoint is already loaded in RA.
} else {
- // TMP2 = callee_method->ptr_sized_fields_.data_; // EntryPointFromJni
+ // RA = callee_method->ptr_sized_fields_.data_; // EntryPointFromJni
MemberOffset offset = ArtMethod::EntryPointFromJniOffset(kRiscv64PointerSize);
- __ Loadd(TMP2, callee_method.AsRegister<XRegister>(), offset.Int32Value());
- __ Jalr(TMP2);
+ __ Loadd(RA, callee_method.AsRegister<XRegister>(), offset.Int32Value());
}
+ __ Jalr(RA);
RecordPcInfo(invoke, invoke->GetDexPc(), slow_path);
// The result is returned the same way in native ABI and managed ABI. No result conversion is
// needed, see comments in `Riscv64JniCallingConvention::RequiresSmallResultTypeExtension()`.