src/cpu/sparc/vm/c1_Runtime1_sparc.cpp

changeset 3088
4fe626cbf0bf
parent 3037
3d42f82cd811
child 3110
d968f546734e
     1.1 --- a/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Mon Aug 29 17:42:39 2011 -0700
     1.2 +++ b/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Wed Aug 31 10:16:02 2011 -0700
     1.3 @@ -834,14 +834,16 @@
     1.4          int satb_q_buf_byte_offset =
     1.5            in_bytes(JavaThread::satb_mark_queue_offset() +
     1.6                     PtrQueue::byte_offset_of_buf());
     1.7 +
     1.8          __ bind(restart);
     1.9 +        // Load the index into the SATB buffer. PtrQueue::_index is a
    1.10 +        // size_t so ld_ptr is appropriate
    1.11          __ ld_ptr(G2_thread, satb_q_index_byte_offset, tmp);
    1.12  
    1.13 -        __ br_on_reg_cond(Assembler::rc_z, /*annul*/false,
    1.14 -                          Assembler::pn, tmp, refill);
    1.15 +        // index == 0?
    1.16 +        __ cmp_and_brx_short(tmp, G0, Assembler::equal, Assembler::pn, refill);
    1.17  
    1.18 -        // If the branch is taken, no harm in executing this in the delay slot.
    1.19 -        __ delayed()->ld_ptr(G2_thread, satb_q_buf_byte_offset, tmp2);
    1.20 +        __ ld_ptr(G2_thread, satb_q_buf_byte_offset, tmp2);
    1.21          __ sub(tmp, oopSize, tmp);
    1.22  
    1.23          __ st_ptr(pre_val, tmp2, tmp);  // [_buf + index] := <address_of_card>
    1.24 @@ -901,11 +903,8 @@
    1.25          __ set(rs, cardtable);         // cardtable := <card table base>
    1.26          __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable]
    1.27  
    1.28 -        __ br_on_reg_cond(Assembler::rc_nz, /*annul*/false, Assembler::pt,
    1.29 -                          tmp, not_already_dirty);
    1.30 -        // Get cardtable + tmp into a reg by itself -- useful in the take-the-branch
    1.31 -        // case, harmless if not.
    1.32 -        __ delayed()->add(addr, cardtable, tmp2);
    1.33 +        assert(CardTableModRefBS::dirty_card_val() == 0, "otherwise check this code");
    1.34 +        __ cmp_and_br_short(tmp, G0, Assembler::notEqual, Assembler::pt, not_already_dirty);
    1.35  
    1.36          // We didn't take the branch, so we're already dirty: return.
    1.37          // Use return-from-leaf
    1.38 @@ -914,6 +913,10 @@
    1.39  
    1.40          // Not dirty.
    1.41          __ bind(not_already_dirty);
    1.42 +
    1.43 +        // Get cardtable + tmp into a reg by itself
    1.44 +        __ add(addr, cardtable, tmp2);
    1.45 +
    1.46          // First, dirty it.
    1.47          __ stb(G0, tmp2, 0);  // [cardPtr] := 0  (i.e., dirty).
    1.48  
    1.49 @@ -929,13 +932,17 @@
    1.50          int dirty_card_q_buf_byte_offset =
    1.51            in_bytes(JavaThread::dirty_card_queue_offset() +
    1.52                     PtrQueue::byte_offset_of_buf());
    1.53 +
    1.54          __ bind(restart);
    1.55 +
    1.56 +        // Get the index into the update buffer. PtrQueue::_index is
    1.57 +        // a size_t so ld_ptr is appropriate here.
    1.58          __ ld_ptr(G2_thread, dirty_card_q_index_byte_offset, tmp3);
    1.59  
    1.60 -        __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pn,
    1.61 -                          tmp3, refill);
    1.62 -        // If the branch is taken, no harm in executing this in the delay slot.
    1.63 -        __ delayed()->ld_ptr(G2_thread, dirty_card_q_buf_byte_offset, tmp4);
    1.64 +        // index == 0?
    1.65 +        __ cmp_and_brx_short(tmp3, G0, Assembler::equal,  Assembler::pn, refill);
    1.66 +
    1.67 +        __ ld_ptr(G2_thread, dirty_card_q_buf_byte_offset, tmp4);
    1.68          __ sub(tmp3, oopSize, tmp3);
    1.69  
    1.70          __ st_ptr(tmp2, tmp4, tmp3);  // [_buf + index] := <address_of_card>

mercurial