439 __ nop(); 440 441 // generate code for exception handler 442 address handler_base = __ start_a_stub(exception_handler_size); 443 if (handler_base == NULL) { 444 // not enough space left for the handler 445 bailout("exception handler overflow"); 446 return -1; 447 } 448 449 int offset = code_offset(); 450 451 // the exception oop and pc are in rax, and rdx 452 // no other registers need to be preserved, so invalidate them 453 __ invalidate_registers(false, true, true, false, true, true); 454 455 // check that there is really an exception 456 __ verify_not_null_oop(rax); 457 458 // search an exception handler (rax: exception oop, rdx: throwing pc) 459 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::handle_exception_nofpu_id))); 460 461 __ stop("should not reach here"); 462 463 assert(code_offset() - offset <= exception_handler_size, "overflow"); 464 __ end_a_stub(); 465 466 return offset; 467 } 468 469 470 // Emit the code to remove the frame from the stack in the exception 471 // unwind path. 472 int LIR_Assembler::emit_unwind_handler() { 473 #ifndef PRODUCT 474 if (CommentedAssembly) { 475 _masm->block_comment("Unwind handler"); 476 } 477 #endif 478 479 int offset = code_offset(); 480 481 // Fetch the exception from TLS and clear out exception related thread state 482 __ get_thread(rsi); | 439 __ nop(); 440 441 // generate code for exception handler 442 address handler_base = __ start_a_stub(exception_handler_size); 443 if (handler_base == NULL) { 444 // not enough space left for the handler 445 bailout("exception handler overflow"); 446 return -1; 447 } 448 449 int offset = code_offset(); 450 451 // the exception oop and pc are in rax, and rdx 452 // no other registers need to be preserved, so invalidate them 453 __ invalidate_registers(false, true, true, false, true, true); 454 455 // check that there is really an exception 456 __ verify_not_null_oop(rax); 457 458 // search an exception handler (rax: exception oop, rdx: throwing pc) 459 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::handle_exception_from_callee_id))); 460 __ should_not_reach_here(); 461 assert(code_offset() - offset <= exception_handler_size, "overflow"); 462 __ end_a_stub(); 463 464 return offset; 465 } 466 467 468 // Emit the code to remove the frame from the stack in the exception 469 // unwind path. 470 int LIR_Assembler::emit_unwind_handler() { 471 #ifndef PRODUCT 472 if (CommentedAssembly) { 473 _masm->block_comment("Unwind handler"); 474 } 475 #endif 476 477 int offset = code_offset(); 478 479 // Fetch the exception from TLS and clear out exception related thread state 480 __ get_thread(rsi); |