# HG changeset patch # User Tom Rodriguez # Date 1474923268 25200 # Node ID a5a2ac8dfabab3280380e333c8840a84e9ac8544 # Parent 1fece5f8307c1c9993ab0bc26f4692a59e73caa3 Reduce the size of the deopt entry points in the interpreter diff -r 1fece5f8307c -r a5a2ac8dfaba src/cpu/sparc/vm/templateInterpreter_sparc.cpp --- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Fri Sep 23 17:54:00 2016 +0200 +++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Mon Sep 26 13:54:28 2016 -0700 @@ -204,8 +204,9 @@ 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. - { + // Check if we need to take lock at entry of synchronized method. This can + // only occur on method entry so emit it only for vtos with step 0. + if (state == vtos && step == 0) { Label L; Address pending_monitor_enter_addr(G2_thread, JavaThread::pending_monitorenter_offset()); __ ldbool(pending_monitor_enter_addr, Gtemp); // Load if pending monitor enter @@ -215,6 +216,15 @@ // Take lock. lock_method(); __ bind(L); + } else { +#ifdef ASSERT + 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); + __ stop("unexpected pending monitor in deopt entry"); + __ bind(L); +#endif } #endif { Label L; diff -r 1fece5f8307c -r a5a2ac8dfaba src/cpu/x86/vm/templateInterpreter_x86_64.cpp --- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Fri Sep 23 17:54:00 2016 +0200 +++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Mon Sep 26 13:54:28 2016 -0700 @@ -205,8 +205,9 @@ __ restore_bcp(); __ restore_locals(); #if INCLUDE_JVMCI - // Check if we need to take lock at entry of synchronized method. - { + // Check if we need to take lock at entry of synchronized method. This can + // only occur on method entry so emit it only for vtos with step 0. + if (state == vtos && step == 0) { Label L; __ cmpb(Address(r15_thread, JavaThread::pending_monitorenter_offset()), 0); __ jcc(Assembler::zero, L); @@ -217,6 +218,14 @@ // Take lock. lock_method(); __ bind(L); + } else { +#ifdef ASSERT + Label L; + __ cmpb(Address(r15_thread, JavaThread::pending_monitorenter_offset()), 0); + __ jccb(Assembler::zero, L); + __ stop("unexpected pending monitor in deopt entry"); + __ bind(L); +#endif } #endif // handle exceptions