summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
author Jaeheon Yi <jaeheon@google.com> 2023-11-10 17:47:34 -0800
committer Jaeheon Yi <jaeheon@google.com> 2023-11-15 20:11:27 +0000
commit301feae50e211656ec3ae1d0ac9445ca8bba623d (patch)
treecd59298c9e936713af73fee917c913ba906cddba /runtime/class_linker.cc
parenta3b8c73d8ae9943c8aaabf49349302b4c05cea71 (diff)
riscv64: re-enable an invoke fast path
The meaning of ART_METHOD_NTERP_INVOKE_FAST_PATH_FLAG_BIT for RISC-V narrows the condition to object refs only. See invoke.S for notes on code structure. Test: Run these opcodes against all interpreter tests on a Linux RISC-V VM. (1) setup lunch aosp_riscv64-trunk-userdebug export ART_TEST_SSH_USER=ubuntu export ART_TEST_SSH_HOST=localhost export ART_TEST_SSH_PORT=10001 export ART_TEST_ON_VM=true . art/tools/buildbot-utils.sh art/tools/buildbot-build.sh --target # Create, boot and configure the VM. art/tools/buildbot-vm.sh create art/tools/buildbot-vm.sh boot art/tools/buildbot-vm.sh setup-ssh # password: 'ubuntu' art/tools/buildbot-cleanup-device.sh art/tools/buildbot-setup-device.sh art/tools/buildbot-sync.sh (2) test art/test.py --target -r --no-prebuild --ndebug --64 -j 12 --cdex-none --interpreter Clean with `m check_cfi`. Bug: 283082047 Change-Id: Ie1ecee895cb6d8abad40970041e95388feb530e2
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index d08fe23439..3b0dda299e 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -4005,13 +4005,12 @@ void ClassLinker::LoadMethod(const DexFile& dex_file,
}
}
}
- if (all_parameters_are_reference_or_int && shorty[0] != 'F' && shorty[0] != 'D') {
- // FIXME(riscv64): This optimization is currently disabled because riscv64 needs
- // to distinguish between zero-extended references and sign-extended integers.
- // We should enable this for references only and fix corresponding nterp fast-paths.
- if (kRuntimeISA != InstructionSet::kRiscv64) {
- access_flags |= kAccNterpInvokeFastPathFlag;
- }
+ if (kRuntimeISA != InstructionSet::kRiscv64 && all_parameters_are_reference_or_int &&
+ shorty[0] != 'F' && shorty[0] != 'D') {
+ access_flags |= kAccNterpInvokeFastPathFlag;
+ } else if (kRuntimeISA == InstructionSet::kRiscv64 && all_parameters_are_reference &&
+ shorty[0] != 'F' && shorty[0] != 'D') {
+ access_flags |= kAccNterpInvokeFastPathFlag;
}
if (UNLIKELY((access_flags & kAccNative) != 0u)) {