244
245 // Set R15_prev_state to 0 for simplifying checks in callee.
246 #ifdef CC_INTERP
247 __ li(R15_prev_state, 0);
248 #else
249 __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
250 #endif
251 // Stack on entry to frame manager / native entry:
252 //
253 // F0 [TOP_IJAVA_FRAME_ABI]
254 // alignment (optional)
255 // [outgoing Java arguments]
256 // [ENTRY_FRAME_LOCALS]
257 // F1 [C_FRAME]
258 // ...
259 //
260
261 // global toc register
262 __ load_const(R29, MacroAssembler::global_toc(), R11_scratch1);
263
264 // Load narrow oop base.
265 __ reinit_heapbase(R30, R11_scratch1);
266
267 // Remember the senderSP so we interpreter can pop c2i arguments off of the stack
268 // when called via a c2i.
269
270 // Pass initial_caller_sp to framemanager.
271 __ mr(R21_tmp1, R1_SP);
272
273 // Do a light-weight C-call here, r_new_arg_entry holds the address
274 // of the interpreter entry point (frame manager or native entry)
275 // and save runtime-value of LR in return_address.
276 assert(r_new_arg_entry != tos && r_new_arg_entry != R19_method && r_new_arg_entry != R16_thread,
277 "trashed r_new_arg_entry");
278 return_address = __ call_stub(r_new_arg_entry);
279 }
280
281 {
282 BLOCK_COMMENT("Returned from frame manager or native entry.");
283 // Returned from frame manager or native entry.
284 // Now pop frame, process result, and return to caller.
285
286 // Stack on exit from frame manager / native entry:
401 // store into `char *'
402 __ std(exception_file, in_bytes(JavaThread::exception_file_offset()), R16_thread);
403 // store into `int'
404 __ stw(exception_line, in_bytes(JavaThread::exception_line_offset()), R16_thread);
405
406 // complete return to VM
407 assert(StubRoutines::_call_stub_return_address != NULL, "must have been generated before");
408
409 __ mtlr(R4_ARG2);
410 // continue in call stub
411 __ blr();
412
413 return start;
414 }
415
416 // Continuation point for runtime calls returning with a pending
417 // exception. The pending exception check happened in the runtime
418 // or native call stub. The pending exception in Thread is
419 // converted into a Java-level exception.
420 //
421 address generate_forward_exception() {
422 StubCodeMark mark(this, "StubRoutines", "forward_exception");
423 address start = __ pc();
424
425 #if !defined(PRODUCT)
426 if (VerifyOops) {
427 // Get pending exception oop.
428 __ ld(R3_ARG1,
429 in_bytes(Thread::pending_exception_offset()),
430 R16_thread);
431 // Make sure that this code is only executed if there is a pending exception.
432 {
433 Label L;
434 __ cmpdi(CCR0, R3_ARG1, 0);
435 __ bne(CCR0, L);
436 __ stop("StubRoutines::forward exception: no pending exception (1)");
437 __ bind(L);
438 }
439 __ verify_oop(R3_ARG1, "StubRoutines::forward exception: not an oop");
440 }
|
244
245 // Set R15_prev_state to 0 for simplifying checks in callee.
246 #ifdef CC_INTERP
247 __ li(R15_prev_state, 0);
248 #else
249 __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
250 #endif
251 // Stack on entry to frame manager / native entry:
252 //
253 // F0 [TOP_IJAVA_FRAME_ABI]
254 // alignment (optional)
255 // [outgoing Java arguments]
256 // [ENTRY_FRAME_LOCALS]
257 // F1 [C_FRAME]
258 // ...
259 //
260
261 // global toc register
262 __ load_const(R29, MacroAssembler::global_toc(), R11_scratch1);
263
264 // Remember the senderSP so we interpreter can pop c2i arguments off of the stack
265 // when called via a c2i.
266
267 // Pass initial_caller_sp to framemanager.
268 __ mr(R21_tmp1, R1_SP);
269
270 // Do a light-weight C-call here, r_new_arg_entry holds the address
271 // of the interpreter entry point (frame manager or native entry)
272 // and save runtime-value of LR in return_address.
273 assert(r_new_arg_entry != tos && r_new_arg_entry != R19_method && r_new_arg_entry != R16_thread,
274 "trashed r_new_arg_entry");
275 return_address = __ call_stub(r_new_arg_entry);
276 }
277
278 {
279 BLOCK_COMMENT("Returned from frame manager or native entry.");
280 // Returned from frame manager or native entry.
281 // Now pop frame, process result, and return to caller.
282
283 // Stack on exit from frame manager / native entry:
398 // store into `char *'
399 __ std(exception_file, in_bytes(JavaThread::exception_file_offset()), R16_thread);
400 // store into `int'
401 __ stw(exception_line, in_bytes(JavaThread::exception_line_offset()), R16_thread);
402
403 // complete return to VM
404 assert(StubRoutines::_call_stub_return_address != NULL, "must have been generated before");
405
406 __ mtlr(R4_ARG2);
407 // continue in call stub
408 __ blr();
409
410 return start;
411 }
412
413 // Continuation point for runtime calls returning with a pending
414 // exception. The pending exception check happened in the runtime
415 // or native call stub. The pending exception in Thread is
416 // converted into a Java-level exception.
417 //
418 // Read:
419 //
420 // LR: The pc the runtime library callee wants to return to.
421 // Since the exception occurred in the callee, the return pc
422 // from the point of view of Java is the exception pc.
423 // thread: Needed for method handles.
424 //
425 // Invalidate:
426 //
427 // volatile registers (except below).
428 //
429 // Update:
430 //
431 // R4_ARG2: exception
432 //
433 // (LR is unchanged and is live out).
434 //
435 address generate_forward_exception() {
436 StubCodeMark mark(this, "StubRoutines", "forward_exception");
437 address start = __ pc();
438
439 #if !defined(PRODUCT)
440 if (VerifyOops) {
441 // Get pending exception oop.
442 __ ld(R3_ARG1,
443 in_bytes(Thread::pending_exception_offset()),
444 R16_thread);
445 // Make sure that this code is only executed if there is a pending exception.
446 {
447 Label L;
448 __ cmpdi(CCR0, R3_ARG1, 0);
449 __ bne(CCR0, L);
450 __ stop("StubRoutines::forward exception: no pending exception (1)");
451 __ bind(L);
452 }
453 __ verify_oop(R3_ARG1, "StubRoutines::forward exception: not an oop");
454 }
|