489 490 #ifdef ASSERT 491 Label stack_base_okay, stack_size_okay; 492 // verify that thread stack base is non-zero 493 __ cmpptr(stack_base, (int32_t)NULL_WORD); 494 __ jcc(Assembler::notEqual, stack_base_okay); 495 __ stop("stack base is zero"); 496 __ bind(stack_base_okay); 497 // verify that thread stack size is non-zero 498 __ cmpptr(stack_size, 0); 499 __ jcc(Assembler::notEqual, stack_size_okay); 500 __ stop("stack size is zero"); 501 __ bind(stack_size_okay); 502 #endif 503 504 // Add stack base to locals and subtract stack size 505 __ addptr(rax, stack_base); 506 __ subptr(rax, stack_size); 507 508 // Use the maximum number of pages we might bang. 509 const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages : 510 (StackRedPages+StackYellowPages); 511 __ addptr(rax, max_pages * page_size); 512 513 // check against the current stack bottom 514 __ cmpptr(rsp, rax); 515 __ jcc(Assembler::above, after_frame_check_pop); 516 517 __ pop(rsi); // get saved bcp / (c++ prev state ). 518 519 // Restore sender's sp as SP. This is necessary if the sender's 520 // frame is an extended compiled frame (see gen_c2i_adapter()) 521 // and safer anyway in case of JSR292 adaptations. 522 523 __ pop(rax); // return address must be moved if SP is changed 524 __ mov(rsp, rsi); 525 __ push(rax); 526 527 // Note: the restored frame is not necessarily interpreted. 528 // Use the shared runtime version of the StackOverflowError. 529 assert(StubRoutines::throw_StackOverflowError_entry() != NULL, "stub not yet generated"); 530 __ jump(ExternalAddress(StubRoutines::throw_StackOverflowError_entry())); | 489 490 #ifdef ASSERT 491 Label stack_base_okay, stack_size_okay; 492 // verify that thread stack base is non-zero 493 __ cmpptr(stack_base, (int32_t)NULL_WORD); 494 __ jcc(Assembler::notEqual, stack_base_okay); 495 __ stop("stack base is zero"); 496 __ bind(stack_base_okay); 497 // verify that thread stack size is non-zero 498 __ cmpptr(stack_size, 0); 499 __ jcc(Assembler::notEqual, stack_size_okay); 500 __ stop("stack size is zero"); 501 __ bind(stack_size_okay); 502 #endif 503 504 // Add stack base to locals and subtract stack size 505 __ addptr(rax, stack_base); 506 __ subptr(rax, stack_size); 507 508 // Use the maximum number of pages we might bang. 509 const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages+StackReservedPages) ? StackShadowPages : 510 (StackRedPages+StackYellowPages+StackReservedPages); 511 __ addptr(rax, max_pages * page_size); 512 513 // check against the current stack bottom 514 __ cmpptr(rsp, rax); 515 __ jcc(Assembler::above, after_frame_check_pop); 516 517 __ pop(rsi); // get saved bcp / (c++ prev state ). 518 519 // Restore sender's sp as SP. This is necessary if the sender's 520 // frame is an extended compiled frame (see gen_c2i_adapter()) 521 // and safer anyway in case of JSR292 adaptations. 522 523 __ pop(rax); // return address must be moved if SP is changed 524 __ mov(rsp, rsi); 525 __ push(rax); 526 527 // Note: the restored frame is not necessarily interpreted. 528 // Use the shared runtime version of the StackOverflowError. 529 assert(StubRoutines::throw_StackOverflowError_entry() != NULL, "stub not yet generated"); 530 __ jump(ExternalAddress(StubRoutines::throw_StackOverflowError_entry())); |