diff options
author | 2021-10-21 13:05:46 +0000 | |
---|---|---|
committer | 2021-11-02 10:12:57 +0000 | |
commit | 46a8910372da2976c4e74273bacce17924b00d7a (patch) | |
tree | d94f0ca575a9539a69efd6e09613279dd90bc2fa /compiler/jni/quick/calling_convention.cc | |
parent | fa66389fbeeb2b4a6e1e1f5805653222f424a9bf (diff) |
Revert^2 "JNI: Remove `JniMethodFast{Start,End}()`."
This reverts commit 2ca0900e98d826644960eefeb8a21c84850c9e04.
Reason for revert: Fixed instrumentation for suspend check
from JNI stub, added a commented-out DCHECK() and a test.
The commented-out DCHECK() was correctly catching the bug
with the original submission but it also exposed deeper
issues with the instrumentation framework, so we cannot
fully enable it - bug 204766614 has been filed for this.
Original message:
Inline suspend check from `GoToRunnableFast()` to JNI stubs.
The only remaining code in `JniMethodFast{Start,End}()` is a
debug mode check that the method is @FastNative, so remove
the call altogether as we prefer better performance over the
debug mode check. Replace `JniMethodFastEndWithReference()`
with a simple `JniDecodeReferenceResult()`.
Golem results for art-opt-cc (higher is better):
linux-ia32 before after
NativeDowncallStaticFast 149.00 226.77 (+52.20%)
NativeDowncallStaticFast6 107.39 140.29 (+30.63%)
NativeDowncallStaticFastRefs6 104.50 130.54 (+24.92%)
NativeDowncallVirtualFast 147.28 207.09 (+40.61%)
NativeDowncallVirtualFast6 106.39 136.93 (+28.70%)
NativeDowncallVirtualFastRefs6 104.50 130.54 (+24.92%)
linux-x64 before after
NativeDowncallStaticFast 133.10 173.50 (+30.35%)
NativeDowncallStaticFast6 109.12 135.73 (+24.39%)
NativeDowncallStaticFastRefs6 105.29 127.18 (+20.79%)
NativeDowncallVirtualFast 127.74 167.66 (+31.25%)
NativeDowncallVirtualFast6 106.39 128.12 (+20.42%)
NativeDowncallVirtualFastRefs6 105.29 127.18 (+20.79%)
linux-armv7 before after
NativeDowncallStaticFast 18.058 21.622 (+19.74%)
NativeDowncallStaticFast6 14.903 17.057 (+14.45%)
NativeDowncallStaticFastRefs6 13.006 14.620 (+12.41%)
NativeDowncallVirtualFast 17.848 21.027 (+17.81%)
NativeDowncallVirtualFast6 15.196 17.439 (+14.76%)
NativeDowncallVirtualFastRefs6 12.897 14.764 (+14.48%)
linux-armv8 before after
NativeDowncallStaticFast 19.183 23.610 (+23.08%)
NativeDowncallStaticFast6 16.161 19.183 (+18.71%)
NativeDowncallStaticFastRefs6 13.235 15.041 (+13.64%)
NativeDowncallVirtualFast 17.839 20.741 (+16.26%)
NativeDowncallVirtualFast6 15.500 18.272 (+17.88%)
NativeDowncallVirtualFastRefs6 12.481 14.209 (+13.84%)
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Test: testrunner.py --host --jit --no-image
Test: testrunner.py --host --optimizing --debuggable -t 2005
Bug: 172332525
Bug: 204766614
Change-Id: I9cc7583fc11c457a53fe2d1a24a8befc0f36410d
Diffstat (limited to 'compiler/jni/quick/calling_convention.cc')
-rw-r--r-- | compiler/jni/quick/calling_convention.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/jni/quick/calling_convention.cc b/compiler/jni/quick/calling_convention.cc index fd05941d0d..e7a84fdaec 100644 --- a/compiler/jni/quick/calling_convention.cc +++ b/compiler/jni/quick/calling_convention.cc @@ -134,6 +134,7 @@ bool ManagedRuntimeCallingConvention::IsCurrentParamALong() { std::unique_ptr<JniCallingConvention> JniCallingConvention::Create(ArenaAllocator* allocator, bool is_static, bool is_synchronized, + bool is_fast_native, bool is_critical_native, const char* shorty, InstructionSet instruction_set) { @@ -143,25 +144,25 @@ std::unique_ptr<JniCallingConvention> JniCallingConvention::Create(ArenaAllocato case InstructionSet::kThumb2: return std::unique_ptr<JniCallingConvention>( new (allocator) arm::ArmJniCallingConvention( - is_static, is_synchronized, is_critical_native, shorty)); + is_static, is_synchronized, is_fast_native, is_critical_native, shorty)); #endif #ifdef ART_ENABLE_CODEGEN_arm64 case InstructionSet::kArm64: return std::unique_ptr<JniCallingConvention>( new (allocator) arm64::Arm64JniCallingConvention( - is_static, is_synchronized, is_critical_native, shorty)); + is_static, is_synchronized, is_fast_native, is_critical_native, shorty)); #endif #ifdef ART_ENABLE_CODEGEN_x86 case InstructionSet::kX86: return std::unique_ptr<JniCallingConvention>( new (allocator) x86::X86JniCallingConvention( - is_static, is_synchronized, is_critical_native, shorty)); + is_static, is_synchronized, is_fast_native, is_critical_native, shorty)); #endif #ifdef ART_ENABLE_CODEGEN_x86_64 case InstructionSet::kX86_64: return std::unique_ptr<JniCallingConvention>( new (allocator) x86_64::X86_64JniCallingConvention( - is_static, is_synchronized, is_critical_native, shorty)); + is_static, is_synchronized, is_fast_native, is_critical_native, shorty)); #endif default: LOG(FATAL) << "Unknown InstructionSet: " << instruction_set; |