From 41c3de26503b7e9ff8cd3dd480cf12a8cca8af83 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 7 Dec 2022 15:42:12 +0100 Subject: JNI: Fast-path for decoding returned jobject. Results for the timeGetBytesAscii#EMPTY benchmark from the libcore's StringToBytesBenchmark suite on blueline-userdebug with the cpu frequencies fixed at 1420800 (cpus 0-3; little) and 1459200 (cpus 4-7; big): 32-bit little: ~415 -> ~390 64-bit little: ~415 -> ~390 32-bit big: ~180 -> ~170 64-bit big: ~180 -> ~170 Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --debug --ndebug Test: run-gtests.sh Test: testrunner.py --target --optimizing --debug --ndebug Bug: 172332525 Change-Id: I0e19d583e5141e99a8b8c6fd9ae125fe7c9e02e7 --- compiler/utils/jni_macro_assembler.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/utils/jni_macro_assembler.h') diff --git a/compiler/utils/jni_macro_assembler.h b/compiler/utils/jni_macro_assembler.h index 15a4c3fe67..0c729705dc 100644 --- a/compiler/utils/jni_macro_assembler.h +++ b/compiler/utils/jni_macro_assembler.h @@ -158,6 +158,11 @@ class JNIMacroAssembler : public DeletableArenaObject { virtual void GetCurrentThread(ManagedRegister dest) = 0; virtual void GetCurrentThread(FrameOffset dest_offset) = 0; + // Decode JNI transition or local `jobject`. For (weak) global `jobject`, jump to slow path. + virtual void DecodeJNITransitionOrLocalJObject(ManagedRegister reg, + JNIMacroLabel* slow_path, + JNIMacroLabel* resume) = 0; + // Heap::VerifyObject on src. In some cases (such as a reference to this) we // know that src may not be null. virtual void VerifyObject(ManagedRegister src, bool could_be_null) = 0; -- cgit v1.2.3-59-g8ed1b