--- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp Tue Oct 18 15:15:51 2016 +0000
+++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp Tue Oct 18 17:06:58 2016 +0000
@@ -454,8 +454,9 @@
__ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
#if INCLUDE_JVMCI
- // Check if we need to take lock at entry of synchronized method.
- if (UseJVMCICompiler) {
+ // 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 (UseJVMCICompiler && state == vtos && step == 0) {
Label L;
__ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
__ cbz(rscratch1, L);
@@ -464,8 +465,17 @@
// Take lock.
lock_method();
__ bind(L);
+ } else {
+#ifdef ASSERT
+ if (UseJVMCICompiler) {
+ Label L;
+ __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
+ __ cbz(rscratch1, L);
+ __ stop("unexpected pending monitor in deopt entry");
+ __ bind(L);
+ }
+#endif
}
-#endif
// handle exceptions
{
Label L;