summaryrefslogtreecommitdiff
path: root/compiler/jni/quick/calling_convention.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2021-10-14 09:32:01 +0100
committer Vladimir Marko <vmarko@google.com> 2021-10-19 13:25:55 +0000
commit64d6e187f19ed670429652020561887e6b220216 (patch)
tree0b7d39fd7d0a155786d84f23364313a7f63542a7 /compiler/jni/quick/calling_convention.h
parentb37da9d4ffbc5ab42c41fcd60dc0dac6357ea13b (diff)
JNI: Remove `JniMethodFast{Start,End}()`.
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 Bug: 172332525 Change-Id: I680aaeaa0c1a55796271328180e9d4ed7d89c0b8
Diffstat (limited to 'compiler/jni/quick/calling_convention.h')
-rw-r--r--compiler/jni/quick/calling_convention.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/jni/quick/calling_convention.h b/compiler/jni/quick/calling_convention.h
index e62fc33a85..faa83daf7c 100644
--- a/compiler/jni/quick/calling_convention.h
+++ b/compiler/jni/quick/calling_convention.h
@@ -291,6 +291,7 @@ class JniCallingConvention : public CallingConvention {
static std::unique_ptr<JniCallingConvention> Create(ArenaAllocator* allocator,
bool is_static,
bool is_synchronized,
+ bool is_fast_native,
bool is_critical_native,
const char* shorty,
InstructionSet instruction_set);
@@ -348,6 +349,10 @@ class JniCallingConvention : public CallingConvention {
return 4u;
}
+ bool IsFastNative() const {
+ return is_fast_native_;
+ }
+
bool IsCriticalNative() const {
return is_critical_native_;
}
@@ -376,9 +381,10 @@ class JniCallingConvention : public CallingConvention {
// Does the transition back spill the return value in the stack frame?
bool SpillsReturnValue() const {
- // Exclude return value for @CriticalNative methods for optimization speed.
+ // Exclude return value for @FastNative and @CriticalNative methods for optimization speed.
// References are passed directly to the "end method" and there is nothing to save for `void`.
- return !IsCriticalNative() && !IsReturnAReference() && SizeOfReturnValue() != 0u;
+ return (!IsFastNative() && !IsCriticalNative()) &&
+ (!IsReturnAReference() && SizeOfReturnValue() != 0u);
}
protected:
@@ -390,10 +396,12 @@ class JniCallingConvention : public CallingConvention {
JniCallingConvention(bool is_static,
bool is_synchronized,
+ bool is_fast_native,
bool is_critical_native,
const char* shorty,
PointerSize frame_pointer_size)
: CallingConvention(is_static, is_synchronized, shorty, frame_pointer_size),
+ is_fast_native_(is_fast_native),
is_critical_native_(is_critical_native) {}
protected:
@@ -426,6 +434,7 @@ class JniCallingConvention : public CallingConvention {
// Is the current argument (at the iterator) an extra argument for JNI?
bool IsCurrentArgExtraForJni() const;
+ const bool is_fast_native_;
const bool is_critical_native_;
private: