< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page




 455   __ get_method(rmethod);
 456   __ get_dispatch();
 457 
 458   // Calculate stack limit
 459   __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
 460   __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
 461   __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
 462   __ ldr(rscratch2,
 463          Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
 464   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtx, 3);
 465   __ andr(sp, rscratch1, -16);
 466 
 467   // Restore expression stack pointer
 468   __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 469   // NULL last_sp until next java call
 470   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 471 
 472 #if INCLUDE_JVMCI
 473   // Check if we need to take lock at entry of synchronized method.  This can
 474   // only occur on method entry so emit it only for vtos with step 0.
 475   if (UseJVMCICompiler && state == vtos && step == 0) {
 476     Label L;
 477     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 478     __ cbz(rscratch1, L);
 479     // Clear flag.
 480     __ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset()));
 481     // Take lock.
 482     lock_method();
 483     __ bind(L);
 484   } else {
 485 #ifdef ASSERT
 486     if (UseJVMCICompiler) {
 487       Label L;
 488       __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 489       __ cbz(rscratch1, L);
 490       __ stop("unexpected pending monitor in deopt entry");
 491       __ bind(L);
 492     }
 493 #endif
 494   }
 495 #endif
 496   // handle exceptions
 497   {
 498     Label L;
 499     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 500     __ cbz(rscratch1, L);
 501     __ call_VM(noreg,
 502                CAST_FROM_FN_PTR(address,
 503                                 InterpreterRuntime::throw_pending_exception));
 504     __ should_not_reach_here();
 505     __ bind(L);
 506   }




 455   __ get_method(rmethod);
 456   __ get_dispatch();
 457 
 458   // Calculate stack limit
 459   __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
 460   __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
 461   __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
 462   __ ldr(rscratch2,
 463          Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
 464   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtx, 3);
 465   __ andr(sp, rscratch1, -16);
 466 
 467   // Restore expression stack pointer
 468   __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 469   // NULL last_sp until next java call
 470   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 471 
 472 #if INCLUDE_JVMCI
 473   // Check if we need to take lock at entry of synchronized method.  This can
 474   // only occur on method entry so emit it only for vtos with step 0.
 475   if (EnableJVMCI && state == vtos && step == 0) {
 476     Label L;
 477     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 478     __ cbz(rscratch1, L);
 479     // Clear flag.
 480     __ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset()));
 481     // Take lock.
 482     lock_method();
 483     __ bind(L);
 484   } else {
 485 #ifdef ASSERT
 486     if (EnableJVMCI) {
 487       Label L;
 488       __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 489       __ cbz(rscratch1, L);
 490       __ stop("unexpected pending monitor in deopt entry");
 491       __ bind(L);
 492     }
 493 #endif
 494   }
 495 #endif
 496   // handle exceptions
 497   {
 498     Label L;
 499     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 500     __ cbz(rscratch1, L);
 501     __ call_VM(noreg,
 502                CAST_FROM_FN_PTR(address,
 503                                 InterpreterRuntime::throw_pending_exception));
 504     __ should_not_reach_here();
 505     __ bind(L);
 506   }


< prev index next >