< prev index next >

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

Print this page




 143   __ ld_ptr(G2_thread, satb_q_buf_byte_offset, L1);
 144   __ sub(L0, oopSize, L0);
 145 
 146   __ st_ptr(pre_val, L1, L0);  // [_buf + index] := I0
 147   if (!with_frame) {
 148     // Use return-from-leaf
 149     __ retl();
 150     __ delayed()->st_ptr(L0, G2_thread, satb_q_index_byte_offset);
 151   } else {
 152     // Not delayed.
 153     __ st_ptr(L0, G2_thread, satb_q_index_byte_offset);
 154   }
 155   if (with_frame) {
 156     __ ret();
 157     __ delayed()->restore();
 158   }
 159   __ bind(refill);
 160 
 161   address handle_zero =
 162     CAST_FROM_FN_PTR(address,
 163                      &SATBMarkQueueSet::handle_zero_index_for_thread);
 164   // This should be rare enough that we can afford to save all the
 165   // scratch registers that the calling context might be using.
 166   __ mov(G1_scratch, L0);
 167   __ mov(G3_scratch, L1);
 168   __ mov(G4, L2);
 169   // We need the value of O0 above (for the write into the buffer), so we
 170   // save and restore it.
 171   __ mov(O0, L3);
 172   // Since the call will overwrite O7, we save and restore that, as well.
 173   __ mov(O7, L4);
 174   __ call_VM_leaf(L5, handle_zero, G2_thread);
 175   __ mov(L0, G1_scratch);
 176   __ mov(L1, G3_scratch);
 177   __ mov(L2, G4);
 178   __ mov(L3, O0);
 179   __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);
 180   __ delayed()->mov(L4, O7);
 181 
 182   if (with_frame) {
 183     satb_log_enqueue_with_frame = start;


 589   // size_t so ld_ptr is appropriate
 590   __ ld_ptr(G2_thread, satb_q_index_byte_offset, tmp);
 591 
 592   // index == 0?
 593   __ cmp_and_brx_short(tmp, G0, Assembler::equal, Assembler::pn, refill);
 594 
 595   __ ld_ptr(G2_thread, satb_q_buf_byte_offset, tmp2);
 596   __ sub(tmp, oopSize, tmp);
 597 
 598   __ st_ptr(pre_val, tmp2, tmp);  // [_buf + index] := <address_of_card>
 599   // Use return-from-leaf
 600   __ retl();
 601   __ delayed()->st_ptr(tmp, G2_thread, satb_q_index_byte_offset);
 602 
 603   __ bind(refill);
 604 
 605   __ save_live_registers_no_oop_map(true);
 606 
 607   __ call_VM_leaf(L7_thread_cache,
 608                   CAST_FROM_FN_PTR(address,
 609                                    SATBMarkQueueSet::handle_zero_index_for_thread),
 610                                    G2_thread);
 611 
 612   __ restore_live_registers(true);
 613 
 614   __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);
 615   __ epilogue();
 616 }
 617 
 618 void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler* sasm) {
 619   __ prologue("g1_post_barrier", false);
 620 
 621   G1BarrierSet* bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
 622 
 623   Register addr = G4;
 624   Register cardtable = G5;
 625   Register tmp  = G1_scratch;
 626   Register tmp2 = G3_scratch;
 627   jbyte* byte_map_base = bs->card_table()->byte_map_base();
 628 
 629   Label not_already_dirty, restart, refill, young_card;




 143   __ ld_ptr(G2_thread, satb_q_buf_byte_offset, L1);
 144   __ sub(L0, oopSize, L0);
 145 
 146   __ st_ptr(pre_val, L1, L0);  // [_buf + index] := I0
 147   if (!with_frame) {
 148     // Use return-from-leaf
 149     __ retl();
 150     __ delayed()->st_ptr(L0, G2_thread, satb_q_index_byte_offset);
 151   } else {
 152     // Not delayed.
 153     __ st_ptr(L0, G2_thread, satb_q_index_byte_offset);
 154   }
 155   if (with_frame) {
 156     __ ret();
 157     __ delayed()->restore();
 158   }
 159   __ bind(refill);
 160 
 161   address handle_zero =
 162     CAST_FROM_FN_PTR(address,
 163                      &G1SATBMarkQueueSet::handle_zero_index_for_thread);
 164   // This should be rare enough that we can afford to save all the
 165   // scratch registers that the calling context might be using.
 166   __ mov(G1_scratch, L0);
 167   __ mov(G3_scratch, L1);
 168   __ mov(G4, L2);
 169   // We need the value of O0 above (for the write into the buffer), so we
 170   // save and restore it.
 171   __ mov(O0, L3);
 172   // Since the call will overwrite O7, we save and restore that, as well.
 173   __ mov(O7, L4);
 174   __ call_VM_leaf(L5, handle_zero, G2_thread);
 175   __ mov(L0, G1_scratch);
 176   __ mov(L1, G3_scratch);
 177   __ mov(L2, G4);
 178   __ mov(L3, O0);
 179   __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);
 180   __ delayed()->mov(L4, O7);
 181 
 182   if (with_frame) {
 183     satb_log_enqueue_with_frame = start;


 589   // size_t so ld_ptr is appropriate
 590   __ ld_ptr(G2_thread, satb_q_index_byte_offset, tmp);
 591 
 592   // index == 0?
 593   __ cmp_and_brx_short(tmp, G0, Assembler::equal, Assembler::pn, refill);
 594 
 595   __ ld_ptr(G2_thread, satb_q_buf_byte_offset, tmp2);
 596   __ sub(tmp, oopSize, tmp);
 597 
 598   __ st_ptr(pre_val, tmp2, tmp);  // [_buf + index] := <address_of_card>
 599   // Use return-from-leaf
 600   __ retl();
 601   __ delayed()->st_ptr(tmp, G2_thread, satb_q_index_byte_offset);
 602 
 603   __ bind(refill);
 604 
 605   __ save_live_registers_no_oop_map(true);
 606 
 607   __ call_VM_leaf(L7_thread_cache,
 608                   CAST_FROM_FN_PTR(address,
 609                                    G1SATBMarkQueueSet::handle_zero_index_for_thread),
 610                                    G2_thread);
 611 
 612   __ restore_live_registers(true);
 613 
 614   __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);
 615   __ epilogue();
 616 }
 617 
 618 void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler* sasm) {
 619   __ prologue("g1_post_barrier", false);
 620 
 621   G1BarrierSet* bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
 622 
 623   Register addr = G4;
 624   Register cardtable = G5;
 625   Register tmp  = G1_scratch;
 626   Register tmp2 = G3_scratch;
 627   jbyte* byte_map_base = bs->card_table()->byte_map_base();
 628 
 629   Label not_already_dirty, restart, refill, young_card;


< prev index next >