< prev index next >

src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp

BarrierSetC1_v2

461     bool saved = false;                                                                                                              
462     if (pre_val->is_in()) {                                                                                                          
463       // The g1_write_barrier_pre method assumes that the pre_val                                                                    
464       // is not in an input register.                                                                                                
465       __ save_frame_and_mov(0, pre_val, O0);                                                                                         
466       pre_val = O0;                                                                                                                  
467       saved = true;                                                                                                                  
468     }                                                                                                                                
469 
470     g1_write_barrier_pre(masm, noreg /* obj */, noreg /* index */, 0 /* offset */,                                                   
471                          pre_val /* pre_val */,                                                                                      
472                          tmp /* tmp */,                                                                                              
473                          true /* preserve_o_regs */);                                                                                
474 
475     if (saved) {                                                                                                                     
476       __ restore();                                                                                                                  
477     }                                                                                                                                
478   }                                                                                                                                  
479 }                                                                                                                                    
480 
481 #undef __                                                                                                                            
482                                                                                                                                      
483 void G1BarrierSetAssembler::barrier_stubs_init() {                                                                                   
484   if (dirty_card_log_enqueue == 0) {                                                                                                 
485     G1BarrierSet* bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());                                                    
486     CardTable *ct = bs->card_table();                                                                                                
487     generate_dirty_card_log_enqueue(ct->byte_map_base());                                                                            
488     assert(dirty_card_log_enqueue != 0, "postcondition.");                                                                           
489   }                                                                                                                                  
490   if (satb_log_enqueue_with_frame == 0) {                                                                                            
491     generate_satb_log_enqueue(true);                                                                                                 
492     assert(satb_log_enqueue_with_frame != 0, "postcondition.");                                                                      
493   }                                                                                                                                  
494   if (satb_log_enqueue_frameless == 0) {                                                                                             
495     generate_satb_log_enqueue(false);                                                                                                
496     assert(satb_log_enqueue_frameless != 0, "postcondition.");                                                                       
497   }                                                                                                                                  
498 }                                                                                                                                    
499 
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
500 #define __ ce->masm()->                                                                                                              
501 
502 void G1BarrierSetAssembler::gen_g1_pre_barrier_stub(LIR_Assembler* ce, G1PreBarrierStub* stub) {                                     
503   G1BarrierSetC1* bs = (G1BarrierSetC1*)BarrierSet::barrier_set()->barrier_set_c1();                                                 
504   // At this point we know that marking is in progress.                                                                              
505   // If do_load() is true then we have to emit the                                                                                   
506   // load of the previous value; otherwise it has already                                                                            
507   // been loaded into _pre_val.                                                                                                      
508 
509   __ bind(*stub->entry());                                                                                                           
510 
511   assert(stub->pre_val()->is_register(), "Precondition.");                                                                           
512   Register pre_val_reg = stub->pre_val()->as_register();                                                                             
513 
514   if (stub->do_load()) {                                                                                                             
515     ce->mem2reg(stub->addr(), stub->pre_val(), T_OBJECT, stub->patch_code(), stub->info(), false /*wide*/, false /*unaligned*/);     
516   }                                                                                                                                  
517 
518   if (__ is_in_wdisp16_range(*stub->continuation())) {                                                                               

461     bool saved = false;
462     if (pre_val->is_in()) {
463       // The g1_write_barrier_pre method assumes that the pre_val
464       // is not in an input register.
465       __ save_frame_and_mov(0, pre_val, O0);
466       pre_val = O0;
467       saved = true;
468     }
469 
470     g1_write_barrier_pre(masm, noreg /* obj */, noreg /* index */, 0 /* offset */,
471                          pre_val /* pre_val */,
472                          tmp /* tmp */,
473                          true /* preserve_o_regs */);
474 
475     if (saved) {
476       __ restore();
477     }
478   }
479 }
480 


481 void G1BarrierSetAssembler::barrier_stubs_init() {
482   if (dirty_card_log_enqueue == 0) {
483     G1BarrierSet* bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
484     CardTable *ct = bs->card_table();
485     generate_dirty_card_log_enqueue(ct->byte_map_base());
486     assert(dirty_card_log_enqueue != 0, "postcondition.");
487   }
488   if (satb_log_enqueue_with_frame == 0) {
489     generate_satb_log_enqueue(true);
490     assert(satb_log_enqueue_with_frame != 0, "postcondition.");
491   }
492   if (satb_log_enqueue_frameless == 0) {
493     generate_satb_log_enqueue(false);
494     assert(satb_log_enqueue_frameless != 0, "postcondition.");
495   }
496 }
497 
498 #ifdef COMPILER1
499 
500 #undef __
501 #define __ ce->masm()->
502 
503 void G1BarrierSetAssembler::gen_g1_pre_barrier_stub(LIR_Assembler* ce, G1PreBarrierStub* stub) {
504   G1BarrierSetC1* bs = (G1BarrierSetC1*)BarrierSet::barrier_set()->barrier_set_c1();
505   // At this point we know that marking is in progress.
506   // If do_load() is true then we have to emit the
507   // load of the previous value; otherwise it has already
508   // been loaded into _pre_val.
509 
510   __ bind(*stub->entry());
511 
512   assert(stub->pre_val()->is_register(), "Precondition.");
513   Register pre_val_reg = stub->pre_val()->as_register();
514 
515   if (stub->do_load()) {
516     ce->mem2reg(stub->addr(), stub->pre_val(), T_OBJECT, stub->patch_code(), stub->info(), false /*wide*/, false /*unaligned*/);
517   }
518 
519   if (__ is_in_wdisp16_range(*stub->continuation())) {

682   // Use return-from-leaf                                                                                                            
683   __ retl();                                                                                                                         
684   __ delayed()->st_ptr(tmp3, G2_thread, dirty_card_q_index_byte_offset);                                                             
685 
686   __ bind(refill);                                                                                                                   
687 
688   __ save_live_registers_no_oop_map(true);                                                                                           
689 
690   __ call_VM_leaf(L7_thread_cache,                                                                                                   
691                   CAST_FROM_FN_PTR(address,                                                                                          
692                                    DirtyCardQueueSet::handle_zero_index_for_thread),                                                 
693                                    G2_thread);                                                                                       
694 
695   __ restore_live_registers(true);                                                                                                   
696 
697   __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);                                                                  
698   __ epilogue();                                                                                                                     
699 }                                                                                                                                    
700 
701 #undef __                                                                                                                            
                                                                                                                                     
                                                                                                                                     

683   // Use return-from-leaf
684   __ retl();
685   __ delayed()->st_ptr(tmp3, G2_thread, dirty_card_q_index_byte_offset);
686 
687   __ bind(refill);
688 
689   __ save_live_registers_no_oop_map(true);
690 
691   __ call_VM_leaf(L7_thread_cache,
692                   CAST_FROM_FN_PTR(address,
693                                    DirtyCardQueueSet::handle_zero_index_for_thread),
694                                    G2_thread);
695 
696   __ restore_live_registers(true);
697 
698   __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);
699   __ epilogue();
700 }
701 
702 #undef __
703 
704 #endif // COMPILER1
< prev index next >