< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page




 430   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtw, 3);
 431   __ andr(sp, rscratch1, -16);
 432 
 433 #ifndef PRODUCT
 434   // tell the simulator that the method has been reentered
 435   if (NotifySimulator) {
 436     __ notify(Assembler::method_reentry);
 437   }
 438 #endif
 439 
 440  __ check_and_handle_popframe(rthread);
 441  __ check_and_handle_earlyret(rthread);
 442 
 443   __ get_dispatch();
 444   __ dispatch_next(state, step);
 445 
 446   return entry;
 447 }
 448 
 449 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state,
 450                                                                int step) {

 451   address entry = __ pc();
 452   __ restore_bcp();
 453   __ restore_locals();
 454   __ restore_constant_pool_cache();
 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));


 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   }
 507 

 508   __ dispatch_next(state, step);



 509   return entry;
 510 }
 511 
 512 address TemplateInterpreterGenerator::generate_result_handler_for(
 513         BasicType type) {
 514     address entry = __ pc();
 515   switch (type) {
 516   case T_BOOLEAN: __ uxtb(r0, r0);        break;
 517   case T_CHAR   : __ uxth(r0, r0);       break;
 518   case T_BYTE   : __ sxtb(r0, r0);        break;
 519   case T_SHORT  : __ sxth(r0, r0);        break;
 520   case T_INT    : __ uxtw(r0, r0);        break;  // FIXME: We almost certainly don't need this
 521   case T_LONG   : /* nothing to do */        break;
 522   case T_VOID   : /* nothing to do */        break;
 523   case T_FLOAT  : /* nothing to do */        break;
 524   case T_DOUBLE : /* nothing to do */        break;
 525   case T_OBJECT :
 526     // retrieve result from frame
 527     __ ldr(r0, Address(rfp, frame::interpreter_frame_oop_temp_offset*wordSize));
 528     // and verify it




 430   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtw, 3);
 431   __ andr(sp, rscratch1, -16);
 432 
 433 #ifndef PRODUCT
 434   // tell the simulator that the method has been reentered
 435   if (NotifySimulator) {
 436     __ notify(Assembler::method_reentry);
 437   }
 438 #endif
 439 
 440  __ check_and_handle_popframe(rthread);
 441  __ check_and_handle_earlyret(rthread);
 442 
 443   __ get_dispatch();
 444   __ dispatch_next(state, step);
 445 
 446   return entry;
 447 }
 448 
 449 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state,
 450                                                                int step,
 451                                                                address continuation) {
 452   address entry = __ pc();
 453   __ restore_bcp();
 454   __ restore_locals();
 455   __ restore_constant_pool_cache();
 456   __ get_method(rmethod);
 457   __ get_dispatch();
 458 
 459   // Calculate stack limit
 460   __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
 461   __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
 462   __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
 463   __ ldr(rscratch2,
 464          Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
 465   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtx, 3);
 466   __ andr(sp, rscratch1, -16);
 467 
 468   // Restore expression stack pointer
 469   __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 470   // NULL last_sp until next java call
 471   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));


 489       __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 490       __ cbz(rscratch1, L);
 491       __ stop("unexpected pending monitor in deopt entry");
 492       __ bind(L);
 493     }
 494 #endif
 495   }
 496 #endif
 497   // handle exceptions
 498   {
 499     Label L;
 500     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 501     __ cbz(rscratch1, L);
 502     __ call_VM(noreg,
 503                CAST_FROM_FN_PTR(address,
 504                                 InterpreterRuntime::throw_pending_exception));
 505     __ should_not_reach_here();
 506     __ bind(L);
 507   }
 508 
 509   if (continuation == NULL) {
 510     __ dispatch_next(state, step);
 511   } else {
 512     __ jump_to_entry(continuation);
 513   }
 514   return entry;
 515 }
 516 
 517 address TemplateInterpreterGenerator::generate_result_handler_for(
 518         BasicType type) {
 519     address entry = __ pc();
 520   switch (type) {
 521   case T_BOOLEAN: __ uxtb(r0, r0);        break;
 522   case T_CHAR   : __ uxth(r0, r0);       break;
 523   case T_BYTE   : __ sxtb(r0, r0);        break;
 524   case T_SHORT  : __ sxth(r0, r0);        break;
 525   case T_INT    : __ uxtw(r0, r0);        break;  // FIXME: We almost certainly don't need this
 526   case T_LONG   : /* nothing to do */        break;
 527   case T_VOID   : /* nothing to do */        break;
 528   case T_FLOAT  : /* nothing to do */        break;
 529   case T_DOUBLE : /* nothing to do */        break;
 530   case T_OBJECT :
 531     // retrieve result from frame
 532     __ ldr(r0, Address(rfp, frame::interpreter_frame_oop_temp_offset*wordSize));
 533     // and verify it


< prev index next >