From ae7ff92c430aa12484ff8258ee4ed13421ac7934 Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Thu, 6 Oct 2016 14:59:19 -0700 Subject: jni: Add read barrier fast path to jni compiler Static method dispatch via JNI requires a read barrier for the ArtMethod::GetDeclaringClass() load before adding it to the JNI StackHandleScope. We used to call ReadBarrierJni unconditionally but add a branch to skip calling it if the GC is not currently in the marking phase. Test: ART_USE_READ_BARRIER=true make test-art-host test-art-target Bug: 30437917 Change-Id: I4f505ebde17c0a67209c7bb51b3f39e37a06373a --- compiler/utils/mips/assembler_mips.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'compiler/utils/mips/assembler_mips.h') diff --git a/compiler/utils/mips/assembler_mips.h b/compiler/utils/mips/assembler_mips.h index e1255f7f23..b932fb82bc 100644 --- a/compiler/utils/mips/assembler_mips.h +++ b/compiler/utils/mips/assembler_mips.h @@ -179,6 +179,8 @@ class MipsExceptionSlowPath { class MipsAssembler FINAL : public Assembler, public JNIMacroAssembler { public: + using JNIBase = JNIMacroAssembler; + explicit MipsAssembler(ArenaAllocator* arena, const MipsInstructionSetFeatures* instruction_set_features = nullptr) : Assembler(arena), @@ -723,6 +725,34 @@ class MipsAssembler FINAL : public Assembler, public JNIMacroAssembler CreateLabel() OVERRIDE { + LOG(FATAL) << "Not implemented on MIPS32"; + UNREACHABLE(); + } + // Emit an unconditional jump to the label. + void Jump(JNIMacroLabel* label ATTRIBUTE_UNUSED) OVERRIDE { + LOG(FATAL) << "Not implemented on MIPS32"; + UNREACHABLE(); + } + // Emit a conditional jump to the label by applying a unary condition test to the register. + void Jump(JNIMacroLabel* label ATTRIBUTE_UNUSED, + JNIMacroUnaryCondition cond ATTRIBUTE_UNUSED, + ManagedRegister test ATTRIBUTE_UNUSED) OVERRIDE { + LOG(FATAL) << "Not implemented on MIPS32"; + UNREACHABLE(); + } + + // Code at this offset will serve as the target for the Jump call. + void Bind(JNIMacroLabel* label ATTRIBUTE_UNUSED) OVERRIDE { + LOG(FATAL) << "Not implemented on MIPS32"; + UNREACHABLE(); + } + // Create a new literal with a given value. // NOTE: Force the template parameter to be explicitly specified. template -- cgit v1.2.3-59-g8ed1b