534 address TemplateInterpreterGenerator::generate_StackOverflowError_handler() {
535 address entry = __ pc();
536
537 DEBUG_ONLY(__ verify_esp(Z_esp, Z_ARG5));
538
539 // Restore bcp under the assumption that the current frame is still
540 // interpreted.
541 __ restore_bcp();
542
543 // Expression stack must be empty before entering the VM if an
544 // exception happened.
545 __ empty_expression_stack();
546 // Throw exception.
547 __ call_VM(noreg,
548 CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError));
549 return entry;
550 }
551
552 //
553 // Args:
554 // Z_ARG3: aberrant index
555 //
556 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler(const char * name) {
557 address entry = __ pc();
558 address excp = CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException);
559
560 // Expression stack must be empty before entering the VM if an
561 // exception happened.
562 __ empty_expression_stack();
563
564 // Setup parameters.
565 // Leave out the name and use register for array to create more detailed exceptions.
566 __ load_absolute_address(Z_ARG2, (address) name);
567 __ call_VM(noreg, excp, Z_ARG2, Z_ARG3);
568 return entry;
569 }
570
571 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
572 address entry = __ pc();
573
574 // Object is at TOS.
575 __ pop_ptr(Z_ARG2);
576
577 // Expression stack must be empty before entering the VM if an
578 // exception happened.
579 __ empty_expression_stack();
580
581 __ call_VM(Z_ARG1,
582 CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException),
583 Z_ARG2);
584
585 DEBUG_ONLY(__ should_not_reach_here();)
586
|
534 address TemplateInterpreterGenerator::generate_StackOverflowError_handler() {
535 address entry = __ pc();
536
537 DEBUG_ONLY(__ verify_esp(Z_esp, Z_ARG5));
538
539 // Restore bcp under the assumption that the current frame is still
540 // interpreted.
541 __ restore_bcp();
542
543 // Expression stack must be empty before entering the VM if an
544 // exception happened.
545 __ empty_expression_stack();
546 // Throw exception.
547 __ call_VM(noreg,
548 CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError));
549 return entry;
550 }
551
552 //
553 // Args:
554 // Z_ARG2: oop of array
555 // Z_ARG3: aberrant index
556 //
557 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler() {
558 address entry = __ pc();
559 address excp = CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException);
560
561 // Expression stack must be empty before entering the VM if an
562 // exception happened.
563 __ empty_expression_stack();
564
565 // Setup parameters.
566 // Pass register with array to create more detailed exceptions.
567 __ call_VM(noreg, excp, Z_ARG2, Z_ARG3);
568 return entry;
569 }
570
571 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
572 address entry = __ pc();
573
574 // Object is at TOS.
575 __ pop_ptr(Z_ARG2);
576
577 // Expression stack must be empty before entering the VM if an
578 // exception happened.
579 __ empty_expression_stack();
580
581 __ call_VM(Z_ARG1,
582 CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException),
583 Z_ARG2);
584
585 DEBUG_ONLY(__ should_not_reach_here();)
586
|