src/cpu/sparc/vm/c1_Runtime1_sparc.cpp

Print this page
rev 5353 : [mq]: filtering.diff


  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_Defs.hpp"
  27 #include "c1/c1_MacroAssembler.hpp"
  28 #include "c1/c1_Runtime1.hpp"
  29 #include "interpreter/interpreter.hpp"
  30 #include "nativeInst_sparc.hpp"
  31 #include "oops/compiledICHolder.hpp"
  32 #include "oops/oop.inline.hpp"
  33 #include "prims/jvmtiExport.hpp"
  34 #include "register_sparc.hpp"
  35 #include "runtime/sharedRuntime.hpp"
  36 #include "runtime/signature.hpp"
  37 #include "runtime/vframeArray.hpp"
  38 #include "utilities/macros.hpp"
  39 #include "vmreg_sparc.inline.hpp"



  40 
  41 // Implementation of StubAssembler
  42 
  43 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry_point, int number_of_arguments) {
  44   // for sparc changing the number of arguments doesn't change
  45   // anything about the frame size so we'll always lie and claim that
  46   // we are only passing 1 argument.
  47   set_num_rt_args(1);
  48 
  49   assert_not_delayed();
  50   // bang stack before going to runtime
  51   set(-os::vm_page_size() + STACK_BIAS, G3_scratch);
  52   st(G0, SP, G3_scratch);
  53 
  54   // debugging support
  55   assert(number_of_arguments >= 0   , "cannot have negative number of arguments");
  56 
  57   set_last_Java_frame(SP, noreg);
  58   if (VerifyThread)  mov(G2_thread, O0); // about to be smashed; pass early
  59   save_thread(L7_thread_cache);


 895 
 896     case g1_post_barrier_slow_id:
 897       {
 898         BarrierSet* bs = Universe::heap()->barrier_set();
 899         if (bs->kind() != BarrierSet::G1SATBCTLogging) {
 900           __ save_frame(0);
 901           __ set((int)id, O1);
 902           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0);
 903           __ should_not_reach_here();
 904           break;
 905         }
 906 
 907         __ set_info("g1_post_barrier_slow_id", dont_gc_arguments);
 908 
 909         Register addr = G4;
 910         Register cardtable = G5;
 911         Register tmp  = G1_scratch;
 912         Register tmp2 = G3_scratch;
 913         jbyte* byte_map_base = ((CardTableModRefBS*)bs)->byte_map_base;
 914 
 915         Label not_already_dirty, restart, refill;
 916 
 917 #ifdef _LP64
 918         __ srlx(addr, CardTableModRefBS::card_shift, addr);
 919 #else
 920         __ srl(addr, CardTableModRefBS::card_shift, addr);
 921 #endif
 922 
 923         AddressLiteral rs(byte_map_base);
 924         __ set(rs, cardtable);         // cardtable := <card table base>
 925         __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable]
 926 





 927         assert(CardTableModRefBS::dirty_card_val() == 0, "otherwise check this code");
 928         __ cmp_and_br_short(tmp, G0, Assembler::notEqual, Assembler::pt, not_already_dirty);
 929 

 930         // We didn't take the branch, so we're already dirty: return.
 931         // Use return-from-leaf
 932         __ retl();
 933         __ delayed()->nop();
 934 
 935         // Not dirty.
 936         __ bind(not_already_dirty);
 937 
 938         // Get cardtable + tmp into a reg by itself
 939         __ add(addr, cardtable, tmp2);
 940 
 941         // First, dirty it.
 942         __ stb(G0, tmp2, 0);  // [cardPtr] := 0  (i.e., dirty).
 943 
 944         Register tmp3 = cardtable;
 945         Register tmp4 = tmp;
 946 
 947         // these registers are now dead
 948         addr = cardtable = tmp = noreg;
 949 




  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_Defs.hpp"
  27 #include "c1/c1_MacroAssembler.hpp"
  28 #include "c1/c1_Runtime1.hpp"
  29 #include "interpreter/interpreter.hpp"
  30 #include "nativeInst_sparc.hpp"
  31 #include "oops/compiledICHolder.hpp"
  32 #include "oops/oop.inline.hpp"
  33 #include "prims/jvmtiExport.hpp"
  34 #include "register_sparc.hpp"
  35 #include "runtime/sharedRuntime.hpp"
  36 #include "runtime/signature.hpp"
  37 #include "runtime/vframeArray.hpp"
  38 #include "utilities/macros.hpp"
  39 #include "vmreg_sparc.inline.hpp"
  40 #if INCLUDE_ALL_GCS
  41 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
  42 #endif
  43 
  44 // Implementation of StubAssembler
  45 
  46 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry_point, int number_of_arguments) {
  47   // for sparc changing the number of arguments doesn't change
  48   // anything about the frame size so we'll always lie and claim that
  49   // we are only passing 1 argument.
  50   set_num_rt_args(1);
  51 
  52   assert_not_delayed();
  53   // bang stack before going to runtime
  54   set(-os::vm_page_size() + STACK_BIAS, G3_scratch);
  55   st(G0, SP, G3_scratch);
  56 
  57   // debugging support
  58   assert(number_of_arguments >= 0   , "cannot have negative number of arguments");
  59 
  60   set_last_Java_frame(SP, noreg);
  61   if (VerifyThread)  mov(G2_thread, O0); // about to be smashed; pass early
  62   save_thread(L7_thread_cache);


 898 
 899     case g1_post_barrier_slow_id:
 900       {
 901         BarrierSet* bs = Universe::heap()->barrier_set();
 902         if (bs->kind() != BarrierSet::G1SATBCTLogging) {
 903           __ save_frame(0);
 904           __ set((int)id, O1);
 905           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0);
 906           __ should_not_reach_here();
 907           break;
 908         }
 909 
 910         __ set_info("g1_post_barrier_slow_id", dont_gc_arguments);
 911 
 912         Register addr = G4;
 913         Register cardtable = G5;
 914         Register tmp  = G1_scratch;
 915         Register tmp2 = G3_scratch;
 916         jbyte* byte_map_base = ((CardTableModRefBS*)bs)->byte_map_base;
 917 
 918         Label not_already_dirty, restart, refill, young_card;
 919 
 920 #ifdef _LP64
 921         __ srlx(addr, CardTableModRefBS::card_shift, addr);
 922 #else
 923         __ srl(addr, CardTableModRefBS::card_shift, addr);
 924 #endif
 925 
 926         AddressLiteral rs(byte_map_base);
 927         __ set(rs, cardtable);         // cardtable := <card table base>
 928         __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable]
 929 
 930         __ cmp_and_br_short(tmp, G1SATBCardTableModRefBS::g1_young_card_val(), Assembler::equal, Assembler::pt, young_card);
 931 
 932         __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
 933         __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable]
 934 
 935         assert(CardTableModRefBS::dirty_card_val() == 0, "otherwise check this code");
 936         __ cmp_and_br_short(tmp, G0, Assembler::notEqual, Assembler::pt, not_already_dirty);
 937 
 938         __ bind(young_card);
 939         // We didn't take the branch, so we're already dirty: return.
 940         // Use return-from-leaf
 941         __ retl();
 942         __ delayed()->nop();
 943 
 944         // Not dirty.
 945         __ bind(not_already_dirty);
 946 
 947         // Get cardtable + tmp into a reg by itself
 948         __ add(addr, cardtable, tmp2);
 949 
 950         // First, dirty it.
 951         __ stb(G0, tmp2, 0);  // [cardPtr] := 0  (i.e., dirty).
 952 
 953         Register tmp3 = cardtable;
 954         Register tmp4 = tmp;
 955 
 956         // these registers are now dead
 957         addr = cardtable = tmp = noreg;
 958