< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page
rev 55818 : 8228601: AArch64: Fix interpreter code at JVMCI deoptimization entry
Reviewed-by: duke


 497 
 498   // Calculate stack limit
 499   __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
 500   __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
 501   __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
 502   __ ldr(rscratch2,
 503          Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
 504   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtx, 3);
 505   __ andr(sp, rscratch1, -16);
 506 
 507   // Restore expression stack pointer
 508   __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 509   // NULL last_sp until next java call
 510   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 511 
 512 #if INCLUDE_JVMCI
 513   // Check if we need to take lock at entry of synchronized method.  This can
 514   // only occur on method entry so emit it only for vtos with step 0.
 515   if ((EnableJVMCI || UseAOT) && state == vtos && step == 0) {
 516     Label L;
 517     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 518     __ cbz(rscratch1, L);
 519     // Clear flag.
 520     __ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset()));
 521     // Take lock.
 522     lock_method();
 523     __ bind(L);
 524   } else {
 525 #ifdef ASSERT
 526     if (EnableJVMCI) {
 527       Label L;
 528       __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 529       __ cbz(rscratch1, L);
 530       __ stop("unexpected pending monitor in deopt entry");
 531       __ bind(L);
 532     }
 533 #endif
 534   }
 535 #endif
 536   // handle exceptions
 537   {
 538     Label L;
 539     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 540     __ cbz(rscratch1, L);
 541     __ call_VM(noreg,
 542                CAST_FROM_FN_PTR(address,
 543                                 InterpreterRuntime::throw_pending_exception));
 544     __ should_not_reach_here();
 545     __ bind(L);
 546   }
 547 
 548   if (continuation == NULL) {




 497 
 498   // Calculate stack limit
 499   __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
 500   __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
 501   __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
 502   __ ldr(rscratch2,
 503          Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
 504   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtx, 3);
 505   __ andr(sp, rscratch1, -16);
 506 
 507   // Restore expression stack pointer
 508   __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 509   // NULL last_sp until next java call
 510   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 511 
 512 #if INCLUDE_JVMCI
 513   // Check if we need to take lock at entry of synchronized method.  This can
 514   // only occur on method entry so emit it only for vtos with step 0.
 515   if ((EnableJVMCI || UseAOT) && state == vtos && step == 0) {
 516     Label L;
 517     __ ldrb(rscratch1, Address(rthread, JavaThread::pending_monitorenter_offset()));
 518     __ cbz(rscratch1, L);
 519     // Clear flag.
 520     __ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset()));
 521     // Take lock.
 522     lock_method();
 523     __ bind(L);
 524   } else {
 525 #ifdef ASSERT
 526     if (EnableJVMCI) {
 527       Label L;
 528       __ ldrb(rscratch1, Address(rthread, JavaThread::pending_monitorenter_offset()));
 529       __ cbz(rscratch1, L);
 530       __ stop("unexpected pending monitor in deopt entry");
 531       __ bind(L);
 532     }
 533 #endif
 534   }
 535 #endif
 536   // handle exceptions
 537   {
 538     Label L;
 539     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 540     __ cbz(rscratch1, L);
 541     __ call_VM(noreg,
 542                CAST_FROM_FN_PTR(address,
 543                                 InterpreterRuntime::throw_pending_exception));
 544     __ should_not_reach_here();
 545     __ bind(L);
 546   }
 547 
 548   if (continuation == NULL) {


< prev index next >