Mercurial > hg > graal-compiler
comparison src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @ 727:6b2273dd6fa9
6822110: Add AddressLiteral class on SPARC
Summary: The Address class on SPARC currently handles both, addresses and address literals, what makes the Address class more complicated than it has to be.
Reviewed-by: never, kvn
author | twisti |
---|---|
date | Tue, 21 Apr 2009 11:16:30 -0700 |
parents | d1605aabd0a1 |
children | c96bf21b756f |
comparison
equal
deleted
inserted
replaced
725:928912ce8438 | 727:6b2273dd6fa9 |
---|---|
1 /* | 1 /* |
2 * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
27 | 27 |
28 void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) { | 28 void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) { |
29 Label L; | 29 Label L; |
30 const Register temp_reg = G3_scratch; | 30 const Register temp_reg = G3_scratch; |
31 // Note: needs more testing of out-of-line vs. inline slow case | 31 // Note: needs more testing of out-of-line vs. inline slow case |
32 Address ic_miss(temp_reg, SharedRuntime::get_ic_miss_stub()); | |
33 verify_oop(receiver); | 32 verify_oop(receiver); |
34 ld_ptr(receiver, oopDesc::klass_offset_in_bytes(), temp_reg); | 33 ld_ptr(receiver, oopDesc::klass_offset_in_bytes(), temp_reg); |
35 cmp(temp_reg, iCache); | 34 cmp(temp_reg, iCache); |
36 brx(Assembler::equal, true, Assembler::pt, L); | 35 brx(Assembler::equal, true, Assembler::pt, L); |
37 delayed()->nop(); | 36 delayed()->nop(); |
38 jump_to(ic_miss, 0); | 37 AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub()); |
38 jump_to(ic_miss, temp_reg); | |
39 delayed()->nop(); | 39 delayed()->nop(); |
40 align(CodeEntryAlignment); | 40 align(CodeEntryAlignment); |
41 bind(L); | 41 bind(L); |
42 } | 42 } |
43 | 43 |
82 void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case) { | 82 void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case) { |
83 assert_different_registers(Rmark, Roop, Rbox, Rscratch); | 83 assert_different_registers(Rmark, Roop, Rbox, Rscratch); |
84 | 84 |
85 Label done; | 85 Label done; |
86 | 86 |
87 Address mark_addr(Roop, 0, oopDesc::mark_offset_in_bytes()); | 87 Address mark_addr(Roop, oopDesc::mark_offset_in_bytes()); |
88 | 88 |
89 // The following move must be the first instruction of emitted since debug | 89 // The following move must be the first instruction of emitted since debug |
90 // information may be generated for it. | 90 // information may be generated for it. |
91 // Load object header | 91 // Load object header |
92 ld_ptr(mark_addr, Rmark); | 92 ld_ptr(mark_addr, Rmark); |
130 void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case) { | 130 void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case) { |
131 assert_different_registers(Rmark, Roop, Rbox); | 131 assert_different_registers(Rmark, Roop, Rbox); |
132 | 132 |
133 Label done; | 133 Label done; |
134 | 134 |
135 Address mark_addr(Roop, 0, oopDesc::mark_offset_in_bytes()); | 135 Address mark_addr(Roop, oopDesc::mark_offset_in_bytes()); |
136 assert(mark_addr.disp() == 0, "cas must take a zero displacement"); | 136 assert(mark_addr.disp() == 0, "cas must take a zero displacement"); |
137 | 137 |
138 if (UseBiasedLocking) { | 138 if (UseBiasedLocking) { |
139 // load the object out of the BasicObjectLock | 139 // load the object out of the BasicObjectLock |
140 ld_ptr(Rbox, BasicObjectLock::obj_offset_in_bytes(), Roop); | 140 ld_ptr(Rbox, BasicObjectLock::obj_offset_in_bytes(), Roop); |
368 | 368 |
369 #ifndef PRODUCT | 369 #ifndef PRODUCT |
370 | 370 |
371 void C1_MacroAssembler::verify_stack_oop(int stack_offset) { | 371 void C1_MacroAssembler::verify_stack_oop(int stack_offset) { |
372 if (!VerifyOops) return; | 372 if (!VerifyOops) return; |
373 verify_oop_addr(Address(SP, 0, stack_offset + STACK_BIAS)); | 373 verify_oop_addr(Address(SP, stack_offset + STACK_BIAS)); |
374 } | 374 } |
375 | 375 |
376 void C1_MacroAssembler::verify_not_null_oop(Register r) { | 376 void C1_MacroAssembler::verify_not_null_oop(Register r) { |
377 Label not_null; | 377 Label not_null; |
378 br_zero(Assembler::notEqual, false, Assembler::pt, r, not_null); | 378 br_zero(Assembler::notEqual, false, Assembler::pt, r, not_null); |