author | naoto |
Tue, 09 Jul 2019 08:05:38 -0700 | |
changeset 55627 | 9c1885fb2a42 |
parent 54806 | 45bbef01a6ae |
permissions | -rw-r--r-- |
42664 | 1 |
/* |
49347
edb65305d3ac
8195148: Collapse G1SATBCardTableModRefBS and G1SATBCardTableLoggingModRefBS into a single G1BarrierSet
eosterlund
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. |
42664 | 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "precompiled.hpp" |
|
50380
bec342339138
8204195: Clean up macroAssembler.inline.hpp and other inline.hpp files included in .hpp files
coleenp
parents:
50094
diff
changeset
|
26 |
#include "asm/macroAssembler.inline.hpp" |
42664 | 27 |
#include "c1/c1_CodeStubs.hpp" |
28 |
#include "c1/c1_FrameMap.hpp" |
|
29 |
#include "c1/c1_LIRAssembler.hpp" |
|
30 |
#include "c1/c1_MacroAssembler.hpp" |
|
31 |
#include "c1/c1_Runtime1.hpp" |
|
54806
45bbef01a6ae
8223675: arm32 build failure after 8223136 (Move compressed oops functions to CompressedOops class)
shade
parents:
52351
diff
changeset
|
32 |
#include "memory/universe.hpp" |
42664 | 33 |
#include "nativeInst_arm.hpp" |
34 |
#include "runtime/sharedRuntime.hpp" |
|
35 |
#include "utilities/macros.hpp" |
|
36 |
#include "vmreg_arm.inline.hpp" |
|
37 |
||
38 |
#define __ ce->masm()-> |
|
39 |
||
40 |
void CounterOverflowStub::emit_code(LIR_Assembler* ce) { |
|
41 |
__ bind(_entry); |
|
42 |
ce->store_parameter(_bci, 0); |
|
43 |
ce->store_parameter(_method->as_constant_ptr()->as_metadata(), 1); |
|
44 |
__ call(Runtime1::entry_for(Runtime1::counter_overflow_id), relocInfo::runtime_call_type); |
|
45 |
ce->add_call_info_here(_info); |
|
46 |
ce->verify_oop_map(_info); |
|
47 |
||
48 |
__ b(_continuation); |
|
49 |
} |
|
50 |
||
51 |
||
52 |
// TODO: ARM - is it possible to inline these stubs into the main code stream? |
|
53 |
||
50094
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
54 |
|
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
55 |
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array) |
51381
e354938b4073
8209380: ARM: cleanup maybe-uninitialized and reorder compiler warnings
avoitylov
parents:
50380
diff
changeset
|
56 |
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) { |
50094
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
57 |
assert(info != NULL, "must have info"); |
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
58 |
_info = new CodeEmitInfo(info); |
42664 | 59 |
} |
60 |
||
50094
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
61 |
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index) |
51381
e354938b4073
8209380: ARM: cleanup maybe-uninitialized and reorder compiler warnings
avoitylov
parents:
50380
diff
changeset
|
62 |
: _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) { |
50094
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
63 |
assert(info != NULL, "must have info"); |
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
64 |
_info = new CodeEmitInfo(info); |
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
65 |
} |
42664 | 66 |
|
67 |
void RangeCheckStub::emit_code(LIR_Assembler* ce) { |
|
68 |
__ bind(_entry); |
|
69 |
||
70 |
if (_info->deoptimize_on_exception()) { |
|
71 |
__ call(Runtime1::entry_for(Runtime1::predicate_failed_trap_id), relocInfo::runtime_call_type); |
|
72 |
ce->add_call_info_here(_info); |
|
73 |
ce->verify_oop_map(_info); |
|
74 |
debug_only(__ should_not_reach_here()); |
|
75 |
return; |
|
76 |
} |
|
77 |
// Pass the array index on stack because all registers must be preserved |
|
50094
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
78 |
ce->verify_reserved_argument_area_size(_throw_index_out_of_bounds_exception ? 1 : 2); |
42664 | 79 |
if (_index->is_cpu_register()) { |
80 |
__ str_32(_index->as_register(), Address(SP)); |
|
81 |
} else { |
|
82 |
__ mov_slow(Rtemp, _index->as_jint()); // Rtemp should be OK in C1 |
|
83 |
__ str_32(Rtemp, Address(SP)); |
|
84 |
} |
|
85 |
||
86 |
if (_throw_index_out_of_bounds_exception) { |
|
87 |
__ call(Runtime1::entry_for(Runtime1::throw_index_exception_id), relocInfo::runtime_call_type); |
|
88 |
} else { |
|
50094
2f79462aab9b
8201593: Print array length in ArrayIndexOutOfBoundsException.
goetz
parents:
49906
diff
changeset
|
89 |
__ str(_array->as_pointer_register(), Address(SP, BytesPerWord)); // ??? Correct offset? Correct instruction? |
42664 | 90 |
__ call(Runtime1::entry_for(Runtime1::throw_range_check_failed_id), relocInfo::runtime_call_type); |
91 |
} |
|
92 |
ce->add_call_info_here(_info); |
|
93 |
ce->verify_oop_map(_info); |
|
94 |
DEBUG_ONLY(STOP("RangeCheck");) |
|
95 |
} |
|
96 |
||
97 |
PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) { |
|
98 |
_info = new CodeEmitInfo(info); |
|
99 |
} |
|
100 |
||
101 |
void PredicateFailedStub::emit_code(LIR_Assembler* ce) { |
|
102 |
__ bind(_entry); |
|
103 |
__ call(Runtime1::entry_for(Runtime1::predicate_failed_trap_id), relocInfo::runtime_call_type); |
|
104 |
ce->add_call_info_here(_info); |
|
105 |
ce->verify_oop_map(_info); |
|
106 |
debug_only(__ should_not_reach_here()); |
|
107 |
} |
|
108 |
||
109 |
void DivByZeroStub::emit_code(LIR_Assembler* ce) { |
|
110 |
if (_offset != -1) { |
|
111 |
ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); |
|
112 |
} |
|
113 |
__ bind(_entry); |
|
114 |
__ call(Runtime1::entry_for(Runtime1::throw_div0_exception_id), |
|
115 |
relocInfo::runtime_call_type); |
|
116 |
ce->add_call_info_here(_info); |
|
117 |
DEBUG_ONLY(STOP("DivByZero");) |
|
118 |
} |
|
119 |
||
120 |
||
121 |
// Implementation of NewInstanceStub |
|
122 |
||
123 |
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) { |
|
124 |
_result = result; |
|
125 |
_klass = klass; |
|
126 |
_klass_reg = klass_reg; |
|
127 |
_info = new CodeEmitInfo(info); |
|
128 |
assert(stub_id == Runtime1::new_instance_id || |
|
129 |
stub_id == Runtime1::fast_new_instance_id || |
|
130 |
stub_id == Runtime1::fast_new_instance_init_check_id, |
|
131 |
"need new_instance id"); |
|
132 |
_stub_id = stub_id; |
|
133 |
} |
|
134 |
||
135 |
||
136 |
void NewInstanceStub::emit_code(LIR_Assembler* ce) { |
|
137 |
assert(_result->as_register() == R0, "runtime call setup"); |
|
138 |
assert(_klass_reg->as_register() == R1, "runtime call setup"); |
|
139 |
__ bind(_entry); |
|
140 |
__ call(Runtime1::entry_for(_stub_id), relocInfo::runtime_call_type); |
|
141 |
ce->add_call_info_here(_info); |
|
142 |
ce->verify_oop_map(_info); |
|
143 |
__ b(_continuation); |
|
144 |
} |
|
145 |
||
146 |
||
147 |
// Implementation of NewTypeArrayStub |
|
148 |
||
149 |
NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) { |
|
150 |
_klass_reg = klass_reg; |
|
151 |
_length = length; |
|
152 |
_result = result; |
|
153 |
_info = new CodeEmitInfo(info); |
|
154 |
} |
|
155 |
||
156 |
||
157 |
void NewTypeArrayStub::emit_code(LIR_Assembler* ce) { |
|
158 |
assert(_result->as_register() == R0, "runtime call setup"); |
|
159 |
assert(_klass_reg->as_register() == R1, "runtime call setup"); |
|
160 |
assert(_length->as_register() == R2, "runtime call setup"); |
|
161 |
__ bind(_entry); |
|
162 |
__ call(Runtime1::entry_for(Runtime1::new_type_array_id), relocInfo::runtime_call_type); |
|
163 |
ce->add_call_info_here(_info); |
|
164 |
ce->verify_oop_map(_info); |
|
165 |
__ b(_continuation); |
|
166 |
} |
|
167 |
||
168 |
||
169 |
// Implementation of NewObjectArrayStub |
|
170 |
||
171 |
NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) { |
|
172 |
_klass_reg = klass_reg; |
|
173 |
_result = result; |
|
174 |
_length = length; |
|
175 |
_info = new CodeEmitInfo(info); |
|
176 |
} |
|
177 |
||
178 |
||
179 |
void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { |
|
180 |
assert(_result->as_register() == R0, "runtime call setup"); |
|
181 |
assert(_klass_reg->as_register() == R1, "runtime call setup"); |
|
182 |
assert(_length->as_register() == R2, "runtime call setup"); |
|
183 |
__ bind(_entry); |
|
184 |
__ call(Runtime1::entry_for(Runtime1::new_object_array_id), relocInfo::runtime_call_type); |
|
185 |
ce->add_call_info_here(_info); |
|
186 |
ce->verify_oop_map(_info); |
|
187 |
__ b(_continuation); |
|
188 |
} |
|
189 |
||
190 |
||
191 |
// Implementation of MonitorAccessStubs |
|
192 |
||
193 |
MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info) |
|
194 |
: MonitorAccessStub(obj_reg, lock_reg) |
|
195 |
{ |
|
196 |
_info = new CodeEmitInfo(info); |
|
197 |
} |
|
198 |
||
199 |
||
200 |
void MonitorEnterStub::emit_code(LIR_Assembler* ce) { |
|
201 |
__ bind(_entry); |
|
202 |
const Register obj_reg = _obj_reg->as_pointer_register(); |
|
203 |
const Register lock_reg = _lock_reg->as_pointer_register(); |
|
204 |
||
205 |
ce->verify_reserved_argument_area_size(2); |
|
206 |
if (obj_reg < lock_reg) { |
|
207 |
__ stmia(SP, RegisterSet(obj_reg) | RegisterSet(lock_reg)); |
|
208 |
} else { |
|
209 |
__ str(obj_reg, Address(SP)); |
|
210 |
__ str(lock_reg, Address(SP, BytesPerWord)); |
|
211 |
} |
|
212 |
||
213 |
Runtime1::StubID enter_id = ce->compilation()->has_fpu_code() ? |
|
214 |
Runtime1::monitorenter_id : |
|
215 |
Runtime1::monitorenter_nofpu_id; |
|
216 |
__ call(Runtime1::entry_for(enter_id), relocInfo::runtime_call_type); |
|
217 |
ce->add_call_info_here(_info); |
|
218 |
ce->verify_oop_map(_info); |
|
219 |
__ b(_continuation); |
|
220 |
} |
|
221 |
||
222 |
||
223 |
void MonitorExitStub::emit_code(LIR_Assembler* ce) { |
|
224 |
__ bind(_entry); |
|
225 |
if (_compute_lock) { |
|
226 |
ce->monitor_address(_monitor_ix, _lock_reg); |
|
227 |
} |
|
228 |
const Register lock_reg = _lock_reg->as_pointer_register(); |
|
229 |
||
230 |
ce->verify_reserved_argument_area_size(1); |
|
231 |
__ str(lock_reg, Address(SP)); |
|
232 |
||
233 |
// Non-blocking leaf routine - no call info needed |
|
234 |
Runtime1::StubID exit_id = ce->compilation()->has_fpu_code() ? |
|
235 |
Runtime1::monitorexit_id : |
|
236 |
Runtime1::monitorexit_nofpu_id; |
|
237 |
__ call(Runtime1::entry_for(exit_id), relocInfo::runtime_call_type); |
|
238 |
__ b(_continuation); |
|
239 |
} |
|
240 |
||
241 |
||
242 |
// Call return is directly after patch word |
|
243 |
int PatchingStub::_patch_info_offset = 0; |
|
244 |
||
245 |
void PatchingStub::align_patch_site(MacroAssembler* masm) { |
|
246 |
#if 0 |
|
247 |
// TODO: investigate if we required to implement this |
|
248 |
ShouldNotReachHere(); |
|
249 |
#endif |
|
250 |
} |
|
251 |
||
252 |
void PatchingStub::emit_code(LIR_Assembler* ce) { |
|
52351 | 253 |
const int patchable_instruction_offset = 0; |
42664 | 254 |
|
255 |
assert(NativeCall::instruction_size <= _bytes_to_copy && _bytes_to_copy <= 0xFF, |
|
256 |
"not enough room for call"); |
|
257 |
assert((_bytes_to_copy & 3) == 0, "must copy a multiple of four bytes"); |
|
258 |
Label call_patch; |
|
259 |
bool is_load = (_id == load_klass_id) || (_id == load_mirror_id) || (_id == load_appendix_id); |
|
260 |
||
261 |
||
52351 | 262 |
if (is_load && !VM_Version::supports_movw()) { |
42664 | 263 |
address start = __ pc(); |
264 |
||
265 |
// The following sequence duplicates code provided in MacroAssembler::patchable_mov_oop() |
|
266 |
// without creating relocation info entry. |
|
267 |
||
268 |
assert((__ pc() - start) == patchable_instruction_offset, "should be"); |
|
269 |
__ ldr(_obj, Address(PC)); |
|
270 |
// Extra nop to handle case of large offset of oop placeholder (see NativeMovConstReg::set_data). |
|
271 |
__ nop(); |
|
272 |
||
273 |
#ifdef ASSERT |
|
274 |
for (int i = 0; i < _bytes_to_copy; i++) { |
|
275 |
assert(((address)_pc_start)[i] == start[i], "should be the same code"); |
|
276 |
} |
|
277 |
#endif // ASSERT |
|
278 |
} |
|
279 |
||
280 |
address being_initialized_entry = __ pc(); |
|
281 |
if (CommentedAssembly) { |
|
282 |
__ block_comment(" patch template"); |
|
283 |
} |
|
284 |
if (is_load) { |
|
285 |
address start = __ pc(); |
|
286 |
if (_id == load_mirror_id || _id == load_appendix_id) { |
|
287 |
__ patchable_mov_oop(_obj, (jobject)Universe::non_oop_word(), _index); |
|
288 |
} else { |
|
289 |
__ patchable_mov_metadata(_obj, (Metadata*)Universe::non_oop_word(), _index); |
|
290 |
} |
|
291 |
#ifdef ASSERT |
|
292 |
for (int i = 0; i < _bytes_to_copy; i++) { |
|
293 |
assert(((address)_pc_start)[i] == start[i], "should be the same code"); |
|
294 |
} |
|
295 |
#endif // ASSERT |
|
296 |
} else { |
|
297 |
int* start = (int*)_pc_start; |
|
298 |
int* end = start + (_bytes_to_copy / BytesPerInt); |
|
299 |
while (start < end) { |
|
300 |
__ emit_int32(*start++); |
|
301 |
} |
|
302 |
} |
|
303 |
address end_of_patch = __ pc(); |
|
304 |
||
305 |
int bytes_to_skip = 0; |
|
306 |
if (_id == load_mirror_id) { |
|
307 |
int offset = __ offset(); |
|
308 |
if (CommentedAssembly) { |
|
309 |
__ block_comment(" being_initialized check"); |
|
310 |
} |
|
311 |
||
312 |
assert(_obj != noreg, "must be a valid register"); |
|
313 |
// Rtemp should be OK in C1 |
|
314 |
__ ldr(Rtemp, Address(_obj, java_lang_Class::klass_offset_in_bytes())); |
|
315 |
__ ldr(Rtemp, Address(Rtemp, InstanceKlass::init_thread_offset())); |
|
316 |
__ cmp(Rtemp, Rthread); |
|
317 |
__ b(call_patch, ne); |
|
318 |
__ b(_patch_site_continuation); |
|
319 |
||
320 |
bytes_to_skip += __ offset() - offset; |
|
321 |
} |
|
322 |
||
323 |
if (CommentedAssembly) { |
|
324 |
__ block_comment("patch data - 3 high bytes of the word"); |
|
325 |
} |
|
326 |
const int sizeof_patch_record = 4; |
|
327 |
bytes_to_skip += sizeof_patch_record; |
|
328 |
int being_initialized_entry_offset = __ pc() - being_initialized_entry + sizeof_patch_record; |
|
329 |
__ emit_int32(0xff | being_initialized_entry_offset << 8 | bytes_to_skip << 16 | _bytes_to_copy << 24); |
|
330 |
||
331 |
address patch_info_pc = __ pc(); |
|
332 |
assert(patch_info_pc - end_of_patch == bytes_to_skip, "incorrect patch info"); |
|
333 |
||
334 |
// runtime call will return here |
|
335 |
Label call_return; |
|
336 |
__ bind(call_return); |
|
337 |
ce->add_call_info_here(_info); |
|
338 |
assert(_patch_info_offset == (patch_info_pc - __ pc()), "must not change"); |
|
339 |
__ b(_patch_site_entry); |
|
340 |
||
341 |
address entry = __ pc(); |
|
342 |
NativeGeneralJump::insert_unconditional((address)_pc_start, entry); |
|
343 |
address target = NULL; |
|
344 |
relocInfo::relocType reloc_type = relocInfo::none; |
|
345 |
switch (_id) { |
|
346 |
case access_field_id: target = Runtime1::entry_for(Runtime1::access_field_patching_id); break; |
|
347 |
case load_klass_id: target = Runtime1::entry_for(Runtime1::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; |
|
348 |
case load_mirror_id: target = Runtime1::entry_for(Runtime1::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; |
|
349 |
case load_appendix_id: target = Runtime1::entry_for(Runtime1::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; |
|
350 |
default: ShouldNotReachHere(); |
|
351 |
} |
|
352 |
__ bind(call_patch); |
|
353 |
||
354 |
if (CommentedAssembly) { |
|
355 |
__ block_comment("patch entry point"); |
|
356 |
} |
|
357 |
||
358 |
// arrange for call to return just after patch word |
|
359 |
__ adr(LR, call_return); |
|
360 |
__ jump(target, relocInfo::runtime_call_type, Rtemp); |
|
361 |
||
362 |
if (is_load) { |
|
363 |
CodeSection* cs = __ code_section(); |
|
364 |
address pc = (address)_pc_start; |
|
365 |
RelocIterator iter(cs, pc, pc + 1); |
|
366 |
relocInfo::change_reloc_info_for_address(&iter, pc, reloc_type, relocInfo::none); |
|
367 |
} |
|
368 |
} |
|
369 |
||
370 |
void DeoptimizeStub::emit_code(LIR_Assembler* ce) { |
|
371 |
__ bind(_entry); |
|
372 |
__ mov_slow(Rtemp, _trap_request); |
|
373 |
ce->verify_reserved_argument_area_size(1); |
|
374 |
__ str(Rtemp, Address(SP)); |
|
375 |
__ call(Runtime1::entry_for(Runtime1::deoptimize_id), relocInfo::runtime_call_type); |
|
376 |
ce->add_call_info_here(_info); |
|
377 |
DEBUG_ONLY(__ should_not_reach_here()); |
|
378 |
} |
|
379 |
||
380 |
||
381 |
void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) { |
|
382 |
address a; |
|
383 |
if (_info->deoptimize_on_exception()) { |
|
384 |
// Deoptimize, do not throw the exception, because it is |
|
385 |
// probably wrong to do it here. |
|
386 |
a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); |
|
387 |
} else { |
|
388 |
a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id); |
|
389 |
} |
|
390 |
ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); |
|
391 |
__ bind(_entry); |
|
392 |
__ call(a, relocInfo::runtime_call_type); |
|
393 |
ce->add_call_info_here(_info); |
|
394 |
ce->verify_oop_map(_info); |
|
395 |
DEBUG_ONLY(STOP("ImplicitNullCheck");) |
|
396 |
} |
|
397 |
||
398 |
||
399 |
void SimpleExceptionStub::emit_code(LIR_Assembler* ce) { |
|
400 |
__ bind(_entry); |
|
401 |
// Pass the object on stack because all registers must be preserved |
|
402 |
if (_obj->is_cpu_register()) { |
|
403 |
ce->verify_reserved_argument_area_size(1); |
|
404 |
__ str(_obj->as_pointer_register(), Address(SP)); |
|
405 |
} else { |
|
406 |
assert(_obj->is_illegal(), "should be"); |
|
407 |
} |
|
408 |
__ call(Runtime1::entry_for(_stub), relocInfo::runtime_call_type); |
|
409 |
ce->add_call_info_here(_info); |
|
410 |
DEBUG_ONLY(STOP("SimpleException");) |
|
411 |
} |
|
412 |
||
413 |
||
414 |
void ArrayCopyStub::emit_code(LIR_Assembler* ce) { |
|
415 |
__ bind(_entry); |
|
416 |
||
417 |
VMRegPair args[5]; |
|
418 |
BasicType signature[5] = { T_OBJECT, T_INT, T_OBJECT, T_INT, T_INT }; |
|
419 |
SharedRuntime::java_calling_convention(signature, args, 5, true); |
|
420 |
||
421 |
Register r[5]; |
|
422 |
r[0] = src()->as_pointer_register(); |
|
423 |
r[1] = src_pos()->as_register(); |
|
424 |
r[2] = dst()->as_pointer_register(); |
|
425 |
r[3] = dst_pos()->as_register(); |
|
426 |
r[4] = length()->as_register(); |
|
427 |
||
428 |
for (int i = 0; i < 5; i++) { |
|
429 |
VMReg arg = args[i].first(); |
|
430 |
if (arg->is_stack()) { |
|
431 |
__ str(r[i], Address(SP, arg->reg2stack() * VMRegImpl::stack_slot_size)); |
|
432 |
} else { |
|
433 |
assert(r[i] == arg->as_Register(), "Calling conventions must match"); |
|
434 |
} |
|
435 |
} |
|
436 |
||
437 |
ce->emit_static_call_stub(); |
|
438 |
if (ce->compilation()->bailed_out()) { |
|
439 |
return; // CodeCache is full |
|
440 |
} |
|
441 |
int ret_addr_offset = __ patchable_call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type); |
|
442 |
assert(ret_addr_offset == __ offset(), "embedded return address not allowed"); |
|
443 |
ce->add_call_info_here(info()); |
|
444 |
ce->verify_oop_map(info()); |
|
445 |
__ b(_continuation); |
|
446 |
} |
|
447 |
||
448 |
#undef __ |