< prev index next >

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

Print this page
rev 47944 : Guard interpreter keep alive barrier with ShenandoahKeepAliveBarrier


 710   //   update buffer.
 711   //   If the code for the getfield template is modified so that the
 712   //   G1 pre-barrier code is executed when the current method is
 713   //   Reference.get() then going through the normal method entry
 714   //   will be fine.
 715   // * The G1 code can, however, check the receiver object (the instance
 716   //   of java.lang.Reference) and jump to the slow path if null. If the
 717   //   Reference object is null then we obviously cannot fetch the referent
 718   //   and so we don't need to call the G1 pre-barrier. Thus we can use the
 719   //   regular method entry code to generate the NPE.
 720   //
 721   // rbx: Method*
 722 
 723   // r13: senderSP must preserve for slow path, set SP to it on fast path
 724 
 725   address entry = __ pc();
 726 
 727   const int referent_offset = java_lang_ref_Reference::referent_offset;
 728   guarantee(referent_offset > 0, "referent offset not initialized");
 729 
 730   if (UseG1GC || UseShenandoahGC) {
 731     Label slow_path;
 732     // rbx: method
 733 
 734     // Check if local 0 != NULL
 735     // If the receiver is null then it is OK to jump to the slow path.
 736     __ movptr(rax, Address(rsp, wordSize));
 737 
 738     __ testptr(rax, rax);
 739     __ jcc(Assembler::zero, slow_path);
 740 
 741     oopDesc::bs()->interpreter_read_barrier_not_null(_masm, rax);
 742 
 743     // rax: local 0
 744     // rbx: method (but can be used as scratch now)
 745     // rdx: scratch
 746     // rdi: scratch
 747 
 748     // Preserve the sender sp in case the pre-barrier
 749     // calls the runtime
 750     NOT_LP64(__ push(rsi));




 710   //   update buffer.
 711   //   If the code for the getfield template is modified so that the
 712   //   G1 pre-barrier code is executed when the current method is
 713   //   Reference.get() then going through the normal method entry
 714   //   will be fine.
 715   // * The G1 code can, however, check the receiver object (the instance
 716   //   of java.lang.Reference) and jump to the slow path if null. If the
 717   //   Reference object is null then we obviously cannot fetch the referent
 718   //   and so we don't need to call the G1 pre-barrier. Thus we can use the
 719   //   regular method entry code to generate the NPE.
 720   //
 721   // rbx: Method*
 722 
 723   // r13: senderSP must preserve for slow path, set SP to it on fast path
 724 
 725   address entry = __ pc();
 726 
 727   const int referent_offset = java_lang_ref_Reference::referent_offset;
 728   guarantee(referent_offset > 0, "referent offset not initialized");
 729 
 730   if (UseG1GC || (UseShenandoahGC && ShenandoahKeepAliveBarrier)) {
 731     Label slow_path;
 732     // rbx: method
 733 
 734     // Check if local 0 != NULL
 735     // If the receiver is null then it is OK to jump to the slow path.
 736     __ movptr(rax, Address(rsp, wordSize));
 737 
 738     __ testptr(rax, rax);
 739     __ jcc(Assembler::zero, slow_path);
 740 
 741     oopDesc::bs()->interpreter_read_barrier_not_null(_masm, rax);
 742 
 743     // rax: local 0
 744     // rbx: method (but can be used as scratch now)
 745     // rdx: scratch
 746     // rdi: scratch
 747 
 748     // Preserve the sender sp in case the pre-barrier
 749     // calls the runtime
 750     NOT_LP64(__ push(rsi));


< prev index next >