1.1 --- a/src/cpu/sparc/vm/stubGenerator_sparc.cpp Thu Jul 21 08:38:25 2011 -0700 1.2 +++ b/src/cpu/sparc/vm/stubGenerator_sparc.cpp Thu Jul 21 11:25:07 2011 -0700 1.3 @@ -150,8 +150,7 @@ 1.4 { const Register t = G3_scratch; 1.5 Label L; 1.6 __ ld_ptr(G2_thread, in_bytes(Thread::pending_exception_offset()), t); 1.7 - __ br_null(t, false, Assembler::pt, L); 1.8 - __ delayed()->nop(); 1.9 + __ br_null_short(t, Assembler::pt, L); 1.10 __ stop("StubRoutines::call_stub: entered with pending exception"); 1.11 __ bind(L); 1.12 } 1.13 @@ -207,8 +206,7 @@ 1.14 Label exit; 1.15 __ ld_ptr(parameter_size.as_in().as_address(), cnt); // parameter counter 1.16 __ add( FP, STACK_BIAS, dst ); 1.17 - __ tst(cnt); 1.18 - __ br(Assembler::zero, false, Assembler::pn, exit); 1.19 + __ cmp_zero_and_br(Assembler::zero, cnt, exit); 1.20 __ delayed()->sub(dst, BytesPerWord, dst); // setup Lentry_args 1.21 1.22 // copy parameters if any 1.23 @@ -282,20 +280,20 @@ 1.24 __ delayed()->restore(); 1.25 1.26 __ BIND(is_object); 1.27 - __ ba(false, exit); 1.28 + __ ba(exit); 1.29 __ delayed()->st_ptr(O0, addr, G0); 1.30 1.31 __ BIND(is_float); 1.32 - __ ba(false, exit); 1.33 + __ ba(exit); 1.34 __ delayed()->stf(FloatRegisterImpl::S, F0, addr, G0); 1.35 1.36 __ BIND(is_double); 1.37 - __ ba(false, exit); 1.38 + __ ba(exit); 1.39 __ delayed()->stf(FloatRegisterImpl::D, F0, addr, G0); 1.40 1.41 __ BIND(is_long); 1.42 #ifdef _LP64 1.43 - __ ba(false, exit); 1.44 + __ ba(exit); 1.45 __ delayed()->st_long(O0, addr, G0); // store entire long 1.46 #else 1.47 #if defined(COMPILER2) 1.48 @@ -307,11 +305,11 @@ 1.49 // do this here. Unfortunately if we did a rethrow we'd see an machepilog node 1.50 // first which would move g1 -> O0/O1 and destroy the exception we were throwing. 1.51 1.52 - __ ba(false, exit); 1.53 + __ ba(exit); 1.54 __ delayed()->stx(G1, addr, G0); // store entire long 1.55 #else 1.56 __ st(O1, addr, BytesPerInt); 1.57 - __ ba(false, exit); 1.58 + __ ba(exit); 1.59 __ delayed()->st(O0, addr, G0); 1.60 #endif /* COMPILER2 */ 1.61 #endif /* _LP64 */ 1.62 @@ -382,8 +380,7 @@ 1.63 // make sure that this code is only executed if there is a pending exception 1.64 { Label L; 1.65 __ ld_ptr(exception_addr, Gtemp); 1.66 - __ br_notnull(Gtemp, false, Assembler::pt, L); 1.67 - __ delayed()->nop(); 1.68 + __ br_notnull_short(Gtemp, Assembler::pt, L); 1.69 __ stop("StubRoutines::forward exception: no pending exception (1)"); 1.70 __ bind(L); 1.71 } 1.72 @@ -406,8 +403,7 @@ 1.73 #ifdef ASSERT 1.74 // make sure exception is set 1.75 { Label L; 1.76 - __ br_notnull(Oexception, false, Assembler::pt, L); 1.77 - __ delayed()->nop(); 1.78 + __ br_notnull_short(Oexception, Assembler::pt, L); 1.79 __ stop("StubRoutines::forward exception: no pending exception (2)"); 1.80 __ bind(L); 1.81 } 1.82 @@ -501,8 +497,7 @@ 1.83 Address exception_addr(G2_thread, Thread::pending_exception_offset()); 1.84 Register scratch_reg = Gtemp; 1.85 __ ld_ptr(exception_addr, scratch_reg); 1.86 - __ br_notnull(scratch_reg, false, Assembler::pt, L); 1.87 - __ delayed()->nop(); 1.88 + __ br_notnull_short(scratch_reg, Assembler::pt, L); 1.89 __ should_not_reach_here(); 1.90 __ bind(L); 1.91 #endif // ASSERT 1.92 @@ -614,9 +609,7 @@ 1.93 __ mov(G0,yield_reg); 1.94 1.95 __ BIND(retry); 1.96 - __ cmp(yield_reg, V8AtomicOperationUnderLockSpinCount); 1.97 - __ br(Assembler::less, false, Assembler::pt, dontyield); 1.98 - __ delayed()->nop(); 1.99 + __ cmp_and_br_short(yield_reg, V8AtomicOperationUnderLockSpinCount, Assembler::less, Assembler::pt, dontyield); 1.100 1.101 // This code can only be called from inside the VM, this 1.102 // stub is only invoked from Atomic::add(). We do not 1.103 @@ -676,9 +669,7 @@ 1.104 // try to replace O2 with O3 1.105 __ cas_under_lock(O1, O2, O3, 1.106 (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr(),false); 1.107 - __ cmp(O2, O3); 1.108 - __ br(Assembler::notEqual, false, Assembler::pn, retry); 1.109 - __ delayed()->nop(); 1.110 + __ cmp_and_br_short(O2, O3, Assembler::notEqual, Assembler::pn, retry); 1.111 1.112 __ retl(false); 1.113 __ delayed()->mov(O2, O0); // report previous value to caller 1.114 @@ -798,11 +789,9 @@ 1.115 __ BIND(retry); 1.116 1.117 __ lduw(O1, 0, O2); 1.118 - __ add(O0, O2, O3); 1.119 - __ cas(O1, O2, O3); 1.120 - __ cmp( O2, O3); 1.121 - __ br(Assembler::notEqual, false, Assembler::pn, retry); 1.122 - __ delayed()->nop(); 1.123 + __ add(O0, O2, O3); 1.124 + __ cas(O1, O2, O3); 1.125 + __ cmp_and_br_short(O2, O3, Assembler::notEqual, Assembler::pn, retry); 1.126 __ retl(false); 1.127 __ delayed()->add(O0, O2, O0); // note that cas made O2==O3 1.128 } else { 1.129 @@ -1370,8 +1359,7 @@ 1.130 1.131 // copy tailing bytes 1.132 __ BIND(L_copy_byte); 1.133 - __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit); 1.134 - __ delayed()->nop(); 1.135 + __ cmp_and_br_short(count, 0, Assembler::equal, Assembler::pt, L_exit); 1.136 __ align(OptoLoopAlignment); 1.137 __ BIND(L_copy_byte_loop); 1.138 __ ldub(from, offset, O3); 1.139 @@ -1482,8 +1470,7 @@ 1.140 1.141 // copy 1 element (2 bytes) at a time 1.142 __ BIND(L_copy_byte); 1.143 - __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit); 1.144 - __ delayed()->nop(); 1.145 + __ cmp_and_br_short(count, 0, Assembler::equal, Assembler::pt, L_exit); 1.146 __ align(OptoLoopAlignment); 1.147 __ BIND(L_copy_byte_loop); 1.148 __ dec(end_from); 1.149 @@ -1600,8 +1587,7 @@ 1.150 1.151 // copy 1 element at a time 1.152 __ BIND(L_copy_2_bytes); 1.153 - __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit); 1.154 - __ delayed()->nop(); 1.155 + __ cmp_and_br_short(count, 0, Assembler::equal, Assembler::pt, L_exit); 1.156 __ align(OptoLoopAlignment); 1.157 __ BIND(L_copy_2_bytes_loop); 1.158 __ lduh(from, offset, O3); 1.159 @@ -1946,8 +1932,7 @@ 1.160 1.161 // copy 1 element (2 bytes) at a time 1.162 __ BIND(L_copy_2_bytes); 1.163 - __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit); 1.164 - __ delayed()->nop(); 1.165 + __ cmp_and_br_short(count, 0, Assembler::equal, Assembler::pt, L_exit); 1.166 __ BIND(L_copy_2_bytes_loop); 1.167 __ dec(end_from, 2); 1.168 __ dec(end_to, 2); 1.169 @@ -2060,8 +2045,7 @@ 1.170 1.171 // copy 1 element at a time 1.172 __ BIND(L_copy_4_bytes); 1.173 - __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit); 1.174 - __ delayed()->nop(); 1.175 + __ cmp_and_br_short(count, 0, Assembler::equal, Assembler::pt, L_exit); 1.176 __ BIND(L_copy_4_bytes_loop); 1.177 __ ld(from, offset, O3); 1.178 __ deccc(count); 1.179 @@ -2193,8 +2177,7 @@ 1.180 1.181 // copy 1 element (4 bytes) at a time 1.182 __ BIND(L_copy_4_bytes); 1.183 - __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit); 1.184 - __ delayed()->nop(); 1.185 + __ cmp_and_br_short(count, 0, Assembler::equal, Assembler::pt, L_exit); 1.186 __ BIND(L_copy_4_bytes_loop); 1.187 __ dec(end_from, 4); 1.188 __ dec(end_to, 4); 1.189 @@ -2576,7 +2559,7 @@ 1.190 super_klass->after_save(), 1.191 L0, L1, L2, L4, 1.192 NULL, &L_pop_to_miss); 1.193 - __ ba(false, L_success); 1.194 + __ ba(L_success); 1.195 __ delayed()->restore(); 1.196 1.197 __ bind(L_pop_to_miss); 1.198 @@ -2673,8 +2656,7 @@ 1.199 // ======== loop entry is here ======== 1.200 __ BIND(load_element); 1.201 __ load_heap_oop(O0_from, O5_offset, G3_oop); // load the oop 1.202 - __ br_null(G3_oop, true, Assembler::pt, store_element); 1.203 - __ delayed()->nop(); 1.204 + __ br_null_short(G3_oop, Assembler::pt, store_element); 1.205 1.206 __ load_klass(G3_oop, G4_klass); // query the object klass 1.207 1.208 @@ -2896,8 +2878,7 @@ 1.209 // assert(src->klass() != NULL); 1.210 BLOCK_COMMENT("assert klasses not null"); 1.211 { Label L_a, L_b; 1.212 - __ br_notnull(G3_src_klass, false, Assembler::pt, L_b); // it is broken if klass is NULL 1.213 - __ delayed()->nop(); 1.214 + __ br_notnull_short(G3_src_klass, Assembler::pt, L_b); // it is broken if klass is NULL 1.215 __ bind(L_a); 1.216 __ stop("broken null klass"); 1.217 __ bind(L_b); 1.218 @@ -2937,9 +2918,7 @@ 1.219 } 1.220 1.221 // if (src->klass() != dst->klass()) return -1; 1.222 - __ cmp(G3_src_klass, G4_dst_klass); 1.223 - __ brx(Assembler::notEqual, false, Assembler::pn, L_failed); 1.224 - __ delayed()->nop(); 1.225 + __ cmp_and_brx_short(G3_src_klass, G4_dst_klass, Assembler::notEqual, Assembler::pn, L_failed); 1.226 1.227 // if (!src->is_Array()) return -1; 1.228 __ cmp(G5_lh, Klass::_lh_neutral_value); // < 0 1.229 @@ -3007,9 +2986,7 @@ 1.230 __ delayed()->signx(length, count); // length 1.231 #ifdef ASSERT 1.232 { Label L; 1.233 - __ cmp(G3_elsize, LogBytesPerLong); 1.234 - __ br(Assembler::equal, false, Assembler::pt, L); 1.235 - __ delayed()->nop(); 1.236 + __ cmp_and_br_short(G3_elsize, LogBytesPerLong, Assembler::equal, Assembler::pt, L); 1.237 __ stop("must be long copy, but elsize is wrong"); 1.238 __ bind(L); 1.239 }