465 |
465 |
466 // check against the current stack bottom |
466 // check against the current stack bottom |
467 __ cmpptr(rsp, rax); |
467 __ cmpptr(rsp, rax); |
468 __ jcc(Assembler::above, after_frame_check); |
468 __ jcc(Assembler::above, after_frame_check); |
469 |
469 |
470 __ pop(rax); // get return address |
470 // Restore sender's sp as SP. This is necessary if the sender's |
471 __ jump(ExternalAddress(Interpreter::throw_StackOverflowError_entry())); |
471 // frame is an extended compiled frame (see gen_c2i_adapter()) |
|
472 // and safer anyway in case of JSR292 adaptations. |
|
473 |
|
474 __ pop(rax); // return address must be moved if SP is changed |
|
475 __ mov(rsp, r13); |
|
476 __ push(rax); |
|
477 |
|
478 // Note: the restored frame is not necessarily interpreted. |
|
479 // Use the shared runtime version of the StackOverflowError. |
|
480 assert(StubRoutines::throw_StackOverflowError_entry() != NULL, "stub not yet generated"); |
|
481 __ jump(ExternalAddress(StubRoutines::throw_StackOverflowError_entry())); |
472 |
482 |
473 // all done with frame size check |
483 // all done with frame size check |
474 __ bind(after_frame_check); |
484 __ bind(after_frame_check); |
475 } |
485 } |
476 |
486 |