comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 4743:dca455dea3a7

7116216: StackOverflow GC crash Summary: GC crash for explicit stack overflow checks after a C2I transition. Reviewed-by: coleenp, never Contributed-by: yang02.wang@sap.com, bertrand.delsart@oracle.com
author bdelsart
date Tue, 20 Dec 2011 12:33:05 +0100
parents b20d64f83668
children 22cee0ee8927
comparison
equal deleted inserted replaced
4742:8fdf463085e1 4743:dca455dea3a7
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