Mercurial > hg > truffle
comparison src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @ 3888:4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
Summary: Remove the macro assembler routine br_on_reg_cond() and replace the remaining calls to that routine with an equivalent.
Reviewed-by: kvn, iveresov
author | johnc |
---|---|
date | Wed, 31 Aug 2011 10:16:02 -0700 |
parents | 3d42f82cd811 |
children | d968f546734e |
comparison
equal
deleted
inserted
replaced
3887:9447b2fb6fcf | 3888:4fe626cbf0bf |
---|---|
832 in_bytes(JavaThread::satb_mark_queue_offset() + | 832 in_bytes(JavaThread::satb_mark_queue_offset() + |
833 PtrQueue::byte_offset_of_index()); | 833 PtrQueue::byte_offset_of_index()); |
834 int satb_q_buf_byte_offset = | 834 int satb_q_buf_byte_offset = |
835 in_bytes(JavaThread::satb_mark_queue_offset() + | 835 in_bytes(JavaThread::satb_mark_queue_offset() + |
836 PtrQueue::byte_offset_of_buf()); | 836 PtrQueue::byte_offset_of_buf()); |
837 | |
837 __ bind(restart); | 838 __ bind(restart); |
839 // Load the index into the SATB buffer. PtrQueue::_index is a | |
840 // size_t so ld_ptr is appropriate | |
838 __ ld_ptr(G2_thread, satb_q_index_byte_offset, tmp); | 841 __ ld_ptr(G2_thread, satb_q_index_byte_offset, tmp); |
839 | 842 |
840 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, | 843 // index == 0? |
841 Assembler::pn, tmp, refill); | 844 __ cmp_and_brx_short(tmp, G0, Assembler::equal, Assembler::pn, refill); |
842 | 845 |
843 // If the branch is taken, no harm in executing this in the delay slot. | 846 __ ld_ptr(G2_thread, satb_q_buf_byte_offset, tmp2); |
844 __ delayed()->ld_ptr(G2_thread, satb_q_buf_byte_offset, tmp2); | |
845 __ sub(tmp, oopSize, tmp); | 847 __ sub(tmp, oopSize, tmp); |
846 | 848 |
847 __ st_ptr(pre_val, tmp2, tmp); // [_buf + index] := <address_of_card> | 849 __ st_ptr(pre_val, tmp2, tmp); // [_buf + index] := <address_of_card> |
848 // Use return-from-leaf | 850 // Use return-from-leaf |
849 __ retl(); | 851 __ retl(); |
899 | 901 |
900 AddressLiteral rs(byte_map_base); | 902 AddressLiteral rs(byte_map_base); |
901 __ set(rs, cardtable); // cardtable := <card table base> | 903 __ set(rs, cardtable); // cardtable := <card table base> |
902 __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable] | 904 __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable] |
903 | 905 |
904 __ br_on_reg_cond(Assembler::rc_nz, /*annul*/false, Assembler::pt, | 906 assert(CardTableModRefBS::dirty_card_val() == 0, "otherwise check this code"); |
905 tmp, not_already_dirty); | 907 __ cmp_and_br_short(tmp, G0, Assembler::notEqual, Assembler::pt, not_already_dirty); |
906 // Get cardtable + tmp into a reg by itself -- useful in the take-the-branch | |
907 // case, harmless if not. | |
908 __ delayed()->add(addr, cardtable, tmp2); | |
909 | 908 |
910 // We didn't take the branch, so we're already dirty: return. | 909 // We didn't take the branch, so we're already dirty: return. |
911 // Use return-from-leaf | 910 // Use return-from-leaf |
912 __ retl(); | 911 __ retl(); |
913 __ delayed()->nop(); | 912 __ delayed()->nop(); |
914 | 913 |
915 // Not dirty. | 914 // Not dirty. |
916 __ bind(not_already_dirty); | 915 __ bind(not_already_dirty); |
916 | |
917 // Get cardtable + tmp into a reg by itself | |
918 __ add(addr, cardtable, tmp2); | |
919 | |
917 // First, dirty it. | 920 // First, dirty it. |
918 __ stb(G0, tmp2, 0); // [cardPtr] := 0 (i.e., dirty). | 921 __ stb(G0, tmp2, 0); // [cardPtr] := 0 (i.e., dirty). |
919 | 922 |
920 Register tmp3 = cardtable; | 923 Register tmp3 = cardtable; |
921 Register tmp4 = tmp; | 924 Register tmp4 = tmp; |
927 in_bytes(JavaThread::dirty_card_queue_offset() + | 930 in_bytes(JavaThread::dirty_card_queue_offset() + |
928 PtrQueue::byte_offset_of_index()); | 931 PtrQueue::byte_offset_of_index()); |
929 int dirty_card_q_buf_byte_offset = | 932 int dirty_card_q_buf_byte_offset = |
930 in_bytes(JavaThread::dirty_card_queue_offset() + | 933 in_bytes(JavaThread::dirty_card_queue_offset() + |
931 PtrQueue::byte_offset_of_buf()); | 934 PtrQueue::byte_offset_of_buf()); |
935 | |
932 __ bind(restart); | 936 __ bind(restart); |
937 | |
938 // Get the index into the update buffer. PtrQueue::_index is | |
939 // a size_t so ld_ptr is appropriate here. | |
933 __ ld_ptr(G2_thread, dirty_card_q_index_byte_offset, tmp3); | 940 __ ld_ptr(G2_thread, dirty_card_q_index_byte_offset, tmp3); |
934 | 941 |
935 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pn, | 942 // index == 0? |
936 tmp3, refill); | 943 __ cmp_and_brx_short(tmp3, G0, Assembler::equal, Assembler::pn, refill); |
937 // If the branch is taken, no harm in executing this in the delay slot. | 944 |
938 __ delayed()->ld_ptr(G2_thread, dirty_card_q_buf_byte_offset, tmp4); | 945 __ ld_ptr(G2_thread, dirty_card_q_buf_byte_offset, tmp4); |
939 __ sub(tmp3, oopSize, tmp3); | 946 __ sub(tmp3, oopSize, tmp3); |
940 | 947 |
941 __ st_ptr(tmp2, tmp4, tmp3); // [_buf + index] := <address_of_card> | 948 __ st_ptr(tmp2, tmp4, tmp3); // [_buf + index] := <address_of_card> |
942 // Use return-from-leaf | 949 // Use return-from-leaf |
943 __ retl(); | 950 __ retl(); |