Mercurial > hg > graal-compiler
comparison src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @ 3839:3d42f82cd811
7063628: Use cbcond on T4
Summary: Add new short branch instruction to Hotspot sparc assembler.
Reviewed-by: never, twisti, jrose
author | kvn |
---|---|
date | Thu, 21 Jul 2011 11:25:07 -0700 |
parents | 6c97c830fb6f |
children | 069ab3f976d3 |
comparison
equal
deleted
inserted
replaced
3838:6a991dcb52bb | 3839:3d42f82cd811 |
---|---|
39 Label L; | 39 Label L; |
40 const Register temp_reg = G3_scratch; | 40 const Register temp_reg = G3_scratch; |
41 // Note: needs more testing of out-of-line vs. inline slow case | 41 // Note: needs more testing of out-of-line vs. inline slow case |
42 verify_oop(receiver); | 42 verify_oop(receiver); |
43 load_klass(receiver, temp_reg); | 43 load_klass(receiver, temp_reg); |
44 cmp(temp_reg, iCache); | 44 cmp_and_brx_short(temp_reg, iCache, Assembler::equal, Assembler::pt, L); |
45 brx(Assembler::equal, true, Assembler::pt, L); | |
46 delayed()->nop(); | |
47 AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub()); | 45 AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub()); |
48 jump_to(ic_miss, temp_reg); | 46 jump_to(ic_miss, temp_reg); |
49 delayed()->nop(); | 47 delayed()->nop(); |
50 align(CodeEntryAlignment); | 48 align(CodeEntryAlignment); |
51 bind(L); | 49 bind(L); |
140 verify_oop(Roop); | 138 verify_oop(Roop); |
141 biased_locking_exit(mark_addr, Rmark, done); | 139 biased_locking_exit(mark_addr, Rmark, done); |
142 } | 140 } |
143 // Test first it it is a fast recursive unlock | 141 // Test first it it is a fast recursive unlock |
144 ld_ptr(Rbox, BasicLock::displaced_header_offset_in_bytes(), Rmark); | 142 ld_ptr(Rbox, BasicLock::displaced_header_offset_in_bytes(), Rmark); |
145 br_null(Rmark, false, Assembler::pt, done); | 143 br_null_short(Rmark, Assembler::pt, done); |
146 delayed()->nop(); | |
147 if (!UseBiasedLocking) { | 144 if (!UseBiasedLocking) { |
148 // load object | 145 // load object |
149 ld_ptr(Rbox, BasicObjectLock::obj_offset_in_bytes(), Roop); | 146 ld_ptr(Rbox, BasicObjectLock::obj_offset_in_bytes(), Roop); |
150 verify_oop(Roop); | 147 verify_oop(Roop); |
151 } | 148 } |
229 | 226 |
230 // allocate space & initialize header | 227 // allocate space & initialize header |
231 if (!is_simm13(obj_size * wordSize)) { | 228 if (!is_simm13(obj_size * wordSize)) { |
232 // would need to use extra register to load | 229 // would need to use extra register to load |
233 // object size => go the slow case for now | 230 // object size => go the slow case for now |
234 br(Assembler::always, false, Assembler::pt, slow_case); | 231 ba(slow_case); |
235 delayed()->nop(); | 232 delayed()->nop(); |
236 return; | 233 return; |
237 } | 234 } |
238 try_allocate(obj, noreg, obj_size * wordSize, t2, t3, slow_case); | 235 try_allocate(obj, noreg, obj_size * wordSize, t2, t3, slow_case); |
239 | 236 |
255 #ifdef ASSERT | 252 #ifdef ASSERT |
256 { | 253 { |
257 Label ok; | 254 Label ok; |
258 ld(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), t1); | 255 ld(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), t1); |
259 if (var_size_in_bytes != noreg) { | 256 if (var_size_in_bytes != noreg) { |
260 cmp(t1, var_size_in_bytes); | 257 cmp_and_brx_short(t1, var_size_in_bytes, Assembler::equal, Assembler::pt, ok); |
261 } else { | 258 } else { |
262 cmp(t1, con_size_in_bytes); | 259 cmp_and_brx_short(t1, con_size_in_bytes, Assembler::equal, Assembler::pt, ok); |
263 } | 260 } |
264 brx(Assembler::equal, false, Assembler::pt, ok); | |
265 delayed()->nop(); | |
266 stop("bad size in initialize_object"); | 261 stop("bad size in initialize_object"); |
267 should_not_reach_here(); | 262 should_not_reach_here(); |
268 | 263 |
269 bind(ok); | 264 bind(ok); |
270 } | 265 } |
385 verify_oop_addr(Address(SP, stack_offset + STACK_BIAS)); | 380 verify_oop_addr(Address(SP, stack_offset + STACK_BIAS)); |
386 } | 381 } |
387 | 382 |
388 void C1_MacroAssembler::verify_not_null_oop(Register r) { | 383 void C1_MacroAssembler::verify_not_null_oop(Register r) { |
389 Label not_null; | 384 Label not_null; |
390 br_notnull(r, false, Assembler::pt, not_null); | 385 br_notnull_short(r, Assembler::pt, not_null); |
391 delayed()->nop(); | |
392 stop("non-null oop required"); | 386 stop("non-null oop required"); |
393 bind(not_null); | 387 bind(not_null); |
394 if (!VerifyOops) return; | 388 if (!VerifyOops) return; |
395 verify_oop(r); | 389 verify_oop(r); |
396 } | 390 } |