< prev index next >

src/hotspot/cpu/sparc/stubGenerator_sparc.cpp

G1BarrierSet_merge

818       if (NOLp == NULL)                                                                                                              
819         __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, no_overlap_target);                                            
820       else                                                                                                                           
821         __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, (*NOLp));                                                      
822       __ delayed()->nop();                                                                                                           
823   }                                                                                                                                  
824 
825   //                                                                                                                                 
826   //  Generate pre-write barrier for array.                                                                                          
827   //                                                                                                                                 
828   //  Input:                                                                                                                         
829   //     addr     - register containing starting address                                                                             
830   //     count    - register containing element count                                                                                
831   //     tmp      - scratch register                                                                                                 
832   //                                                                                                                                 
833   //  The input registers are overwritten.                                                                                           
834   //                                                                                                                                 
835   void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {                                     
836     BarrierSet* bs = Universe::heap()->barrier_set();                                                                                
837     switch (bs->kind()) {                                                                                                            
838       case BarrierSet::G1SATBCTLogging:                                                                                              
839         // With G1, don't generate the call if we statically know that the target in uninitialized                                   
840         if (!dest_uninitialized) {                                                                                                   
841           Register tmp = O5;                                                                                                         
842           assert_different_registers(addr, count, tmp);                                                                              
843           Label filtered;                                                                                                            
844           // Is marking active?                                                                                                      
845           if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {                                                                
846             __ ld(G2, in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active()), tmp);                 
847           } else {                                                                                                                   
848             guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1,                                                          
849                       "Assumption");                                                                                                 
850             __ ldsb(G2, in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active()), tmp);               
851           }                                                                                                                          
852           // Is marking active?                                                                                                      
853           __ cmp_and_br_short(tmp, G0, Assembler::equal, Assembler::pt, filtered);                                                   
854 
855           __ save_frame(0);                                                                                                          
856           // Save the necessary global regs... will be used after.                                                                   
857           if (addr->is_global()) {                                                                                                   

818       if (NOLp == NULL)
819         __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, no_overlap_target);
820       else
821         __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, (*NOLp));
822       __ delayed()->nop();
823   }
824 
825   //
826   //  Generate pre-write barrier for array.
827   //
828   //  Input:
829   //     addr     - register containing starting address
830   //     count    - register containing element count
831   //     tmp      - scratch register
832   //
833   //  The input registers are overwritten.
834   //
835   void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
836     BarrierSet* bs = Universe::heap()->barrier_set();
837     switch (bs->kind()) {
838       case BarrierSet::G1BarrierSet:
839         // With G1, don't generate the call if we statically know that the target in uninitialized
840         if (!dest_uninitialized) {
841           Register tmp = O5;
842           assert_different_registers(addr, count, tmp);
843           Label filtered;
844           // Is marking active?
845           if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
846             __ ld(G2, in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active()), tmp);
847           } else {
848             guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1,
849                       "Assumption");
850             __ ldsb(G2, in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active()), tmp);
851           }
852           // Is marking active?
853           __ cmp_and_br_short(tmp, G0, Assembler::equal, Assembler::pt, filtered);
854 
855           __ save_frame(0);
856           // Save the necessary global regs... will be used after.
857           if (addr->is_global()) {

880         break;                                                                                                                       
881       default:                                                                                                                       
882         ShouldNotReachHere();                                                                                                        
883     }                                                                                                                                
884   }                                                                                                                                  
885   //                                                                                                                                 
886   //  Generate post-write barrier for array.                                                                                         
887   //                                                                                                                                 
888   //  Input:                                                                                                                         
889   //     addr     - register containing starting address                                                                             
890   //     count    - register containing element count                                                                                
891   //     tmp      - scratch register                                                                                                 
892   //                                                                                                                                 
893   //  The input registers are overwritten.                                                                                           
894   //                                                                                                                                 
895   void gen_write_ref_array_post_barrier(Register addr, Register count,                                                               
896                                         Register tmp) {                                                                              
897     BarrierSet* bs = Universe::heap()->barrier_set();                                                                                
898 
899     switch (bs->kind()) {                                                                                                            
900       case BarrierSet::G1SATBCTLogging:                                                                                              
901         {                                                                                                                            
902           // Get some new fresh output registers.                                                                                    
903           __ save_frame(0);                                                                                                          
904           __ mov(addr->after_save(), O0);                                                                                            
905           __ call(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post));                                               
906           __ delayed()->mov(count->after_save(), O1);                                                                                
907           __ restore();                                                                                                              
908         }                                                                                                                            
909         break;                                                                                                                       
910       case BarrierSet::CardTableModRef:                                                                                              
911         {                                                                                                                            
912           CardTableModRefBS* ctbs = barrier_set_cast<CardTableModRefBS>(bs);                                                         
913           CardTable* ct = ctbs->card_table();                                                                                        
914           assert(sizeof(*ct->byte_map_base()) == sizeof(jbyte), "adjust this code");                                                 
915           assert_different_registers(addr, count, tmp);                                                                              
916 
917           Label L_loop, L_done;                                                                                                      
918 
919           __ cmp_and_br_short(count, 0, Assembler::equal, Assembler::pt, L_done); // zero count - nothing to do                      

880         break;
881       default:
882         ShouldNotReachHere();
883     }
884   }
885   //
886   //  Generate post-write barrier for array.
887   //
888   //  Input:
889   //     addr     - register containing starting address
890   //     count    - register containing element count
891   //     tmp      - scratch register
892   //
893   //  The input registers are overwritten.
894   //
895   void gen_write_ref_array_post_barrier(Register addr, Register count,
896                                         Register tmp) {
897     BarrierSet* bs = Universe::heap()->barrier_set();
898 
899     switch (bs->kind()) {
900       case BarrierSet::G1BarrierSet:
901         {
902           // Get some new fresh output registers.
903           __ save_frame(0);
904           __ mov(addr->after_save(), O0);
905           __ call(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post));
906           __ delayed()->mov(count->after_save(), O1);
907           __ restore();
908         }
909         break;
910       case BarrierSet::CardTableModRef:
911         {
912           CardTableModRefBS* ctbs = barrier_set_cast<CardTableModRefBS>(bs);
913           CardTable* ct = ctbs->card_table();
914           assert(sizeof(*ct->byte_map_base()) == sizeof(jbyte), "adjust this code");
915           assert_different_registers(addr, count, tmp);
916 
917           Label L_loop, L_done;
918 
919           __ cmp_and_br_short(count, 0, Assembler::equal, Assembler::pt, L_done); // zero count - nothing to do
< prev index next >