< prev index next >

src/hotspot/cpu/ppc/stubGenerator_ppc.cpp

G1BarrierSet_merge

609     return stub->entry_point();                                                                                                      
610   }                                                                                                                                  
611 #undef __                                                                                                                            
612 #define __ _masm->                                                                                                                   
613 
614   //  Generate G1 pre-write barrier for array.                                                                                       
615   //                                                                                                                                 
616   //  Input:                                                                                                                         
617   //     from     - register containing src address (only needed for spilling)                                                       
618   //     to       - register containing starting address                                                                             
619   //     count    - register containing element count                                                                                
620   //     tmp      - scratch register                                                                                                 
621   //                                                                                                                                 
622   //  Kills:                                                                                                                         
623   //     nothing                                                                                                                     
624   //                                                                                                                                 
625   void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1,          
626                                        Register preserve1 = noreg, Register preserve2 = noreg) {                                     
627     BarrierSet* const bs = Universe::heap()->barrier_set();                                                                          
628     switch (bs->kind()) {                                                                                                            
629       case BarrierSet::G1SATBCTLogging:                                                                                              
630         // With G1, don't generate the call if we statically know that the target in uninitialized                                   
631         if (!dest_uninitialized) {                                                                                                   
632           int spill_slots = 3;                                                                                                       
633           if (preserve1 != noreg) { spill_slots++; }                                                                                 
634           if (preserve2 != noreg) { spill_slots++; }                                                                                 
635           const int frame_size = align_up(frame::abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes);         
636           Label filtered;                                                                                                            
637 
638           // Is marking active?                                                                                                      
639           if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {                                                                
640             __ lwz(Rtmp1, in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active()), R16_thread);      
641           } else {                                                                                                                   
642             guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");                                           
643             __ lbz(Rtmp1, in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active()), R16_thread);      
644           }                                                                                                                          
645           __ cmpdi(CCR0, Rtmp1, 0);                                                                                                  
646           __ beq(CCR0, filtered);                                                                                                    
647 
648           __ save_LR_CR(R0);                                                                                                         

609     return stub->entry_point();
610   }
611 #undef __
612 #define __ _masm->
613 
614   //  Generate G1 pre-write barrier for array.
615   //
616   //  Input:
617   //     from     - register containing src address (only needed for spilling)
618   //     to       - register containing starting address
619   //     count    - register containing element count
620   //     tmp      - scratch register
621   //
622   //  Kills:
623   //     nothing
624   //
625   void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1,
626                                        Register preserve1 = noreg, Register preserve2 = noreg) {
627     BarrierSet* const bs = Universe::heap()->barrier_set();
628     switch (bs->kind()) {
629       case BarrierSet::G1BarrierSet:
630         // With G1, don't generate the call if we statically know that the target in uninitialized
631         if (!dest_uninitialized) {
632           int spill_slots = 3;
633           if (preserve1 != noreg) { spill_slots++; }
634           if (preserve2 != noreg) { spill_slots++; }
635           const int frame_size = align_up(frame::abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes);
636           Label filtered;
637 
638           // Is marking active?
639           if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
640             __ lwz(Rtmp1, in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active()), R16_thread);
641           } else {
642             guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
643             __ lbz(Rtmp1, in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active()), R16_thread);
644           }
645           __ cmpdi(CCR0, Rtmp1, 0);
646           __ beq(CCR0, filtered);
647 
648           __ save_LR_CR(R0);

671       case BarrierSet::CardTableModRef:                                                                                              
672         break;                                                                                                                       
673       default:                                                                                                                       
674         ShouldNotReachHere();                                                                                                        
675     }                                                                                                                                
676   }                                                                                                                                  
677 
678   //  Generate CMS/G1 post-write barrier for array.                                                                                  
679   //                                                                                                                                 
680   //  Input:                                                                                                                         
681   //     addr     - register containing starting address                                                                             
682   //     count    - register containing element count                                                                                
683   //     tmp      - scratch register                                                                                                 
684   //                                                                                                                                 
685   //  The input registers and R0 are overwritten.                                                                                    
686   //                                                                                                                                 
687   void gen_write_ref_array_post_barrier(Register addr, Register count, Register tmp, Register preserve = noreg) {                    
688     BarrierSet* const bs = Universe::heap()->barrier_set();                                                                          
689 
690     switch (bs->kind()) {                                                                                                            
691       case BarrierSet::G1SATBCTLogging:                                                                                              
692         {                                                                                                                            
693           int spill_slots = (preserve != noreg) ? 1 : 0;                                                                             
694           const int frame_size = align_up(frame::abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes);         
695 
696           __ save_LR_CR(R0);                                                                                                         
697           __ push_frame(frame_size, R0);                                                                                             
698           if (preserve != noreg) { __ std(preserve, frame_size - 1 * wordSize, R1_SP); }                                             
699           __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), addr, count);                          
700           if (preserve != noreg) { __ ld(preserve, frame_size - 1 * wordSize, R1_SP); }                                              
701           __ addi(R1_SP, R1_SP, frame_size); // pop_frame();                                                                         
702           __ restore_LR_CR(R0);                                                                                                      
703         }                                                                                                                            
704         break;                                                                                                                       
705       case BarrierSet::CardTableModRef:                                                                                              
706         {                                                                                                                            
707           Label Lskip_loop, Lstore_loop;                                                                                             
708           if (UseConcMarkSweepGC) {                                                                                                  
709             // TODO PPC port: contribute optimization / requires shared changes                                                      
710             __ release();                                                                                                            

671       case BarrierSet::CardTableModRef:
672         break;
673       default:
674         ShouldNotReachHere();
675     }
676   }
677 
678   //  Generate CMS/G1 post-write barrier for array.
679   //
680   //  Input:
681   //     addr     - register containing starting address
682   //     count    - register containing element count
683   //     tmp      - scratch register
684   //
685   //  The input registers and R0 are overwritten.
686   //
687   void gen_write_ref_array_post_barrier(Register addr, Register count, Register tmp, Register preserve = noreg) {
688     BarrierSet* const bs = Universe::heap()->barrier_set();
689 
690     switch (bs->kind()) {
691       case BarrierSet::G1BarrierSet:
692         {
693           int spill_slots = (preserve != noreg) ? 1 : 0;
694           const int frame_size = align_up(frame::abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes);
695 
696           __ save_LR_CR(R0);
697           __ push_frame(frame_size, R0);
698           if (preserve != noreg) { __ std(preserve, frame_size - 1 * wordSize, R1_SP); }
699           __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), addr, count);
700           if (preserve != noreg) { __ ld(preserve, frame_size - 1 * wordSize, R1_SP); }
701           __ addi(R1_SP, R1_SP, frame_size); // pop_frame();
702           __ restore_LR_CR(R0);
703         }
704         break;
705       case BarrierSet::CardTableModRef:
706         {
707           Label Lskip_loop, Lstore_loop;
708           if (UseConcMarkSweepGC) {
709             // TODO PPC port: contribute optimization / requires shared changes
710             __ release();
< prev index next >