author | mikael |
Tue, 29 Apr 2014 22:05:10 -0700 | |
changeset 24327 | d8d91481f76e |
parent 20072 | 6da61000acff |
child 24917 | bf961166fa07 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
19319
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
14631
diff
changeset
|
2 |
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2571
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2571
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2571
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
14631
526804361522
8003250: SPARC: move MacroAssembler into separate file
twisti
parents:
13969
diff
changeset
|
26 |
#include "asm/macroAssembler.inline.hpp" |
7397 | 27 |
#include "code/vtableStubs.hpp" |
28 |
#include "interp_masm_sparc.hpp" |
|
29 |
#include "memory/resourceArea.hpp" |
|
30 |
#include "oops/instanceKlass.hpp" |
|
31 |
#include "oops/klassVtable.hpp" |
|
32 |
#include "runtime/sharedRuntime.hpp" |
|
33 |
#include "vmreg_sparc.inline.hpp" |
|
34 |
#ifdef COMPILER2 |
|
35 |
#include "opto/runtime.hpp" |
|
36 |
#endif |
|
1 | 37 |
|
38 |
// machine-dependent part of VtableStubs: create vtableStub of correct size and |
|
39 |
// initialize its code |
|
40 |
||
41 |
#define __ masm-> |
|
42 |
||
43 |
||
44 |
#ifndef PRODUCT |
|
45 |
extern "C" void bad_compiled_vtable_index(JavaThread* thread, oopDesc* receiver, int index); |
|
46 |
#endif |
|
47 |
||
48 |
||
49 |
// Used by compiler only; may use only caller saved, non-argument registers |
|
50 |
// NOTE: %%%% if any change is made to this stub make sure that the function |
|
51 |
// pd_code_size_limit is changed to ensure the correct size for VtableStub |
|
52 |
VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { |
|
53 |
const int sparc_code_length = VtableStub::pd_code_size_limit(true); |
|
54 |
VtableStub* s = new(sparc_code_length) VtableStub(true, vtable_index); |
|
20072 | 55 |
// Can be NULL if there is no free space in the code cache. |
56 |
if (s == NULL) { |
|
57 |
return NULL; |
|
58 |
} |
|
59 |
||
1 | 60 |
ResourceMark rm; |
61 |
CodeBuffer cb(s->entry_point(), sparc_code_length); |
|
62 |
MacroAssembler* masm = new MacroAssembler(&cb); |
|
63 |
||
64 |
#ifndef PRODUCT |
|
65 |
if (CountCompiledCalls) { |
|
2571 | 66 |
__ inc_counter(SharedRuntime::nof_megamorphic_calls_addr(), G5, G3_scratch); |
1 | 67 |
} |
68 |
#endif /* PRODUCT */ |
|
69 |
||
70 |
assert(VtableStub::receiver_location() == O0->as_VMReg(), "receiver expected in O0"); |
|
71 |
||
72 |
// get receiver klass |
|
73 |
address npe_addr = __ pc(); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
189
diff
changeset
|
74 |
__ load_klass(O0, G3_scratch); |
1 | 75 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
76 |
// set Method* (in case of interpreted method), and destination address |
1 | 77 |
#ifndef PRODUCT |
78 |
if (DebugVtables) { |
|
79 |
Label L; |
|
80 |
// check offset vs vtable length |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
81 |
__ ld(G3_scratch, InstanceKlass::vtable_length_offset()*wordSize, G5); |
10252 | 82 |
__ cmp_and_br_short(G5, vtable_index*vtableEntry::size(), Assembler::greaterUnsigned, Assembler::pt, L); |
1 | 83 |
__ set(vtable_index, O2); |
84 |
__ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), O0, O2); |
|
85 |
__ bind(L); |
|
86 |
} |
|
87 |
#endif |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
11190
diff
changeset
|
88 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
11190
diff
changeset
|
89 |
__ lookup_virtual_method(G3_scratch, vtable_index, G5_method); |
1 | 90 |
|
91 |
#ifndef PRODUCT |
|
92 |
if (DebugVtables) { |
|
93 |
Label L; |
|
10252 | 94 |
__ br_notnull_short(G5_method, Assembler::pt, L); |
1 | 95 |
__ stop("Vtable entry is ZERO"); |
96 |
__ bind(L); |
|
97 |
} |
|
98 |
#endif |
|
99 |
||
100 |
address ame_addr = __ pc(); // if the vtable entry is null, the method is abstract |
|
101 |
// NOTE: for vtable dispatches, the vtable entry will never be null. |
|
102 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
103 |
__ ld_ptr(G5_method, in_bytes(Method::from_compiled_offset()), G3_scratch); |
1 | 104 |
|
105 |
// jump to target (either compiled code or c2iadapter) |
|
106 |
__ JMP(G3_scratch, 0); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
107 |
// load Method* (in case we call c2iadapter) |
1 | 108 |
__ delayed()->nop(); |
109 |
||
110 |
masm->flush(); |
|
2149
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 |
if (PrintMiscellaneous && (WizardMode || Verbose)) { |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
113 |
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
|
114 |
vtable_index, s->entry_point(), |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
115 |
(int)(s->code_end() - s->entry_point()), |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
116 |
(int)(s->code_end() - __ pc())); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
117 |
} |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
118 |
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
|
119 |
// shut the door on sizing bugs |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
120 |
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
|
121 |
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
|
122 |
|
1 | 123 |
s->set_exception_points(npe_addr, ame_addr); |
124 |
return s; |
|
125 |
} |
|
126 |
||
127 |
||
128 |
// NOTE: %%%% if any change is made to this stub make sure that the function |
|
129 |
// 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
|
130 |
VtableStub* VtableStubs::create_itable_stub(int itable_index) { |
1 | 131 |
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
|
132 |
VtableStub* s = new(sparc_code_length) VtableStub(false, itable_index); |
20072 | 133 |
// Can be NULL if there is no free space in the code cache. |
134 |
if (s == NULL) { |
|
135 |
return NULL; |
|
136 |
} |
|
137 |
||
1 | 138 |
ResourceMark rm; |
139 |
CodeBuffer cb(s->entry_point(), sparc_code_length); |
|
140 |
MacroAssembler* masm = new MacroAssembler(&cb); |
|
141 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
142 |
Register G3_Klass = G3_scratch; |
1 | 143 |
Register G5_interface = G5; // Passed in as an argument |
144 |
Label search; |
|
145 |
||
146 |
// Entry arguments: |
|
147 |
// G5_interface: Interface |
|
148 |
// O0: Receiver |
|
149 |
assert(VtableStub::receiver_location() == O0->as_VMReg(), "receiver expected in O0"); |
|
150 |
||
151 |
// get receiver klass (also an implicit null-check) |
|
152 |
address npe_addr = __ pc(); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
153 |
__ load_klass(O0, G3_Klass); |
1 | 154 |
|
155 |
// Push a new window to get some temp registers. This chops the head of all |
|
156 |
// my 64-bit %o registers in the LION build, but this is OK because no longs |
|
157 |
// are passed in the %o registers. Instead, longs are passed in G1 and G4 |
|
158 |
// and so those registers are not available here. |
|
159 |
__ save(SP,-frame::register_save_words*wordSize,SP); |
|
160 |
||
161 |
#ifndef PRODUCT |
|
162 |
if (CountCompiledCalls) { |
|
2571 | 163 |
__ inc_counter(SharedRuntime::nof_megamorphic_calls_addr(), L0, L1); |
1 | 164 |
} |
165 |
#endif /* PRODUCT */ |
|
166 |
||
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
167 |
Label throw_icce; |
1 | 168 |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
169 |
Register L5_method = L5; |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
170 |
__ lookup_interface_method(// inputs: rec. class, interface, itable index |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
171 |
G3_Klass, G5_interface, itable_index, |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
172 |
// outputs: method, scan temp. reg |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
173 |
L5_method, L2, L3, |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
174 |
throw_icce); |
1 | 175 |
|
176 |
#ifndef PRODUCT |
|
177 |
if (DebugVtables) { |
|
178 |
Label L01; |
|
10252 | 179 |
__ br_notnull_short(L5_method, Assembler::pt, L01); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
180 |
__ stop("Method* is null"); |
1 | 181 |
__ bind(L01); |
182 |
} |
|
183 |
#endif |
|
184 |
||
185 |
// If the following load is through a NULL pointer, we'll take an OS |
|
186 |
// exception that should translate into an AbstractMethodError. We need the |
|
187 |
// 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
|
188 |
__ restore(L5_method, 0, G5_method); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
189 |
// Restore registers *before* the AME point. |
1 | 190 |
|
191 |
address ame_addr = __ pc(); // if the vtable entry is null, the method is abstract |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
192 |
__ ld_ptr(G5_method, in_bytes(Method::from_compiled_offset()), G3_scratch); |
1 | 193 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
194 |
// G5_method: Method* |
1 | 195 |
// O0: Receiver |
196 |
// G3_scratch: entry point |
|
197 |
__ JMP(G3_scratch, 0); |
|
198 |
__ delayed()->nop(); |
|
199 |
||
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
200 |
__ bind(throw_icce); |
2571 | 201 |
AddressLiteral icce(StubRoutines::throw_IncompatibleClassChangeError_entry()); |
202 |
__ jump_to(icce, G3_scratch); |
|
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
203 |
__ delayed()->restore(); |
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
204 |
|
1 | 205 |
masm->flush(); |
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
206 |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
207 |
if (PrintMiscellaneous && (WizardMode || Verbose)) { |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
208 |
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
|
209 |
itable_index, s->entry_point(), |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
210 |
(int)(s->code_end() - s->entry_point()), |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
211 |
(int)(s->code_end() - __ pc())); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
212 |
} |
189
4248c8e21063
6664627: Merge changes made only in hotspot 11 forward to jdk 7
dcubed
parents:
1
diff
changeset
|
213 |
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
|
214 |
// shut the door on sizing bugs |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
215 |
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
|
216 |
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
|
217 |
|
1 | 218 |
s->set_exception_points(npe_addr, ame_addr); |
219 |
return s; |
|
220 |
} |
|
221 |
||
222 |
||
223 |
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
|
224 |
if (TraceJumps || DebugVtables || CountCompiledCalls || VerifyOops) return 1000; |
1 | 225 |
else { |
226 |
const int slop = 2*BytesPerInstWord; // sethi;add (needed for long offsets) |
|
227 |
if (is_vtable_stub) { |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
189
diff
changeset
|
228 |
// ld;ld;ld,jmp,nop |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
189
diff
changeset
|
229 |
const int basic = 5*BytesPerInstWord + |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2149
diff
changeset
|
230 |
// shift;add for load_klass (only shift with zero heap based) |
19979
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
19319
diff
changeset
|
231 |
(UseCompressedClassPointers ? |
19319
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
14631
diff
changeset
|
232 |
MacroAssembler::instr_size_for_decode_klass_not_null() : 0); |
1 | 233 |
return basic + slop; |
234 |
} else { |
|
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
670
diff
changeset
|
235 |
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
|
236 |
// shift;add for load_klass (only shift with zero heap based) |
19979
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
19319
diff
changeset
|
237 |
(UseCompressedClassPointers ? |
19319
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
14631
diff
changeset
|
238 |
MacroAssembler::instr_size_for_decode_klass_not_null() : 0); |
1 | 239 |
return (basic + slop); |
240 |
} |
|
241 |
} |
|
2533
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
242 |
|
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
243 |
// 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
|
244 |
// +PrintMiscellaneous and +WizardMode to see information about |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
245 |
// 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
|
246 |
// 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
|
247 |
// 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
|
248 |
// 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
|
249 |
// 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
|
250 |
// sethi/or pair of instructions. |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
251 |
// |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
252 |
// 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
|
253 |
// The itable code looks like this: |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
254 |
// Decoding VtableStub itbl[1]@16 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
255 |
// ld [ %o0 + 4 ], %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
256 |
// save %sp, -64, %sp |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
257 |
// ld [ %g3 + 0xe8 ], %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
258 |
// sll %l2, 2, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
259 |
// add %l2, 0x134, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
260 |
// and %l2, -8, %l2 ! NOT_LP64 only |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
261 |
// add %g3, %l2, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
262 |
// add %g3, 4, %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
263 |
// ld [ %l2 ], %l5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
264 |
// brz,pn %l5, throw_icce |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
265 |
// cmp %l5, %g5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
266 |
// be %icc, success |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
267 |
// add %l2, 8, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
268 |
// loop: |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
269 |
// ld [ %l2 ], %l5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
270 |
// brz,pn %l5, throw_icce |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
271 |
// cmp %l5, %g5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
272 |
// bne,pn %icc, loop |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
273 |
// add %l2, 8, %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
274 |
// success: |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
275 |
// ld [ %l2 + -4 ], %l2 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
276 |
// ld [ %g3 + %l2 ], %l5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
277 |
// restore %l5, 0, %g5 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
278 |
// ld [ %g5 + 0x44 ], %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
279 |
// jmp %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
280 |
// nop |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
281 |
// throw_icce: |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
282 |
// sethi %hi(throw_ICCE_entry), %g3 |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
283 |
// ! 5 more instructions here, LP64_ONLY |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
284 |
// jmp %g3 + %lo(throw_ICCE_entry) |
9aa50ba9a67f
6827505: sizing logic for vtable and itable stubs needs self-check
jrose
parents:
2254
diff
changeset
|
285 |
// restore |
1 | 286 |
} |
287 |
||
288 |
||
289 |
int VtableStub::pd_code_alignment() { |
|
290 |
// UltraSPARC cache line size is 8 instructions: |
|
291 |
const unsigned int icache_line_size = 32; |
|
292 |
return icache_line_size; |
|
293 |
} |