author | twisti |
Tue, 21 Apr 2009 11:16:30 -0700 | |
changeset 2571 | d602ad6538bd |
parent 2533 | 9aa50ba9a67f |
child 5547 | f4b087cbb361 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
2571 | 2 |
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
20 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
21 |
* have any questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "incls/_precompiled.incl" |
|
26 |
#include "incls/_vtableStubs_sparc.cpp.incl" |
|
27 |
||
28 |
// machine-dependent part of VtableStubs: create vtableStub of correct size and |
|
29 |
// initialize its code |
|
30 |
||
31 |
#define __ masm-> |
|
32 |
||
33 |
||
34 |
#ifndef PRODUCT |
|
35 |
extern "C" void bad_compiled_vtable_index(JavaThread* thread, oopDesc* receiver, int index); |
|
36 |
#endif |
|
37 |
||
38 |
||
39 |
// Used by compiler only; may use only caller saved, non-argument registers |
|
40 |
// NOTE: %%%% if any change is made to this stub make sure that the function |
|
41 |
// pd_code_size_limit is changed to ensure the correct size for VtableStub |
|
42 |
VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { |
|
43 |
const int sparc_code_length = VtableStub::pd_code_size_limit(true); |
|
44 |
VtableStub* s = new(sparc_code_length) VtableStub(true, vtable_index); |
|
45 |
ResourceMark rm; |
|
46 |
CodeBuffer cb(s->entry_point(), sparc_code_length); |
|
47 |
MacroAssembler* masm = new MacroAssembler(&cb); |
|
48 |
||
49 |
#ifndef PRODUCT |
|
50 |
if (CountCompiledCalls) { |
|
2571 | 51 |
__ inc_counter(SharedRuntime::nof_megamorphic_calls_addr(), G5, G3_scratch); |
1 | 52 |
} |
53 |
#endif /* PRODUCT */ |
|
54 |
||
55 |
assert(VtableStub::receiver_location() == O0->as_VMReg(), "receiver expected in O0"); |
|
56 |
||
57 |
// get receiver klass |
|
58 |
address npe_addr = __ pc(); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
189
diff
changeset
|
59 |
__ load_klass(O0, G3_scratch); |
1 | 60 |
|
61 |
// set methodOop (in case of interpreted method), and destination address |
|
62 |
int entry_offset = instanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size(); |
|
63 |
#ifndef PRODUCT |
|
64 |
if (DebugVtables) { |
|
65 |
Label L; |
|
66 |
// check offset vs vtable length |
|
67 |
__ ld(G3_scratch, instanceKlass::vtable_length_offset()*wordSize, G5); |
|
68 |
__ cmp(G5, vtable_index*vtableEntry::size()); |
|
69 |
__ br(Assembler::greaterUnsigned, false, Assembler::pt, L); |
|
70 |
__ delayed()->nop(); |
|
71 |
__ set(vtable_index, O2); |
|
72 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), O0, O2); |
|
73 |
__ bind(L); |
|
74 |
} |
|
75 |
#endif |
|
76 |
int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes(); |
|
77 |
if( __ is_simm13(v_off) ) { |
|
78 |
__ ld_ptr(G3, v_off, G5_method); |
|
79 |
} else { |
|
80 |
__ set(v_off,G5); |
|
81 |
__ ld_ptr(G3, G5, G5_method); |
|
82 |
} |
|
83 |
||
84 |
#ifndef PRODUCT |
|
85 |
if (DebugVtables) { |
|
86 |
Label L; |
|
87 |
__ br_notnull(G5_method, false, Assembler::pt, L); |
|
88 |
__ delayed()->nop(); |
|
89 |
__ stop("Vtable entry is ZERO"); |
|
90 |
__ bind(L); |
|
91 |
} |
|
92 |
#endif |
|
93 |
||
94 |
address ame_addr = __ pc(); // if the vtable entry is null, the method is abstract |
|
95 |
// NOTE: for vtable dispatches, the vtable entry will never be null. |
|
96 |
||
97 |
__ ld_ptr(G5_method, in_bytes(methodOopDesc::from_compiled_offset()), G3_scratch); |
|
98 |
||
99 |
// jump to target (either compiled code or c2iadapter) |
|
100 |
__ JMP(G3_scratch, 0); |
|
101 |
// load methodOop (in case we call c2iadapter) |
|
102 |
__ delayed()->nop(); |
|
103 |
||
104 |
masm->flush(); |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
105 |
|
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
106 |
if (PrintMiscellaneous && (WizardMode || Verbose)) { |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
107 |
tty->print_cr("vtable #%d at "PTR_FORMAT"[%d] left over: %d", |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
108 |
vtable_index, s->entry_point(), |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
109 |
(int)(s->code_end() - s->entry_point()), |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
110 |
(int)(s->code_end() - __ pc())); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
111 |
} |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
112 |
guarantee(__ pc() <= s->code_end(), "overflowed buffer"); |
2533
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
113 |
// shut the door on sizing bugs |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
114 |
int slop = 2*BytesPerInstWord; // 32-bit offset is this much larger than a 13-bit one |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
115 |
assert(vtable_index > 10 || __ pc() + slop <= s->code_end(), "room for sethi;add"); |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
116 |
|
1 | 117 |
s->set_exception_points(npe_addr, ame_addr); |
118 |
return s; |
|
119 |
} |
|
120 |
||
121 |
||
122 |
// NOTE: %%%% if any change is made to this stub make sure that the function |
|
123 |
// pd_code_size_limit is changed to ensure the correct size for VtableStub |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
124 |
VtableStub* VtableStubs::create_itable_stub(int itable_index) { |
1 | 125 |
const int sparc_code_length = VtableStub::pd_code_size_limit(false); |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
126 |
VtableStub* s = new(sparc_code_length) VtableStub(false, itable_index); |
1 | 127 |
ResourceMark rm; |
128 |
CodeBuffer cb(s->entry_point(), sparc_code_length); |
|
129 |
MacroAssembler* masm = new MacroAssembler(&cb); |
|
130 |
||
131 |
Register G3_klassOop = G3_scratch; |
|
132 |
Register G5_interface = G5; // Passed in as an argument |
|
133 |
Label search; |
|
134 |
||
135 |
// Entry arguments: |
|
136 |
// G5_interface: Interface |
|
137 |
// O0: Receiver |
|
138 |
assert(VtableStub::receiver_location() == O0->as_VMReg(), "receiver expected in O0"); |
|
139 |
||
140 |
// get receiver klass (also an implicit null-check) |
|
141 |
address npe_addr = __ pc(); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
189
diff
changeset
|
142 |
__ load_klass(O0, G3_klassOop); |
1 | 143 |
__ verify_oop(G3_klassOop); |
144 |
||
145 |
// Push a new window to get some temp registers. This chops the head of all |
|
146 |
// my 64-bit %o registers in the LION build, but this is OK because no longs |
|
147 |
// are passed in the %o registers. Instead, longs are passed in G1 and G4 |
|
148 |
// and so those registers are not available here. |
|
149 |
__ save(SP,-frame::register_save_words*wordSize,SP); |
|
150 |
||
151 |
#ifndef PRODUCT |
|
152 |
if (CountCompiledCalls) { |
|
2571 | 153 |
__ inc_counter(SharedRuntime::nof_megamorphic_calls_addr(), L0, L1); |
1 | 154 |
} |
155 |
#endif /* PRODUCT */ |
|
156 |
||
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
157 |
Label throw_icce; |
1 | 158 |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
159 |
Register L5_method = L5; |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
160 |
__ lookup_interface_method(// inputs: rec. class, interface, itable index |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
161 |
G3_klassOop, G5_interface, itable_index, |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
162 |
// outputs: method, scan temp. reg |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
163 |
L5_method, L2, L3, |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
164 |
throw_icce); |
1 | 165 |
|
166 |
#ifndef PRODUCT |
|
167 |
if (DebugVtables) { |
|
168 |
Label L01; |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
169 |
__ bpr(Assembler::rc_nz, false, Assembler::pt, L5_method, L01); |
1 | 170 |
__ delayed()->nop(); |
171 |
__ stop("methodOop is null"); |
|
172 |
__ bind(L01); |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
173 |
__ verify_oop(L5_method); |
1 | 174 |
} |
175 |
#endif |
|
176 |
||
177 |
// If the following load is through a NULL pointer, we'll take an OS |
|
178 |
// exception that should translate into an AbstractMethodError. We need the |
|
179 |
// window count to be correct at that time. |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
180 |
__ restore(L5_method, 0, G5_method); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
181 |
// Restore registers *before* the AME point. |
1 | 182 |
|
183 |
address ame_addr = __ pc(); // if the vtable entry is null, the method is abstract |
|
184 |
__ ld_ptr(G5_method, in_bytes(methodOopDesc::from_compiled_offset()), G3_scratch); |
|
185 |
||
186 |
// G5_method: methodOop |
|
187 |
// O0: Receiver |
|
188 |
// G3_scratch: entry point |
|
189 |
__ JMP(G3_scratch, 0); |
|
190 |
__ delayed()->nop(); |
|
191 |
||
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
192 |
__ bind(throw_icce); |
2571 | 193 |
AddressLiteral icce(StubRoutines::throw_IncompatibleClassChangeError_entry()); |
194 |
__ jump_to(icce, G3_scratch); |
|
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
195 |
__ delayed()->restore(); |
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
196 |
|
1 | 197 |
masm->flush(); |
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
198 |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
199 |
if (PrintMiscellaneous && (WizardMode || Verbose)) { |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
200 |
tty->print_cr("itable #%d at "PTR_FORMAT"[%d] left over: %d", |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
201 |
itable_index, s->entry_point(), |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
202 |
(int)(s->code_end() - s->entry_point()), |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
203 |
(int)(s->code_end() - __ pc())); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
204 |
} |
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
205 |
guarantee(__ pc() <= s->code_end(), "overflowed buffer"); |
2533
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
206 |
// shut the door on sizing bugs |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
207 |
int slop = 2*BytesPerInstWord; // 32-bit offset is this much larger than a 13-bit one |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
208 |
assert(itable_index > 10 || __ pc() + slop <= s->code_end(), "room for sethi;add"); |
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
209 |
|
1 | 210 |
s->set_exception_points(npe_addr, ame_addr); |
211 |
return s; |
|
212 |
} |
|
213 |
||
214 |
||
215 |
int VtableStub::pd_code_size_limit(bool is_vtable_stub) { |
|
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
216 |
if (TraceJumps || DebugVtables || CountCompiledCalls || VerifyOops) return 1000; |
1 | 217 |
else { |
218 |
const int slop = 2*BytesPerInstWord; // sethi;add (needed for long offsets) |
|
219 |
if (is_vtable_stub) { |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
189
diff
changeset
|
220 |
// ld;ld;ld,jmp,nop |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
189
diff
changeset
|
221 |
const int basic = 5*BytesPerInstWord + |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2149
diff
changeset
|
222 |
// shift;add for load_klass (only shift with zero heap based) |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2149
diff
changeset
|
223 |
(UseCompressedOops ? |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2149
diff
changeset
|
224 |
((Universe::narrow_oop_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0); |
1 | 225 |
return basic + slop; |
226 |
} else { |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
227 |
const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord + |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2149
diff
changeset
|
228 |
// shift;add for load_klass (only shift with zero heap based) |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2149
diff
changeset
|
229 |
(UseCompressedOops ? |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2149
diff
changeset
|
230 |
((Universe::narrow_oop_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0); |
1 | 231 |
return (basic + slop); |
232 |
} |
|
233 |
} |
|
2533
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
234 |
|
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
235 |
// In order to tune these parameters, run the JVM with VM options |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
236 |
// +PrintMiscellaneous and +WizardMode to see information about |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
237 |
// actual itable stubs. Look for lines like this: |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
238 |
// itable #1 at 0x5551212[116] left over: 8 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
239 |
// Reduce the constants so that the "left over" number is 8 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
240 |
// Do not aim at a left-over number of zero, because a very |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
241 |
// large vtable or itable offset (> 4K) will require an extra |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
242 |
// sethi/or pair of instructions. |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
243 |
// |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
244 |
// The JVM98 app. _202_jess has a megamorphic interface call. |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
245 |
// The itable code looks like this: |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
246 |
// Decoding VtableStub itbl[1]@16 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
247 |
// ld [ %o0 + 4 ], %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
248 |
// save %sp, -64, %sp |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
249 |
// ld [ %g3 + 0xe8 ], %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
250 |
// sll %l2, 2, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
251 |
// add %l2, 0x134, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
252 |
// and %l2, -8, %l2 ! NOT_LP64 only |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
253 |
// add %g3, %l2, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
254 |
// add %g3, 4, %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
255 |
// ld [ %l2 ], %l5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
256 |
// brz,pn %l5, throw_icce |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
257 |
// cmp %l5, %g5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
258 |
// be %icc, success |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
259 |
// add %l2, 8, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
260 |
// loop: |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
261 |
// ld [ %l2 ], %l5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
262 |
// brz,pn %l5, throw_icce |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
263 |
// cmp %l5, %g5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
264 |
// bne,pn %icc, loop |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
265 |
// add %l2, 8, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
266 |
// success: |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
267 |
// ld [ %l2 + -4 ], %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
268 |
// ld [ %g3 + %l2 ], %l5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
269 |
// restore %l5, 0, %g5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
270 |
// ld [ %g5 + 0x44 ], %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
271 |
// jmp %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
272 |
// nop |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
273 |
// throw_icce: |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
274 |
// sethi %hi(throw_ICCE_entry), %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
275 |
// ! 5 more instructions here, LP64_ONLY |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
276 |
// jmp %g3 + %lo(throw_ICCE_entry) |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
277 |
// restore |
1 | 278 |
} |
279 |
||
280 |
||
281 |
int VtableStub::pd_code_alignment() { |
|
282 |
// UltraSPARC cache line size is 8 instructions: |
|
283 |
const unsigned int icache_line_size = 32; |
|
284 |
return icache_line_size; |
|
285 |
} |