--- old/src/cpu/sparc/vm/templateInterpreter_sparc.cpp 2015-10-08 07:23:09.000000000 -1000 +++ new/src/cpu/sparc/vm/templateInterpreter_sparc.cpp 2015-10-08 07:23:09.000000000 -1000 @@ -204,6 +204,20 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, int step) { address entry = __ pc(); __ get_constant_pool_cache(LcpoolCache); // load LcpoolCache +#if INCLUDE_JVMCI + // Check if we need to take lock at entry of synchronized method. + if (UseJVMCICompiler) { + Label L; + Address pending_monitor_enter_addr(G2_thread, JavaThread::pending_monitorenter_offset()); + __ ldbool(pending_monitor_enter_addr, Gtemp); // Load if pending monitor enter + __ cmp_and_br_short(Gtemp, G0, Assembler::equal, Assembler::pn, L); + // Clear flag. + __ stbool(G0, pending_monitor_enter_addr); + // Take lock. + lock_method(); + __ bind(L); + } +#endif { Label L; Address exception_addr(G2_thread, Thread::pending_exception_offset()); __ ld_ptr(exception_addr, Gtemp); // Load pending exception. @@ -349,7 +363,7 @@ // Allocate monitor and lock method (asm interpreter) // ebx - Method* // -void InterpreterGenerator::lock_method(void) { +void TemplateInterpreterGenerator::lock_method() { __ ld(Lmethod, in_bytes(Method::access_flags_offset()), O0); // Load access flags. #ifdef ASSERT