Mercurial > hg > graal-jvmci-8
changeset 23762:a5a2ac8dfaba
Reduce the size of the deopt entry points in the interpreter
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Mon, 26 Sep 2016 13:54:28 -0700 |
parents | 1fece5f8307c |
children | bf2d00fc162b |
files | src/cpu/sparc/vm/templateInterpreter_sparc.cpp src/cpu/x86/vm/templateInterpreter_x86_64.cpp |
diffstat | 2 files changed, 23 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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