diff options
author | 2023-06-23 13:47:01 +0000 | |
---|---|---|
committer | 2023-06-23 15:51:33 +0000 | |
commit | b93dae4ec296ce8353c8ad1b573a2336a6ce8973 (patch) | |
tree | f1924dbf2d251ec0c7190567e8fb57f2c1af09ea | |
parent | 53b2cc5490542610228a1acceb26bfdff17319ec (diff) |
riscv64: Implement trampoline compiler for `kJniAbi`.
Test: testrunner.py --target --64 --interpreter --ndebug -t 178
Bug: 283082089
Change-Id: If396a2b5082ec66607b0b44e48f1c39c341eb71b
-rw-r--r-- | compiler/trampolines/trampoline_compiler.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/trampolines/trampoline_compiler.cc b/compiler/trampolines/trampoline_compiler.cc index d1f8e7dfa7..739ec2965b 100644 --- a/compiler/trampolines/trampoline_compiler.cc +++ b/compiler/trampolines/trampoline_compiler.cc @@ -144,8 +144,12 @@ static std::unique_ptr<const std::vector<uint8_t>> CreateTrampoline(ArenaAllocat __ Jr(TMP); break; case kJniAbi: // Load via Thread* held in JNIEnv* in first argument (A0). - // TODO(riscv64): implement this. - __ Unimp(); + // Note: We use `TMP2` here because `TMP` can be used for source address by `Loadd()`. + __ Loadd(TMP2, + A0, + JNIEnvExt::SelfOffset(static_cast<size_t>(kRiscv64PointerSize)).Int32Value()); + __ Loadd(TMP, TMP2, offset.Int32Value()); + __ Jr(TMP); break; case kQuickAbi: // TR holds Thread*. __ Loadd(TMP, TR, offset.Int32Value()); |