< prev index next >

src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp

BarrierSetC1_v2

391 }                                                                                                                                    
392 
393 void G1BarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2) {                    
394   NearLabel Ldone, Lnot_weak;                                                                                                        
395   __ z_ltgr(tmp1, value);                                                                                                            
396   __ z_bre(Ldone);          // Use NULL result as-is.                                                                                
397 
398   __ z_nill(value, ~JNIHandles::weak_tag_mask);                                                                                      
399   __ z_lg(value, 0, value); // Resolve (untagged) jobject.                                                                           
400 
401   __ z_tmll(tmp1, JNIHandles::weak_tag_mask); // Test for jweak tag.                                                                 
402   __ z_braz(Lnot_weak);                                                                                                              
403   __ verify_oop(value);                                                                                                              
404   DecoratorSet decorators = IN_ROOT | ON_PHANTOM_OOP_REF;                                                                            
405   g1_write_barrier_pre(masm, decorators, (const Address*)NULL, value, noreg, tmp1, tmp2, true);                                      
406   __ bind(Lnot_weak);                                                                                                                
407   __ verify_oop(value);                                                                                                              
408   __ bind(Ldone);                                                                                                                    
409 }                                                                                                                                    
410 
                                                                                                                                     
                                                                                                                                     
411 #undef __                                                                                                                            
412 #define __ ce->masm()->                                                                                                              
413 
414 void G1BarrierSetAssembler::gen_g1_pre_barrier_stub(LIR_Assembler* ce, G1PreBarrierStub* stub) {                                     
415   G1BarrierSetC1* bs = (G1BarrierSetC1*)BarrierSet::barrier_set()->barrier_set_c1();                                                 
416   // At this point we know that marking is in progress.                                                                              
417   // If do_load() is true then we have to emit the                                                                                   
418   // load of the previous value; otherwise it has already                                                                            
419   // been loaded into _pre_val.                                                                                                      
420   __ bind(*stub->entry());                                                                                                           
421   ce->check_reserved_argument_area(16); // RT stub needs 2 spill slots.                                                              
422   assert(stub->pre_val()->is_register(), "Precondition.");                                                                           
423 
424   Register pre_val_reg = stub->pre_val()->as_register();                                                                             
425 
426   if (stub->do_load()) {                                                                                                             
427     ce->mem2reg(stub->addr(), stub->pre_val(), T_OBJECT, stub->patch_code(), stub->info(), false /*wide*/, false /*unaligned*/);     
428   }                                                                                                                                  
429 

391 }
392 
393 void G1BarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2) {
394   NearLabel Ldone, Lnot_weak;
395   __ z_ltgr(tmp1, value);
396   __ z_bre(Ldone);          // Use NULL result as-is.
397 
398   __ z_nill(value, ~JNIHandles::weak_tag_mask);
399   __ z_lg(value, 0, value); // Resolve (untagged) jobject.
400 
401   __ z_tmll(tmp1, JNIHandles::weak_tag_mask); // Test for jweak tag.
402   __ z_braz(Lnot_weak);
403   __ verify_oop(value);
404   DecoratorSet decorators = IN_ROOT | ON_PHANTOM_OOP_REF;
405   g1_write_barrier_pre(masm, decorators, (const Address*)NULL, value, noreg, tmp1, tmp2, true);
406   __ bind(Lnot_weak);
407   __ verify_oop(value);
408   __ bind(Ldone);
409 }
410 
411 #ifdef COMPILER1
412 
413 #undef __
414 #define __ ce->masm()->
415 
416 void G1BarrierSetAssembler::gen_g1_pre_barrier_stub(LIR_Assembler* ce, G1PreBarrierStub* stub) {
417   G1BarrierSetC1* bs = (G1BarrierSetC1*)BarrierSet::barrier_set()->barrier_set_c1();
418   // At this point we know that marking is in progress.
419   // If do_load() is true then we have to emit the
420   // load of the previous value; otherwise it has already
421   // been loaded into _pre_val.
422   __ bind(*stub->entry());
423   ce->check_reserved_argument_area(16); // RT stub needs 2 spill slots.
424   assert(stub->pre_val()->is_register(), "Precondition.");
425 
426   Register pre_val_reg = stub->pre_val()->as_register();
427 
428   if (stub->do_load()) {
429     ce->mem2reg(stub->addr(), stub->pre_val(), T_OBJECT, stub->patch_code(), stub->info(), false /*wide*/, false /*unaligned*/);
430   }
431 

593   __ add2reg(idx, -oopSize);                                                                                                         
594 
595   __ z_stg(addr_card, 0, idx, buf); // [_buf + index] := <address_of_card>                                                           
596   __ z_stg(idx, Address(Z_thread, dirty_card_q_index_byte_offset));                                                                  
597   // Restore killed registers and return.                                                                                            
598   __ z_lg(r1, 0*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);                                                         
599   __ z_lg(r2, 1*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);                                                         
600   __ z_br(Z_R14);                                                                                                                    
601 
602   __ bind(refill);                                                                                                                   
603   save_volatile_registers(sasm);                                                                                                     
604   __ z_lgr(idx, addr_card); // Save addr_card, tmp3 must be non-volatile.                                                            
605   __ call_VM_leaf(CAST_FROM_FN_PTR(address, DirtyCardQueueSet::handle_zero_index_for_thread),                                        
606                                    Z_thread);                                                                                        
607   __ z_lgr(addr_card, idx);                                                                                                          
608   restore_volatile_registers(sasm); // Restore addr_card.                                                                            
609   __ z_bru(restart);                                                                                                                 
610 }                                                                                                                                    
611 
612 #undef __                                                                                                                            
                                                                                                                                     
                                                                                                                                     

595   __ add2reg(idx, -oopSize);
596 
597   __ z_stg(addr_card, 0, idx, buf); // [_buf + index] := <address_of_card>
598   __ z_stg(idx, Address(Z_thread, dirty_card_q_index_byte_offset));
599   // Restore killed registers and return.
600   __ z_lg(r1, 0*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
601   __ z_lg(r2, 1*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
602   __ z_br(Z_R14);
603 
604   __ bind(refill);
605   save_volatile_registers(sasm);
606   __ z_lgr(idx, addr_card); // Save addr_card, tmp3 must be non-volatile.
607   __ call_VM_leaf(CAST_FROM_FN_PTR(address, DirtyCardQueueSet::handle_zero_index_for_thread),
608                                    Z_thread);
609   __ z_lgr(addr_card, idx);
610   restore_volatile_registers(sasm); // Restore addr_card.
611   __ z_bru(restart);
612 }
613 
614 #undef __
615 
616 #endif // COMPILER1
< prev index next >