From 1c3c106fc896453e6e9b8dd5914eddf5b20d2416 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 3 Dec 2019 11:18:44 +0000 Subject: jni: Do not create a managed frame for @CriticalNative. Omit managed frame for @CriticalNative methods, do not check for exceptions and and make a tail call when possible. Pass the method pointer in a hidden argument to prepare for implementing late binding for @CriticalNative methods. This changes only the JNI compiler, Generic JNI shall be updated in a separate change. Performance improvements reported by Golem (art-opt-cc): x86 x86-64 arm arm64 NativeDowncallStaticCritical6 +17% +50% +88% +139% NativeDowncallStaticCritical +37% +32% +103% +216% Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 112189621 Change-Id: I5758c8f478627f2eee8f615b4537a907c211b9f8 --- compiler/utils/mips/assembler_mips.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'compiler/utils/mips/assembler_mips.cc') diff --git a/compiler/utils/mips/assembler_mips.cc b/compiler/utils/mips/assembler_mips.cc index a9d1a25530..6b73695208 100644 --- a/compiler/utils/mips/assembler_mips.cc +++ b/compiler/utils/mips/assembler_mips.cc @@ -5191,6 +5191,17 @@ void MipsAssembler::VerifyObject(FrameOffset src ATTRIBUTE_UNUSED, // TODO: not validating references. } +void MipsAssembler::Jump(ManagedRegister mbase, Offset offset, ManagedRegister mscratch) { + MipsManagedRegister base = mbase.AsMips(); + MipsManagedRegister scratch = mscratch.AsMips(); + CHECK(base.IsCoreRegister()) << base; + CHECK(scratch.IsCoreRegister()) << scratch; + LoadFromOffset(kLoadWord, scratch.AsCoreRegister(), + base.AsCoreRegister(), offset.Int32Value()); + Jr(scratch.AsCoreRegister()); + NopIfNoReordering(); +} + void MipsAssembler::Call(ManagedRegister mbase, Offset offset, ManagedRegister mscratch) { MipsManagedRegister base = mbase.AsMips(); MipsManagedRegister scratch = mscratch.AsMips(); -- cgit v1.2.3-59-g8ed1b