< prev index next >

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

Print this page




 673   } else {
 674     __ push(0);
 675   }
 676 
 677   __ movptr(rdx, Address(rbx, Method::const_offset()));
 678   __ movptr(rdx, Address(rdx, ConstMethod::constants_offset()));
 679   __ movptr(rdx, Address(rdx, ConstantPool::cache_offset_in_bytes()));
 680   __ push(rdx); // set constant pool cache
 681   __ push(rlocals); // set locals pointer
 682   if (native_call) {
 683     __ push(0); // no bcp
 684   } else {
 685     __ push(rbcp); // set bcp
 686   }
 687   __ push(0); // reserve word for pointer to expression stack bottom
 688   __ movptr(Address(rsp, 0), rsp); // set expression stack bottom
 689 }
 690 
 691 // End of helpers
 692 
















































































 693 // Method entry for java.lang.ref.Reference.get.
 694 address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
 695 #if INCLUDE_ALL_GCS
 696   // Code: _aload_0, _getfield, _areturn
 697   // parameter size = 1
 698   //
 699   // The code that gets generated by this routine is split into 2 parts:
 700   //    1. The "intrinsified" code for G1 (or any SATB based GC),
 701   //    2. The slow path - which is an expansion of the regular method entry.
 702   //
 703   // Notes:-
 704   // * In the G1 code we do not check whether we need to block for
 705   //   a safepoint. If G1 is enabled then we must execute the specialized
 706   //   code for Reference.get (except when the Reference object is null)
 707   //   so that we can log the value in the referent field with an SATB
 708   //   update buffer.
 709   //   If the code for the getfield template is modified so that the
 710   //   G1 pre-barrier code is executed when the current method is
 711   //   Reference.get() then going through the normal method entry
 712   //   will be fine.




 673   } else {
 674     __ push(0);
 675   }
 676 
 677   __ movptr(rdx, Address(rbx, Method::const_offset()));
 678   __ movptr(rdx, Address(rdx, ConstMethod::constants_offset()));
 679   __ movptr(rdx, Address(rdx, ConstantPool::cache_offset_in_bytes()));
 680   __ push(rdx); // set constant pool cache
 681   __ push(rlocals); // set locals pointer
 682   if (native_call) {
 683     __ push(0); // no bcp
 684   } else {
 685     __ push(rbcp); // set bcp
 686   }
 687   __ push(0); // reserve word for pointer to expression stack bottom
 688   __ movptr(Address(rsp, 0), rsp); // set expression stack bottom
 689 }
 690 
 691 // End of helpers
 692 
 693 // Method entry for java.lang.Continuation.run.
 694 address TemplateInterpreterGenerator::generate_Continuation_run_entry(void) {
 695   address entry = __ pc();
 696 
 697   const Address constMethod(rbx, Method::const_offset());
 698   // const Address access_flags(rbx, Method::access_flags_offset());
 699 
 700   __ movptr(rdx, constMethod);
 701 
 702   const Address size_of_parameters(rdx,
 703                                    ConstMethod::size_of_parameters_offset());
 704   // const Address size_of_locals(rdx, ConstMethod::size_of_locals_offset());
 705 
 706   __ load_unsigned_short(rcx, size_of_parameters);
 707   __ subl(rdx, rdx);// rdx = 0 = no. of additional locals
 708 
 709   // __ stop("333");
 710   // rbx: Method*
 711   // rcx: size of parameters
 712   // rbcp: sender_sp (could differ from sp+wordSize if we were called via c2i )
 713 
 714   // see if we've got enough room on the stack for locals plus overhead.
 715   generate_stack_overflow_check();
 716 
 717   // rbx: Method*
 718   // rcx: size of parameters
 719   // rbcp: sender sp
 720   
 721   __ pop(rax); // get return address
 722 
 723   // compute beginning of parameters
 724   __ lea(rlocals, Address(rsp, rcx, Interpreter::stackElementScale(), -wordSize));
 725 
 726   // add 2 zero-initialized slots for native calls
 727   // initialize result_handler slot
 728   __ push((int) NULL_WORD);
 729   // slot for oop temp
 730   // (static native method holder mirror/jni oop result)
 731   __ push((int) NULL_WORD);
 732 
 733   // initialize fixed part of activation frame
 734   generate_fixed_frame(false);
 735 
 736   __ movptr(rax, Address(rlocals, 0)); // Address(rsp, wordSize)
 737 
 738   // rax: local 0
 739   
 740   // const int target_offset = java_lang_Continuation::target_offset;
 741   // guarantee(target_offset > 0, "target offset not initialized");
 742 
 743   // Load the value of the referent field.
 744   // const Address field_address(rax, target_offset);
 745   // __ load_heap_oop(rcx, field_address);
 746 
 747   // const Register thread = rcx;
 748   // __ get_thread(thread);
 749   // __ set_last_Java_frame(thread, noreg, noreg, NULL /* __ pc()*/ );
 750   // __ reset_last_Java_frame(thread, false);
 751 
 752   Register rarg1 = rax;
 753   __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::enter_continuation), rarg1);
 754 
 755   // __ get_thread(thread);
 756   // __ reset_last_Java_frame(thread, false);
 757 
 758   __ remove_activation(vtos, rbcp);
 759   __ jmp(rbcp);
 760 
 761   return entry;
 762 }
 763 
 764 // address TemplateInterpreterGenerator::generate_Continuation_run_return_entry(void) {
 765 //   address entry = __ pc();
 766 
 767 //   __ remove_activation(state, rbcp);
 768 //   __ jmp(rbcp);
 769 
 770 //   return entry;
 771 // }
 772 
 773 // Method entry for java.lang.ref.Reference.get.
 774 address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
 775 #if INCLUDE_ALL_GCS
 776   // Code: _aload_0, _getfield, _areturn
 777   // parameter size = 1
 778   //
 779   // The code that gets generated by this routine is split into 2 parts:
 780   //    1. The "intrinsified" code for G1 (or any SATB based GC),
 781   //    2. The slow path - which is an expansion of the regular method entry.
 782   //
 783   // Notes:-
 784   // * In the G1 code we do not check whether we need to block for
 785   //   a safepoint. If G1 is enabled then we must execute the specialized
 786   //   code for Reference.get (except when the Reference object is null)
 787   //   so that we can log the value in the referent field with an SATB
 788   //   update buffer.
 789   //   If the code for the getfield template is modified so that the
 790   //   G1 pre-barrier code is executed when the current method is
 791   //   Reference.get() then going through the normal method entry
 792   //   will be fine.


< prev index next >