< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page

 595     break;
 596   default       : ShouldNotReachHere();
 597   }
 598   __ ret(lr);                                  // return from result handler
 599   return entry;
 600 }
 601 
 602 address TemplateInterpreterGenerator::generate_safept_entry_for(
 603         TosState state,
 604         address runtime_entry) {
 605   address entry = __ pc();
 606   __ push(state);
 607   __ push_cont_fastpath(rthread);
 608   __ call_VM(noreg, runtime_entry);
 609   __ pop_cont_fastpath(rthread);
 610   __ membar(Assembler::AnyAny);
 611   __ dispatch_via(vtos, Interpreter::_normal_table.table_for(vtos));
 612   return entry;
 613 }
 614 



































 615 // Helpers for commoning out cases in the various type of method entries.
 616 //
 617 
 618 
 619 // increment invocation count & check for overflow
 620 //
 621 // Note: checking for negative value instead of overflow
 622 //       so we have a 'sticky' overflow test
 623 //
 624 // rmethod: method
 625 //
 626 void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow) {
 627   Label done;
 628   // Note: In tiered we increment either counters in Method* or in MDO depending if we're profiling or not.
 629   int increment = InvocationCounter::count_increment;
 630   Label no_mdo;
 631   if (ProfileInterpreter) {
 632     // Are we profiling?
 633     __ ldr(r0, Address(rmethod, Method::method_data_offset()));
 634     __ cbz(r0, no_mdo);

 595     break;
 596   default       : ShouldNotReachHere();
 597   }
 598   __ ret(lr);                                  // return from result handler
 599   return entry;
 600 }
 601 
 602 address TemplateInterpreterGenerator::generate_safept_entry_for(
 603         TosState state,
 604         address runtime_entry) {
 605   address entry = __ pc();
 606   __ push(state);
 607   __ push_cont_fastpath(rthread);
 608   __ call_VM(noreg, runtime_entry);
 609   __ pop_cont_fastpath(rthread);
 610   __ membar(Assembler::AnyAny);
 611   __ dispatch_via(vtos, Interpreter::_normal_table.table_for(vtos));
 612   return entry;
 613 }
 614 
 615 address TemplateInterpreterGenerator::generate_cont_preempt_rerun_interpreter_adapter() {
 616   if (!Continuations::enabled()) return nullptr;
 617   address start = __ pc();
 618 
 619   // Restore rfp first since we need it to restore rest of registers
 620   __ leave();
 621 
 622   // Restore constant pool cache
 623   __ ldr(rcpool, Address(rfp, frame::interpreter_frame_cache_offset * wordSize));
 624 
 625   // Restore Java expression stack pointer
 626   __ ldr(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 627   __ lea(esp, Address(rfp, rscratch1, Address::lsl(Interpreter::logStackElementSize)));
 628   // and NULL it as marker that esp is now tos until next java call
 629   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 630 
 631   // Restore machine SP
 632   __ ldr(rscratch1, Address(rfp, frame::interpreter_frame_extended_sp_offset * wordSize));
 633   __ lea(sp, Address(rfp, rscratch1, Address::lsl(LogBytesPerWord)));
 634 
 635   // Prepare for adjustment on return to call_VM_leaf_base()
 636   __ ldr(rmethod, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
 637   __ stp(rscratch1, rmethod, Address(__ pre(sp, -2 * wordSize)));
 638 
 639   // Restore dispatch
 640   uint64_t offset;
 641   __ adrp(rdispatch, ExternalAddress((address)Interpreter::dispatch_table()), offset);
 642   __ add(rdispatch, rdispatch, offset);
 643 
 644   __ ret(lr);
 645 
 646   return start;
 647 }
 648 
 649 
 650 // Helpers for commoning out cases in the various type of method entries.
 651 //
 652 
 653 
 654 // increment invocation count & check for overflow
 655 //
 656 // Note: checking for negative value instead of overflow
 657 //       so we have a 'sticky' overflow test
 658 //
 659 // rmethod: method
 660 //
 661 void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow) {
 662   Label done;
 663   // Note: In tiered we increment either counters in Method* or in MDO depending if we're profiling or not.
 664   int increment = InvocationCounter::count_increment;
 665   Label no_mdo;
 666   if (ProfileInterpreter) {
 667     // Are we profiling?
 668     __ ldr(r0, Address(rmethod, Method::method_data_offset()));
 669     __ cbz(r0, no_mdo);
< prev index next >