Mercurial > hg > truffle
annotate src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @ 12711:fb4658e16b5d
Truffle: some regression fixes to previous cleanup
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Thu, 07 Nov 2013 20:47:11 +0100 |
parents | f98f5d48f511 |
children | 69944b868a32 8b80b262e501 |
rev | line source |
---|---|
0 | 1 /* |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1295
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1295
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1295
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
26 #include "c1/c1_Defs.hpp" | |
27 #include "c1/c1_MacroAssembler.hpp" | |
28 #include "c1/c1_Runtime1.hpp" | |
29 #include "interpreter/interpreter.hpp" | |
30 #include "nativeInst_sparc.hpp" | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
31 #include "oops/compiledICHolder.hpp" |
1972 | 32 #include "oops/oop.inline.hpp" |
33 #include "prims/jvmtiExport.hpp" | |
34 #include "register_sparc.hpp" | |
35 #include "runtime/sharedRuntime.hpp" | |
36 #include "runtime/signature.hpp" | |
37 #include "runtime/vframeArray.hpp" | |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6725
diff
changeset
|
38 #include "utilities/macros.hpp" |
1972 | 39 #include "vmreg_sparc.inline.hpp" |
0 | 40 |
41 // Implementation of StubAssembler | |
42 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
43 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry_point, int number_of_arguments) { |
0 | 44 // for sparc changing the number of arguments doesn't change |
45 // anything about the frame size so we'll always lie and claim that | |
46 // we are only passing 1 argument. | |
47 set_num_rt_args(1); | |
48 | |
49 assert_not_delayed(); | |
50 // bang stack before going to runtime | |
51 set(-os::vm_page_size() + STACK_BIAS, G3_scratch); | |
52 st(G0, SP, G3_scratch); | |
53 | |
54 // debugging support | |
55 assert(number_of_arguments >= 0 , "cannot have negative number of arguments"); | |
56 | |
57 set_last_Java_frame(SP, noreg); | |
58 if (VerifyThread) mov(G2_thread, O0); // about to be smashed; pass early | |
59 save_thread(L7_thread_cache); | |
60 // do the call | |
61 call(entry_point, relocInfo::runtime_call_type); | |
62 if (!VerifyThread) { | |
63 delayed()->mov(G2_thread, O0); // pass thread as first argument | |
64 } else { | |
65 delayed()->nop(); // (thread already passed) | |
66 } | |
67 int call_offset = offset(); // offset of return address | |
68 restore_thread(L7_thread_cache); | |
69 reset_last_Java_frame(); | |
70 | |
71 // check for pending exceptions | |
72 { Label L; | |
727 | 73 Address exception_addr(G2_thread, Thread::pending_exception_offset()); |
0 | 74 ld_ptr(exception_addr, Gtemp); |
3839 | 75 br_null_short(Gtemp, pt, L); |
727 | 76 Address vm_result_addr(G2_thread, JavaThread::vm_result_offset()); |
0 | 77 st_ptr(G0, vm_result_addr); |
727 | 78 Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset()); |
0 | 79 st_ptr(G0, vm_result_addr_2); |
80 | |
81 if (frame_size() == no_frame_size) { | |
82 // we use O7 linkage so that forward_exception_entry has the issuing PC | |
83 call(StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type); | |
84 delayed()->restore(); | |
85 } else if (_stub_id == Runtime1::forward_exception_id) { | |
86 should_not_reach_here(); | |
87 } else { | |
727 | 88 AddressLiteral exc(Runtime1::entry_for(Runtime1::forward_exception_id)); |
89 jump_to(exc, G4); | |
0 | 90 delayed()->nop(); |
91 } | |
92 bind(L); | |
93 } | |
94 | |
95 // get oop result if there is one and reset the value in the thread | |
96 if (oop_result1->is_valid()) { // get oop result if there is one and reset it in the thread | |
97 get_vm_result (oop_result1); | |
98 } else { | |
99 // be a little paranoid and clear the result | |
727 | 100 Address vm_result_addr(G2_thread, JavaThread::vm_result_offset()); |
0 | 101 st_ptr(G0, vm_result_addr); |
102 } | |
103 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
104 // get second result if there is one and reset the value in the thread |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
105 if (metadata_result->is_valid()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
106 get_vm_result_2 (metadata_result); |
0 | 107 } else { |
108 // be a little paranoid and clear the result | |
727 | 109 Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset()); |
0 | 110 st_ptr(G0, vm_result_addr_2); |
111 } | |
112 | |
113 return call_offset; | |
114 } | |
115 | |
116 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
117 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1) { |
0 | 118 // O0 is reserved for the thread |
119 mov(arg1, O1); | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
120 return call_RT(oop_result1, metadata_result, entry, 1); |
0 | 121 } |
122 | |
123 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
124 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2) { |
0 | 125 // O0 is reserved for the thread |
126 mov(arg1, O1); | |
127 mov(arg2, O2); assert(arg2 != O1, "smashed argument"); | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
128 return call_RT(oop_result1, metadata_result, entry, 2); |
0 | 129 } |
130 | |
131 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
132 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3) { |
0 | 133 // O0 is reserved for the thread |
134 mov(arg1, O1); | |
135 mov(arg2, O2); assert(arg2 != O1, "smashed argument"); | |
136 mov(arg3, O3); assert(arg3 != O1 && arg3 != O2, "smashed argument"); | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
137 return call_RT(oop_result1, metadata_result, entry, 3); |
0 | 138 } |
139 | |
140 | |
141 // Implementation of Runtime1 | |
142 | |
143 #define __ sasm-> | |
144 | |
145 static int cpu_reg_save_offsets[FrameMap::nof_cpu_regs]; | |
146 static int fpu_reg_save_offsets[FrameMap::nof_fpu_regs]; | |
147 static int reg_save_size_in_words; | |
148 static int frame_size_in_bytes = -1; | |
149 | |
150 static OopMap* generate_oop_map(StubAssembler* sasm, bool save_fpu_registers) { | |
151 assert(frame_size_in_bytes == __ total_frame_size_in_bytes(reg_save_size_in_words), | |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
152 "mismatch in calculation"); |
0 | 153 sasm->set_frame_size(frame_size_in_bytes / BytesPerWord); |
154 int frame_size_in_slots = frame_size_in_bytes / sizeof(jint); | |
155 OopMap* oop_map = new OopMap(frame_size_in_slots, 0); | |
156 | |
157 int i; | |
158 for (i = 0; i < FrameMap::nof_cpu_regs; i++) { | |
159 Register r = as_Register(i); | |
160 if (r == G1 || r == G3 || r == G4 || r == G5) { | |
161 int sp_offset = cpu_reg_save_offsets[i]; | |
162 oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset), | |
163 r->as_VMReg()); | |
164 } | |
165 } | |
166 | |
167 if (save_fpu_registers) { | |
168 for (i = 0; i < FrameMap::nof_fpu_regs; i++) { | |
169 FloatRegister r = as_FloatRegister(i); | |
170 int sp_offset = fpu_reg_save_offsets[i]; | |
171 oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset), | |
172 r->as_VMReg()); | |
173 } | |
174 } | |
175 return oop_map; | |
176 } | |
177 | |
178 static OopMap* save_live_registers(StubAssembler* sasm, bool save_fpu_registers = true) { | |
179 assert(frame_size_in_bytes == __ total_frame_size_in_bytes(reg_save_size_in_words), | |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
180 "mismatch in calculation"); |
0 | 181 __ save_frame_c1(frame_size_in_bytes); |
182 | |
183 // Record volatile registers as callee-save values in an OopMap so their save locations will be | |
184 // propagated to the caller frame's RegisterMap during StackFrameStream construction (needed for | |
185 // deoptimization; see compiledVFrame::create_stack_value). The caller's I, L and O registers | |
186 // are saved in register windows - I's and L's in the caller's frame and O's in the stub frame | |
187 // (as the stub's I's) when the runtime routine called by the stub creates its frame. | |
188 // OopMap frame sizes are in c2 stack slot sizes (sizeof(jint)) | |
189 | |
190 int i; | |
191 for (i = 0; i < FrameMap::nof_cpu_regs; i++) { | |
192 Register r = as_Register(i); | |
193 if (r == G1 || r == G3 || r == G4 || r == G5) { | |
194 int sp_offset = cpu_reg_save_offsets[i]; | |
195 __ st_ptr(r, SP, (sp_offset * BytesPerWord) + STACK_BIAS); | |
196 } | |
197 } | |
198 | |
199 if (save_fpu_registers) { | |
200 for (i = 0; i < FrameMap::nof_fpu_regs; i++) { | |
201 FloatRegister r = as_FloatRegister(i); | |
202 int sp_offset = fpu_reg_save_offsets[i]; | |
203 __ stf(FloatRegisterImpl::S, r, SP, (sp_offset * BytesPerWord) + STACK_BIAS); | |
204 } | |
205 } | |
206 | |
207 return generate_oop_map(sasm, save_fpu_registers); | |
208 } | |
209 | |
210 static void restore_live_registers(StubAssembler* sasm, bool restore_fpu_registers = true) { | |
211 for (int i = 0; i < FrameMap::nof_cpu_regs; i++) { | |
212 Register r = as_Register(i); | |
213 if (r == G1 || r == G3 || r == G4 || r == G5) { | |
214 __ ld_ptr(SP, (cpu_reg_save_offsets[i] * BytesPerWord) + STACK_BIAS, r); | |
215 } | |
216 } | |
217 | |
218 if (restore_fpu_registers) { | |
219 for (int i = 0; i < FrameMap::nof_fpu_regs; i++) { | |
220 FloatRegister r = as_FloatRegister(i); | |
221 __ ldf(FloatRegisterImpl::S, SP, (fpu_reg_save_offsets[i] * BytesPerWord) + STACK_BIAS, r); | |
222 } | |
223 } | |
224 } | |
225 | |
226 | |
227 void Runtime1::initialize_pd() { | |
228 // compute word offsets from SP at which live (non-windowed) registers are captured by stub routines | |
229 // | |
230 // A stub routine will have a frame that is at least large enough to hold | |
231 // a register window save area (obviously) and the volatile g registers | |
232 // and floating registers. A user of save_live_registers can have a frame | |
233 // that has more scratch area in it (although typically they will use L-regs). | |
234 // in that case the frame will look like this (stack growing down) | |
235 // | |
236 // FP -> | | | |
237 // | scratch mem | | |
238 // | " " | | |
239 // -------------- | |
240 // | float regs | | |
241 // | " " | | |
242 // --------------- | |
243 // | G regs | | |
244 // | " " | | |
245 // --------------- | |
246 // | abi reg. | | |
247 // | window save | | |
248 // | area | | |
249 // SP -> --------------- | |
250 // | |
251 int i; | |
252 int sp_offset = round_to(frame::register_save_words, 2); // start doubleword aligned | |
253 | |
254 // only G int registers are saved explicitly; others are found in register windows | |
255 for (i = 0; i < FrameMap::nof_cpu_regs; i++) { | |
256 Register r = as_Register(i); | |
257 if (r == G1 || r == G3 || r == G4 || r == G5) { | |
258 cpu_reg_save_offsets[i] = sp_offset; | |
259 sp_offset++; | |
260 } | |
261 } | |
262 | |
263 // all float registers are saved explicitly | |
264 assert(FrameMap::nof_fpu_regs == 32, "double registers not handled here"); | |
265 for (i = 0; i < FrameMap::nof_fpu_regs; i++) { | |
266 fpu_reg_save_offsets[i] = sp_offset; | |
267 sp_offset++; | |
268 } | |
269 reg_save_size_in_words = sp_offset - frame::memory_parameter_word_sp_offset; | |
270 // this should match assembler::total_frame_size_in_bytes, which | |
271 // isn't callable from this context. It's checked by an assert when | |
272 // it's used though. | |
273 frame_size_in_bytes = align_size_up(sp_offset * wordSize, 8); | |
274 } | |
275 | |
276 | |
277 OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) { | |
278 // make a frame and preserve the caller's caller-save registers | |
279 OopMap* oop_map = save_live_registers(sasm); | |
280 int call_offset; | |
281 if (!has_argument) { | |
282 call_offset = __ call_RT(noreg, noreg, target); | |
283 } else { | |
284 call_offset = __ call_RT(noreg, noreg, target, G4); | |
285 } | |
286 OopMapSet* oop_maps = new OopMapSet(); | |
287 oop_maps->add_gc_map(call_offset, oop_map); | |
288 | |
289 __ should_not_reach_here(); | |
290 return oop_maps; | |
291 } | |
292 | |
293 | |
294 OopMapSet* Runtime1::generate_stub_call(StubAssembler* sasm, Register result, address target, | |
295 Register arg1, Register arg2, Register arg3) { | |
296 // make a frame and preserve the caller's caller-save registers | |
297 OopMap* oop_map = save_live_registers(sasm); | |
298 | |
299 int call_offset; | |
300 if (arg1 == noreg) { | |
301 call_offset = __ call_RT(result, noreg, target); | |
302 } else if (arg2 == noreg) { | |
303 call_offset = __ call_RT(result, noreg, target, arg1); | |
304 } else if (arg3 == noreg) { | |
305 call_offset = __ call_RT(result, noreg, target, arg1, arg2); | |
306 } else { | |
307 call_offset = __ call_RT(result, noreg, target, arg1, arg2, arg3); | |
308 } | |
309 OopMapSet* oop_maps = NULL; | |
310 | |
311 oop_maps = new OopMapSet(); | |
312 oop_maps->add_gc_map(call_offset, oop_map); | |
313 restore_live_registers(sasm); | |
314 | |
315 __ ret(); | |
316 __ delayed()->restore(); | |
317 | |
318 return oop_maps; | |
319 } | |
320 | |
321 | |
322 OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { | |
323 // make a frame and preserve the caller's caller-save registers | |
324 OopMap* oop_map = save_live_registers(sasm); | |
325 | |
326 // call the runtime patching routine, returns non-zero if nmethod got deopted. | |
327 int call_offset = __ call_RT(noreg, noreg, target); | |
328 OopMapSet* oop_maps = new OopMapSet(); | |
329 oop_maps->add_gc_map(call_offset, oop_map); | |
330 | |
331 // re-execute the patched instruction or, if the nmethod was deoptmized, return to the | |
332 // deoptimization handler entry that will cause re-execution of the current bytecode | |
333 DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob(); | |
334 assert(deopt_blob != NULL, "deoptimization blob must have been created"); | |
335 | |
336 Label no_deopt; | |
3839 | 337 __ br_null_short(O0, Assembler::pt, no_deopt); |
0 | 338 |
339 // return to the deoptimization handler entry for unpacking and rexecute | |
340 // if we simply returned the we'd deopt as if any call we patched had just | |
341 // returned. | |
342 | |
343 restore_live_registers(sasm); | |
2156
85330eaa15ee
7013812: C1: deopt blob too far from patching stub
iveresov
parents:
2127
diff
changeset
|
344 |
85330eaa15ee
7013812: C1: deopt blob too far from patching stub
iveresov
parents:
2127
diff
changeset
|
345 AddressLiteral dest(deopt_blob->unpack_with_reexecution()); |
85330eaa15ee
7013812: C1: deopt blob too far from patching stub
iveresov
parents:
2127
diff
changeset
|
346 __ jump_to(dest, O0); |
85330eaa15ee
7013812: C1: deopt blob too far from patching stub
iveresov
parents:
2127
diff
changeset
|
347 __ delayed()->restore(); |
0 | 348 |
349 __ bind(no_deopt); | |
350 restore_live_registers(sasm); | |
351 __ ret(); | |
352 __ delayed()->restore(); | |
353 | |
354 return oop_maps; | |
355 } | |
356 | |
357 OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { | |
358 | |
359 OopMapSet* oop_maps = NULL; | |
360 // for better readability | |
361 const bool must_gc_arguments = true; | |
362 const bool dont_gc_arguments = false; | |
363 | |
364 // stub code & info for the different stubs | |
365 switch (id) { | |
366 case forward_exception_id: | |
367 { | |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
368 oop_maps = generate_handle_exception(id, sasm); |
0 | 369 } |
370 break; | |
371 | |
372 case new_instance_id: | |
373 case fast_new_instance_id: | |
374 case fast_new_instance_init_check_id: | |
375 { | |
376 Register G5_klass = G5; // Incoming | |
377 Register O0_obj = O0; // Outgoing | |
378 | |
379 if (id == new_instance_id) { | |
380 __ set_info("new_instance", dont_gc_arguments); | |
381 } else if (id == fast_new_instance_id) { | |
382 __ set_info("fast new_instance", dont_gc_arguments); | |
383 } else { | |
384 assert(id == fast_new_instance_init_check_id, "bad StubID"); | |
385 __ set_info("fast new_instance init check", dont_gc_arguments); | |
386 } | |
387 | |
388 if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) && | |
389 UseTLAB && FastTLABRefill) { | |
390 Label slow_path; | |
391 Register G1_obj_size = G1; | |
392 Register G3_t1 = G3; | |
393 Register G4_t2 = G4; | |
394 assert_different_registers(G5_klass, G1_obj_size, G3_t1, G4_t2); | |
395 | |
396 // Push a frame since we may do dtrace notification for the | |
397 // allocation which requires calling out and we don't want | |
398 // to stomp the real return address. | |
399 __ save_frame(0); | |
400 | |
401 if (id == fast_new_instance_init_check_id) { | |
402 // make sure the klass is initialized | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
403 __ ldub(G5_klass, in_bytes(InstanceKlass::init_state_offset()), G3_t1); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
404 __ cmp_and_br_short(G3_t1, InstanceKlass::fully_initialized, Assembler::notEqual, Assembler::pn, slow_path); |
0 | 405 } |
406 #ifdef ASSERT | |
407 // assert object can be fast path allocated | |
408 { | |
409 Label ok, not_ok; | |
4762
069ab3f976d3
7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
stefank
parents:
4048
diff
changeset
|
410 __ ld(G5_klass, in_bytes(Klass::layout_helper_offset()), G1_obj_size); |
3839 | 411 // make sure it's an instance (LH > 0) |
412 __ cmp_and_br_short(G1_obj_size, 0, Assembler::lessEqual, Assembler::pn, not_ok); | |
0 | 413 __ btst(Klass::_lh_instance_slow_path_bit, G1_obj_size); |
414 __ br(Assembler::zero, false, Assembler::pn, ok); | |
415 __ delayed()->nop(); | |
416 __ bind(not_ok); | |
417 __ stop("assert(can be fast path allocated)"); | |
418 __ should_not_reach_here(); | |
419 __ bind(ok); | |
420 } | |
421 #endif // ASSERT | |
422 // if we got here then the TLAB allocation failed, so try | |
423 // refilling the TLAB or allocating directly from eden. | |
424 Label retry_tlab, try_eden; | |
425 __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves G5_klass | |
426 | |
427 __ bind(retry_tlab); | |
428 | |
429 // get the instance size | |
4762
069ab3f976d3
7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
stefank
parents:
4048
diff
changeset
|
430 __ ld(G5_klass, in_bytes(Klass::layout_helper_offset()), G1_obj_size); |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2002
diff
changeset
|
431 |
0 | 432 __ tlab_allocate(O0_obj, G1_obj_size, 0, G3_t1, slow_path); |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2002
diff
changeset
|
433 |
0 | 434 __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); |
435 __ verify_oop(O0_obj); | |
436 __ mov(O0, I0); | |
437 __ ret(); | |
438 __ delayed()->restore(); | |
439 | |
440 __ bind(try_eden); | |
441 // get the instance size | |
4762
069ab3f976d3
7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
stefank
parents:
4048
diff
changeset
|
442 __ ld(G5_klass, in_bytes(Klass::layout_helper_offset()), G1_obj_size); |
0 | 443 __ eden_allocate(O0_obj, G1_obj_size, 0, G3_t1, G4_t2, slow_path); |
2127
5577848f5923
7011463: Sparc MacroAssembler::incr_allocated_bytes() needs a RegisterOrConstant argument
phh
parents:
2100
diff
changeset
|
444 __ incr_allocated_bytes(G1_obj_size, G3_t1, G4_t2); |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2002
diff
changeset
|
445 |
0 | 446 __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); |
447 __ verify_oop(O0_obj); | |
448 __ mov(O0, I0); | |
449 __ ret(); | |
450 __ delayed()->restore(); | |
451 | |
452 __ bind(slow_path); | |
453 | |
454 // pop this frame so generate_stub_call can push it's own | |
455 __ restore(); | |
456 } | |
457 | |
458 oop_maps = generate_stub_call(sasm, I0, CAST_FROM_FN_PTR(address, new_instance), G5_klass); | |
459 // I0->O0: new instance | |
460 } | |
461 | |
462 break; | |
463 | |
464 case counter_overflow_id: | |
1783 | 465 // G4 contains bci, G5 contains method |
466 oop_maps = generate_stub_call(sasm, noreg, CAST_FROM_FN_PTR(address, counter_overflow), G4, G5); | |
0 | 467 break; |
468 | |
469 case new_type_array_id: | |
470 case new_object_array_id: | |
471 { | |
472 Register G5_klass = G5; // Incoming | |
473 Register G4_length = G4; // Incoming | |
474 Register O0_obj = O0; // Outgoing | |
475 | |
4762
069ab3f976d3
7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
stefank
parents:
4048
diff
changeset
|
476 Address klass_lh(G5_klass, Klass::layout_helper_offset()); |
0 | 477 assert(Klass::_lh_header_size_shift % BitsPerByte == 0, "bytewise"); |
478 assert(Klass::_lh_header_size_mask == 0xFF, "bytewise"); | |
479 // Use this offset to pick out an individual byte of the layout_helper: | |
480 const int klass_lh_header_size_offset = ((BytesPerInt - 1) // 3 - 2 selects byte {0,1,0,0} | |
481 - Klass::_lh_header_size_shift / BitsPerByte); | |
482 | |
483 if (id == new_type_array_id) { | |
484 __ set_info("new_type_array", dont_gc_arguments); | |
485 } else { | |
486 __ set_info("new_object_array", dont_gc_arguments); | |
487 } | |
488 | |
489 #ifdef ASSERT | |
490 // assert object type is really an array of the proper kind | |
491 { | |
492 Label ok; | |
493 Register G3_t1 = G3; | |
494 __ ld(klass_lh, G3_t1); | |
495 __ sra(G3_t1, Klass::_lh_array_tag_shift, G3_t1); | |
496 int tag = ((id == new_type_array_id) | |
497 ? Klass::_lh_array_tag_type_value | |
498 : Klass::_lh_array_tag_obj_value); | |
3839 | 499 __ cmp_and_brx_short(G3_t1, tag, Assembler::equal, Assembler::pt, ok); |
0 | 500 __ stop("assert(is an array klass)"); |
501 __ should_not_reach_here(); | |
502 __ bind(ok); | |
503 } | |
504 #endif // ASSERT | |
505 | |
506 if (UseTLAB && FastTLABRefill) { | |
507 Label slow_path; | |
508 Register G1_arr_size = G1; | |
509 Register G3_t1 = G3; | |
510 Register O1_t2 = O1; | |
511 assert_different_registers(G5_klass, G4_length, G1_arr_size, G3_t1, O1_t2); | |
512 | |
513 // check that array length is small enough for fast path | |
514 __ set(C1_MacroAssembler::max_array_allocation_length, G3_t1); | |
3839 | 515 __ cmp_and_br_short(G4_length, G3_t1, Assembler::greaterUnsigned, Assembler::pn, slow_path); |
0 | 516 |
517 // if we got here then the TLAB allocation failed, so try | |
518 // refilling the TLAB or allocating directly from eden. | |
519 Label retry_tlab, try_eden; | |
520 __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves G4_length and G5_klass | |
521 | |
522 __ bind(retry_tlab); | |
523 | |
524 // get the allocation size: (length << (layout_helper & 0x1F)) + header_size | |
525 __ ld(klass_lh, G3_t1); | |
526 __ sll(G4_length, G3_t1, G1_arr_size); | |
527 __ srl(G3_t1, Klass::_lh_header_size_shift, G3_t1); | |
528 __ and3(G3_t1, Klass::_lh_header_size_mask, G3_t1); | |
529 __ add(G1_arr_size, G3_t1, G1_arr_size); | |
530 __ add(G1_arr_size, MinObjAlignmentInBytesMask, G1_arr_size); // align up | |
531 __ and3(G1_arr_size, ~MinObjAlignmentInBytesMask, G1_arr_size); | |
532 | |
533 __ tlab_allocate(O0_obj, G1_arr_size, 0, G3_t1, slow_path); // preserves G1_arr_size | |
534 | |
535 __ initialize_header(O0_obj, G5_klass, G4_length, G3_t1, O1_t2); | |
536 __ ldub(klass_lh, G3_t1, klass_lh_header_size_offset); | |
537 __ sub(G1_arr_size, G3_t1, O1_t2); // body length | |
538 __ add(O0_obj, G3_t1, G3_t1); // body start | |
539 __ initialize_body(G3_t1, O1_t2); | |
540 __ verify_oop(O0_obj); | |
541 __ retl(); | |
542 __ delayed()->nop(); | |
543 | |
544 __ bind(try_eden); | |
545 // get the allocation size: (length << (layout_helper & 0x1F)) + header_size | |
546 __ ld(klass_lh, G3_t1); | |
547 __ sll(G4_length, G3_t1, G1_arr_size); | |
548 __ srl(G3_t1, Klass::_lh_header_size_shift, G3_t1); | |
549 __ and3(G3_t1, Klass::_lh_header_size_mask, G3_t1); | |
550 __ add(G1_arr_size, G3_t1, G1_arr_size); | |
551 __ add(G1_arr_size, MinObjAlignmentInBytesMask, G1_arr_size); | |
552 __ and3(G1_arr_size, ~MinObjAlignmentInBytesMask, G1_arr_size); | |
553 | |
554 __ eden_allocate(O0_obj, G1_arr_size, 0, G3_t1, O1_t2, slow_path); // preserves G1_arr_size | |
2127
5577848f5923
7011463: Sparc MacroAssembler::incr_allocated_bytes() needs a RegisterOrConstant argument
phh
parents:
2100
diff
changeset
|
555 __ incr_allocated_bytes(G1_arr_size, G3_t1, O1_t2); |
0 | 556 |
557 __ initialize_header(O0_obj, G5_klass, G4_length, G3_t1, O1_t2); | |
558 __ ldub(klass_lh, G3_t1, klass_lh_header_size_offset); | |
559 __ sub(G1_arr_size, G3_t1, O1_t2); // body length | |
560 __ add(O0_obj, G3_t1, G3_t1); // body start | |
561 __ initialize_body(G3_t1, O1_t2); | |
562 __ verify_oop(O0_obj); | |
563 __ retl(); | |
564 __ delayed()->nop(); | |
565 | |
566 __ bind(slow_path); | |
567 } | |
568 | |
569 if (id == new_type_array_id) { | |
570 oop_maps = generate_stub_call(sasm, I0, CAST_FROM_FN_PTR(address, new_type_array), G5_klass, G4_length); | |
571 } else { | |
572 oop_maps = generate_stub_call(sasm, I0, CAST_FROM_FN_PTR(address, new_object_array), G5_klass, G4_length); | |
573 } | |
574 // I0 -> O0: new array | |
575 } | |
576 break; | |
577 | |
578 case new_multi_array_id: | |
579 { // O0: klass | |
580 // O1: rank | |
581 // O2: address of 1st dimension | |
582 __ set_info("new_multi_array", dont_gc_arguments); | |
583 oop_maps = generate_stub_call(sasm, I0, CAST_FROM_FN_PTR(address, new_multi_array), I0, I1, I2); | |
584 // I0 -> O0: new multi array | |
585 } | |
586 break; | |
587 | |
588 case register_finalizer_id: | |
589 { | |
590 __ set_info("register_finalizer", dont_gc_arguments); | |
591 | |
592 // load the klass and check the has finalizer flag | |
593 Label register_finalizer; | |
594 Register t = O1; | |
2002 | 595 __ load_klass(O0, t); |
4762
069ab3f976d3
7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
stefank
parents:
4048
diff
changeset
|
596 __ ld(t, in_bytes(Klass::access_flags_offset()), t); |
0 | 597 __ set(JVM_ACC_HAS_FINALIZER, G3); |
598 __ andcc(G3, t, G0); | |
599 __ br(Assembler::notZero, false, Assembler::pt, register_finalizer); | |
600 __ delayed()->nop(); | |
601 | |
602 // do a leaf return | |
603 __ retl(); | |
604 __ delayed()->nop(); | |
605 | |
606 __ bind(register_finalizer); | |
607 OopMap* oop_map = save_live_registers(sasm); | |
608 int call_offset = __ call_RT(noreg, noreg, | |
609 CAST_FROM_FN_PTR(address, SharedRuntime::register_finalizer), I0); | |
610 oop_maps = new OopMapSet(); | |
611 oop_maps->add_gc_map(call_offset, oop_map); | |
612 | |
613 // Now restore all the live registers | |
614 restore_live_registers(sasm); | |
615 | |
616 __ ret(); | |
617 __ delayed()->restore(); | |
618 } | |
619 break; | |
620 | |
621 case throw_range_check_failed_id: | |
622 { __ set_info("range_check_failed", dont_gc_arguments); // arguments will be discarded | |
623 // G4: index | |
624 oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true); | |
625 } | |
626 break; | |
627 | |
628 case throw_index_exception_id: | |
629 { __ set_info("index_range_check_failed", dont_gc_arguments); // arguments will be discarded | |
630 // G4: index | |
631 oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true); | |
632 } | |
633 break; | |
634 | |
635 case throw_div0_exception_id: | |
636 { __ set_info("throw_div0_exception", dont_gc_arguments); | |
637 oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false); | |
638 } | |
639 break; | |
640 | |
641 case throw_null_pointer_exception_id: | |
642 { __ set_info("throw_null_pointer_exception", dont_gc_arguments); | |
643 oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false); | |
644 } | |
645 break; | |
646 | |
647 case handle_exception_id: | |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
648 { __ set_info("handle_exception", dont_gc_arguments); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
649 oop_maps = generate_handle_exception(id, sasm); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
650 } |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
651 break; |
0 | 652 |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
653 case handle_exception_from_callee_id: |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
654 { __ set_info("handle_exception_from_callee", dont_gc_arguments); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
655 oop_maps = generate_handle_exception(id, sasm); |
0 | 656 } |
657 break; | |
658 | |
659 case unwind_exception_id: | |
660 { | |
661 // O0: exception | |
662 // I7: address of call to this method | |
663 | |
664 __ set_info("unwind_exception", dont_gc_arguments); | |
665 __ mov(Oexception, Oexception->after_save()); | |
666 __ add(I7, frame::pc_return_offset, Oissuing_pc->after_save()); | |
667 | |
668 __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), | |
1295 | 669 G2_thread, Oissuing_pc->after_save()); |
0 | 670 __ verify_not_null_oop(Oexception->after_save()); |
1564 | 671 |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
672 // Restore SP from L7 if the exception PC is a method handle call site. |
1564 | 673 __ mov(O0, G5); // Save the target address. |
674 __ lduw(Address(G2_thread, JavaThread::is_method_handle_return_offset()), L0); | |
675 __ tst(L0); // Condition codes are preserved over the restore. | |
676 __ restore(); | |
677 | |
678 __ jmp(G5, 0); | |
679 __ delayed()->movcc(Assembler::notZero, false, Assembler::icc, L7_mh_SP_save, SP); // Restore SP if required. | |
0 | 680 } |
681 break; | |
682 | |
683 case throw_array_store_exception_id: | |
684 { | |
685 __ set_info("throw_array_store_exception", dont_gc_arguments); | |
2168
e4fee0bdaa85
7008809: should report the class in ArrayStoreExceptions from compiled code
never
parents:
2127
diff
changeset
|
686 oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true); |
0 | 687 } |
688 break; | |
689 | |
690 case throw_class_cast_exception_id: | |
691 { | |
692 // G4: object | |
693 __ set_info("throw_class_cast_exception", dont_gc_arguments); | |
694 oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true); | |
695 } | |
696 break; | |
697 | |
698 case throw_incompatible_class_change_error_id: | |
699 { | |
700 __ set_info("throw_incompatible_class_cast_exception", dont_gc_arguments); | |
701 oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false); | |
702 } | |
703 break; | |
704 | |
705 case slow_subtype_check_id: | |
706 { // Support for uint StubRoutine::partial_subtype_check( Klass sub, Klass super ); | |
707 // Arguments : | |
708 // | |
709 // ret : G3 | |
710 // sub : G3, argument, destroyed | |
711 // super: G1, argument, not changed | |
712 // raddr: O7, blown by call | |
644
c517646eef23
6813212: factor duplicated assembly code for general subclass check (for 6655638)
jrose
parents:
342
diff
changeset
|
713 Label miss; |
0 | 714 |
715 __ save_frame(0); // Blow no registers! | |
716 | |
644
c517646eef23
6813212: factor duplicated assembly code for general subclass check (for 6655638)
jrose
parents:
342
diff
changeset
|
717 __ check_klass_subtype_slow_path(G3, G1, L0, L1, L2, L4, NULL, &miss); |
0 | 718 |
719 __ mov(1, G3); | |
644
c517646eef23
6813212: factor duplicated assembly code for general subclass check (for 6655638)
jrose
parents:
342
diff
changeset
|
720 __ ret(); // Result in G5 is 'true' |
0 | 721 __ delayed()->restore(); // free copy or add can go here |
722 | |
723 __ bind(miss); | |
724 __ mov(0, G3); | |
644
c517646eef23
6813212: factor duplicated assembly code for general subclass check (for 6655638)
jrose
parents:
342
diff
changeset
|
725 __ ret(); // Result in G5 is 'false' |
0 | 726 __ delayed()->restore(); // free copy or add can go here |
727 } | |
728 | |
729 case monitorenter_nofpu_id: | |
730 case monitorenter_id: | |
731 { // G4: object | |
732 // G5: lock address | |
733 __ set_info("monitorenter", dont_gc_arguments); | |
734 | |
735 int save_fpu_registers = (id == monitorenter_id); | |
736 // make a frame and preserve the caller's caller-save registers | |
737 OopMap* oop_map = save_live_registers(sasm, save_fpu_registers); | |
738 | |
739 int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, monitorenter), G4, G5); | |
740 | |
741 oop_maps = new OopMapSet(); | |
742 oop_maps->add_gc_map(call_offset, oop_map); | |
743 restore_live_registers(sasm, save_fpu_registers); | |
744 | |
745 __ ret(); | |
746 __ delayed()->restore(); | |
747 } | |
748 break; | |
749 | |
750 case monitorexit_nofpu_id: | |
751 case monitorexit_id: | |
752 { // G4: lock address | |
753 // note: really a leaf routine but must setup last java sp | |
754 // => use call_RT for now (speed can be improved by | |
755 // doing last java sp setup manually) | |
756 __ set_info("monitorexit", dont_gc_arguments); | |
757 | |
758 int save_fpu_registers = (id == monitorexit_id); | |
759 // make a frame and preserve the caller's caller-save registers | |
760 OopMap* oop_map = save_live_registers(sasm, save_fpu_registers); | |
761 | |
762 int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, monitorexit), G4); | |
763 | |
764 oop_maps = new OopMapSet(); | |
765 oop_maps->add_gc_map(call_offset, oop_map); | |
766 restore_live_registers(sasm, save_fpu_registers); | |
767 | |
768 __ ret(); | |
769 __ delayed()->restore(); | |
4048
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
770 } |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
771 break; |
0 | 772 |
4048
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
773 case deoptimize_id: |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
774 { |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
775 __ set_info("deoptimize", dont_gc_arguments); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
776 OopMap* oop_map = save_live_registers(sasm); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
777 int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize)); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
778 oop_maps = new OopMapSet(); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
779 oop_maps->add_gc_map(call_offset, oop_map); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
780 restore_live_registers(sasm); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
781 DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob(); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
782 assert(deopt_blob != NULL, "deoptimization blob must have been created"); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
783 AddressLiteral dest(deopt_blob->unpack_with_reexecution()); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
784 __ jump_to(dest, O0); |
cec1757a0134
7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
twisti
parents:
3910
diff
changeset
|
785 __ delayed()->restore(); |
0 | 786 } |
787 break; | |
788 | |
789 case access_field_patching_id: | |
790 { __ set_info("access_field_patching", dont_gc_arguments); | |
791 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching)); | |
792 } | |
793 break; | |
794 | |
795 case load_klass_patching_id: | |
796 { __ set_info("load_klass_patching", dont_gc_arguments); | |
797 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching)); | |
798 } | |
799 break; | |
800 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
801 case load_mirror_patching_id: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
802 { __ set_info("load_mirror_patching", dont_gc_arguments); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
803 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching)); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
804 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
805 break; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4771
diff
changeset
|
806 |
12160
f98f5d48f511
7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
roland
parents:
9155
diff
changeset
|
807 case load_appendix_patching_id: |
f98f5d48f511
7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
roland
parents:
9155
diff
changeset
|
808 { __ set_info("load_appendix_patching", dont_gc_arguments); |
f98f5d48f511
7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
roland
parents:
9155
diff
changeset
|
809 oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching)); |
f98f5d48f511
7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
roland
parents:
9155
diff
changeset
|
810 } |
f98f5d48f511
7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
roland
parents:
9155
diff
changeset
|
811 break; |
f98f5d48f511
7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
roland
parents:
9155
diff
changeset
|
812 |
0 | 813 case dtrace_object_alloc_id: |
814 { // O0: object | |
815 __ set_info("dtrace_object_alloc", dont_gc_arguments); | |
816 // we can't gc here so skip the oopmap but make sure that all | |
817 // the live registers get saved. | |
818 save_live_registers(sasm); | |
819 | |
820 __ save_thread(L7_thread_cache); | |
821 __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), | |
822 relocInfo::runtime_call_type); | |
823 __ delayed()->mov(I0, O0); | |
824 __ restore_thread(L7_thread_cache); | |
825 | |
826 restore_live_registers(sasm); | |
827 __ ret(); | |
828 __ delayed()->restore(); | |
829 } | |
830 break; | |
831 | |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6725
diff
changeset
|
832 #if INCLUDE_ALL_GCS |
342 | 833 case g1_pre_barrier_slow_id: |
834 { // G4: previous value of memory | |
835 BarrierSet* bs = Universe::heap()->barrier_set(); | |
836 if (bs->kind() != BarrierSet::G1SATBCTLogging) { | |
837 __ save_frame(0); | |
838 __ set((int)id, O1); | |
839 __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0); | |
840 __ should_not_reach_here(); | |
841 break; | |
842 } | |
843 | |
844 __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments); | |
845 | |
846 Register pre_val = G4; | |
847 Register tmp = G1_scratch; | |
848 Register tmp2 = G3_scratch; | |
849 | |
850 Label refill, restart; | |
851 bool with_frame = false; // I don't know if we can do with-frame. | |
852 int satb_q_index_byte_offset = | |
853 in_bytes(JavaThread::satb_mark_queue_offset() + | |
854 PtrQueue::byte_offset_of_index()); | |
855 int satb_q_buf_byte_offset = | |
856 in_bytes(JavaThread::satb_mark_queue_offset() + | |
857 PtrQueue::byte_offset_of_buf()); | |
3888
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
858 |
342 | 859 __ bind(restart); |
3888
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
860 // Load the index into the SATB buffer. PtrQueue::_index is a |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
861 // size_t so ld_ptr is appropriate |
342 | 862 __ ld_ptr(G2_thread, satb_q_index_byte_offset, tmp); |
863 | |
3888
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
864 // index == 0? |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
865 __ cmp_and_brx_short(tmp, G0, Assembler::equal, Assembler::pn, refill); |
342 | 866 |
3888
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
867 __ ld_ptr(G2_thread, satb_q_buf_byte_offset, tmp2); |
342 | 868 __ sub(tmp, oopSize, tmp); |
869 | |
870 __ st_ptr(pre_val, tmp2, tmp); // [_buf + index] := <address_of_card> | |
871 // Use return-from-leaf | |
872 __ retl(); | |
873 __ delayed()->st_ptr(tmp, G2_thread, satb_q_index_byte_offset); | |
874 | |
875 __ bind(refill); | |
876 __ save_frame(0); | |
877 | |
878 __ mov(pre_val, L0); | |
879 __ mov(tmp, L1); | |
880 __ mov(tmp2, L2); | |
881 | |
882 __ call_VM_leaf(L7_thread_cache, | |
883 CAST_FROM_FN_PTR(address, | |
884 SATBMarkQueueSet::handle_zero_index_for_thread), | |
885 G2_thread); | |
886 | |
887 __ mov(L0, pre_val); | |
888 __ mov(L1, tmp); | |
889 __ mov(L2, tmp2); | |
890 | |
891 __ br(Assembler::always, /*annul*/false, Assembler::pt, restart); | |
892 __ delayed()->restore(); | |
893 } | |
894 break; | |
895 | |
896 case g1_post_barrier_slow_id: | |
897 { | |
898 BarrierSet* bs = Universe::heap()->barrier_set(); | |
899 if (bs->kind() != BarrierSet::G1SATBCTLogging) { | |
900 __ save_frame(0); | |
901 __ set((int)id, O1); | |
902 __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0); | |
903 __ should_not_reach_here(); | |
904 break; | |
905 } | |
906 | |
907 __ set_info("g1_post_barrier_slow_id", dont_gc_arguments); | |
908 | |
909 Register addr = G4; | |
910 Register cardtable = G5; | |
911 Register tmp = G1_scratch; | |
912 Register tmp2 = G3_scratch; | |
913 jbyte* byte_map_base = ((CardTableModRefBS*)bs)->byte_map_base; | |
914 | |
915 Label not_already_dirty, restart, refill; | |
916 | |
917 #ifdef _LP64 | |
918 __ srlx(addr, CardTableModRefBS::card_shift, addr); | |
919 #else | |
920 __ srl(addr, CardTableModRefBS::card_shift, addr); | |
921 #endif | |
922 | |
727 | 923 AddressLiteral rs(byte_map_base); |
924 __ set(rs, cardtable); // cardtable := <card table base> | |
342 | 925 __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable] |
926 | |
3888
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
927 assert(CardTableModRefBS::dirty_card_val() == 0, "otherwise check this code"); |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
928 __ cmp_and_br_short(tmp, G0, Assembler::notEqual, Assembler::pt, not_already_dirty); |
342 | 929 |
930 // We didn't take the branch, so we're already dirty: return. | |
931 // Use return-from-leaf | |
932 __ retl(); | |
933 __ delayed()->nop(); | |
934 | |
935 // Not dirty. | |
936 __ bind(not_already_dirty); | |
3888
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
937 |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
938 // Get cardtable + tmp into a reg by itself |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
939 __ add(addr, cardtable, tmp2); |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
940 |
342 | 941 // First, dirty it. |
942 __ stb(G0, tmp2, 0); // [cardPtr] := 0 (i.e., dirty). | |
943 | |
944 Register tmp3 = cardtable; | |
945 Register tmp4 = tmp; | |
946 | |
947 // these registers are now dead | |
948 addr = cardtable = tmp = noreg; | |
949 | |
950 int dirty_card_q_index_byte_offset = | |
951 in_bytes(JavaThread::dirty_card_queue_offset() + | |
952 PtrQueue::byte_offset_of_index()); | |
953 int dirty_card_q_buf_byte_offset = | |
954 in_bytes(JavaThread::dirty_card_queue_offset() + | |
955 PtrQueue::byte_offset_of_buf()); | |
3888
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
956 |
342 | 957 __ bind(restart); |
3888
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
958 |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
959 // Get the index into the update buffer. PtrQueue::_index is |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
960 // a size_t so ld_ptr is appropriate here. |
342 | 961 __ ld_ptr(G2_thread, dirty_card_q_index_byte_offset, tmp3); |
962 | |
3888
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
963 // index == 0? |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
964 __ cmp_and_brx_short(tmp3, G0, Assembler::equal, Assembler::pn, refill); |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
965 |
4fe626cbf0bf
7066841: remove MacroAssembler::br_on_reg_cond() on sparc
johnc
parents:
3839
diff
changeset
|
966 __ ld_ptr(G2_thread, dirty_card_q_buf_byte_offset, tmp4); |
342 | 967 __ sub(tmp3, oopSize, tmp3); |
968 | |
969 __ st_ptr(tmp2, tmp4, tmp3); // [_buf + index] := <address_of_card> | |
970 // Use return-from-leaf | |
971 __ retl(); | |
972 __ delayed()->st_ptr(tmp3, G2_thread, dirty_card_q_index_byte_offset); | |
973 | |
974 __ bind(refill); | |
975 __ save_frame(0); | |
976 | |
977 __ mov(tmp2, L0); | |
978 __ mov(tmp3, L1); | |
979 __ mov(tmp4, L2); | |
980 | |
981 __ call_VM_leaf(L7_thread_cache, | |
982 CAST_FROM_FN_PTR(address, | |
983 DirtyCardQueueSet::handle_zero_index_for_thread), | |
984 G2_thread); | |
985 | |
986 __ mov(L0, tmp2); | |
987 __ mov(L1, tmp3); | |
988 __ mov(L2, tmp4); | |
989 | |
990 __ br(Assembler::always, /*annul*/false, Assembler::pt, restart); | |
991 __ delayed()->restore(); | |
992 } | |
993 break; | |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6725
diff
changeset
|
994 #endif // INCLUDE_ALL_GCS |
342 | 995 |
8860 | 996 case predicate_failed_trap_id: |
997 { | |
998 __ set_info("predicate_failed_trap", dont_gc_arguments); | |
999 OopMap* oop_map = save_live_registers(sasm); | |
1000 | |
1001 int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, predicate_failed_trap)); | |
1002 | |
1003 oop_maps = new OopMapSet(); | |
1004 oop_maps->add_gc_map(call_offset, oop_map); | |
1005 | |
1006 DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob(); | |
1007 assert(deopt_blob != NULL, "deoptimization blob must have been created"); | |
1008 restore_live_registers(sasm); | |
9155
bb4a966cc68f
8011582: assert(nbits == 32 || (-(1 << nbits-1) <= x && x < ( 1 << nbits-1))) failed: value out of range
roland
parents:
8860
diff
changeset
|
1009 |
bb4a966cc68f
8011582: assert(nbits == 32 || (-(1 << nbits-1) <= x && x < ( 1 << nbits-1))) failed: value out of range
roland
parents:
8860
diff
changeset
|
1010 AddressLiteral dest(deopt_blob->unpack_with_reexecution()); |
bb4a966cc68f
8011582: assert(nbits == 32 || (-(1 << nbits-1) <= x && x < ( 1 << nbits-1))) failed: value out of range
roland
parents:
8860
diff
changeset
|
1011 __ jump_to(dest, O0); |
bb4a966cc68f
8011582: assert(nbits == 32 || (-(1 << nbits-1) <= x && x < ( 1 << nbits-1))) failed: value out of range
roland
parents:
8860
diff
changeset
|
1012 __ delayed()->restore(); |
8860 | 1013 } |
1014 break; | |
1015 | |
0 | 1016 default: |
1017 { __ set_info("unimplemented entry", dont_gc_arguments); | |
1018 __ save_frame(0); | |
1019 __ set((int)id, O1); | |
1020 __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), O1); | |
1021 __ should_not_reach_here(); | |
1022 } | |
1023 break; | |
1024 } | |
1025 return oop_maps; | |
1026 } | |
1027 | |
1028 | |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1029 OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1030 __ block_comment("generate_handle_exception"); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1031 |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1032 // Save registers, if required. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1033 OopMapSet* oop_maps = new OopMapSet(); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1034 OopMap* oop_map = NULL; |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1035 switch (id) { |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1036 case forward_exception_id: |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1037 // We're handling an exception in the context of a compiled frame. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1038 // The registers have been saved in the standard places. Perform |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1039 // an exception lookup in the caller and dispatch to the handler |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1040 // if found. Otherwise unwind and dispatch to the callers |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1041 // exception handler. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1042 oop_map = generate_oop_map(sasm, true); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1043 |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1044 // transfer the pending exception to the exception_oop |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1045 __ ld_ptr(G2_thread, in_bytes(JavaThread::pending_exception_offset()), Oexception); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1046 __ ld_ptr(Oexception, 0, G0); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1047 __ st_ptr(G0, G2_thread, in_bytes(JavaThread::pending_exception_offset())); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1048 __ add(I7, frame::pc_return_offset, Oissuing_pc); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1049 break; |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1050 case handle_exception_id: |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1051 // At this point all registers MAY be live. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1052 oop_map = save_live_registers(sasm); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1053 __ mov(Oexception->after_save(), Oexception); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1054 __ mov(Oissuing_pc->after_save(), Oissuing_pc); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1055 break; |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1056 case handle_exception_from_callee_id: |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1057 // At this point all registers except exception oop (Oexception) |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1058 // and exception pc (Oissuing_pc) are dead. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1059 oop_map = new OopMap(frame_size_in_bytes / sizeof(jint), 0); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1060 sasm->set_frame_size(frame_size_in_bytes / BytesPerWord); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1061 __ save_frame_c1(frame_size_in_bytes); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1062 __ mov(Oexception->after_save(), Oexception); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1063 __ mov(Oissuing_pc->after_save(), Oissuing_pc); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1064 break; |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1065 default: ShouldNotReachHere(); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1066 } |
0 | 1067 |
1068 __ verify_not_null_oop(Oexception); | |
1069 | |
1070 // save the exception and issuing pc in the thread | |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1071 __ st_ptr(Oexception, G2_thread, in_bytes(JavaThread::exception_oop_offset())); |
0 | 1072 __ st_ptr(Oissuing_pc, G2_thread, in_bytes(JavaThread::exception_pc_offset())); |
1073 | |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1074 // use the throwing pc as the return address to lookup (has bci & oop map) |
0 | 1075 __ mov(Oissuing_pc, I7); |
1076 __ sub(I7, frame::pc_return_offset, I7); | |
1077 int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, exception_handler_for_pc)); | |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1078 oop_maps->add_gc_map(call_offset, oop_map); |
0 | 1079 |
1080 // Note: if nmethod has been deoptimized then regardless of | |
1081 // whether it had a handler or not we will deoptimize | |
1082 // by entering the deopt blob with a pending exception. | |
1083 | |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1084 // Restore the registers that were saved at the beginning, remove |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1085 // the frame and jump to the exception handler. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1086 switch (id) { |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1087 case forward_exception_id: |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1088 case handle_exception_id: |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1089 restore_live_registers(sasm); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1090 __ jmp(O0, 0); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1091 __ delayed()->restore(); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1092 break; |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1093 case handle_exception_from_callee_id: |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1094 // Restore SP from L7 if the exception PC is a method handle call site. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1095 __ mov(O0, G5); // Save the target address. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1096 __ lduw(Address(G2_thread, JavaThread::is_method_handle_return_offset()), L0); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1097 __ tst(L0); // Condition codes are preserved over the restore. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1098 __ restore(); |
0 | 1099 |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1100 __ jmp(G5, 0); // jump to the exception handler |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1101 __ delayed()->movcc(Assembler::notZero, false, Assembler::icc, L7_mh_SP_save, SP); // Restore SP if required. |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1102 break; |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1103 default: ShouldNotReachHere(); |
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1104 } |
0 | 1105 |
2321
1b4e6a5d98e0
7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
twisti
parents:
2170
diff
changeset
|
1106 return oop_maps; |
0 | 1107 } |
1108 | |
1109 | |
1110 #undef __ | |
1111 | |
1681
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1579
diff
changeset
|
1112 const char *Runtime1::pd_name_for_address(address entry) { |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1579
diff
changeset
|
1113 return "<unknown function>"; |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1579
diff
changeset
|
1114 } |