609 void Runtime1::initialize_pd() { |
609 void Runtime1::initialize_pd() { |
610 // nothing to do |
610 // nothing to do |
611 } |
611 } |
612 |
612 |
613 |
613 |
614 // target: the entry point of the method that creates and posts the exception oop |
614 // Target: the entry point of the method that creates and posts the exception oop. |
615 // has_argument: true if the exception needs an argument (passed on stack because registers must be preserved) |
615 // has_argument: true if the exception needs arguments (passed on the stack because |
616 |
616 // registers must be preserved). |
617 OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) { |
617 OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) { |
618 // preserve all registers |
618 // Preserve all registers. |
619 int num_rt_args = has_argument ? 2 : 1; |
619 int num_rt_args = has_argument ? (2 + 1) : 1; |
620 OopMap* oop_map = save_live_registers(sasm, num_rt_args); |
620 OopMap* oop_map = save_live_registers(sasm, num_rt_args); |
621 |
621 |
622 // now all registers are saved and can be used freely |
622 // Now all registers are saved and can be used freely. |
623 // verify that no old value is used accidentally |
623 // Verify that no old value is used accidentally. |
624 __ invalidate_registers(true, true, true, true, true, true); |
624 __ invalidate_registers(true, true, true, true, true, true); |
625 |
625 |
626 // registers used by this stub |
626 // Registers used by this stub. |
627 const Register temp_reg = rbx; |
627 const Register temp_reg = rbx; |
628 |
628 |
629 // load argument for exception that is passed as an argument into the stub |
629 // Load arguments for exception that are passed as arguments into the stub. |
630 if (has_argument) { |
630 if (has_argument) { |
631 #ifdef _LP64 |
631 #ifdef _LP64 |
632 __ movptr(c_rarg1, Address(rbp, 2*BytesPerWord)); |
632 __ movptr(c_rarg1, Address(rbp, 2*BytesPerWord)); |
|
633 __ movptr(c_rarg2, Address(rbp, 3*BytesPerWord)); |
633 #else |
634 #else |
|
635 __ movptr(temp_reg, Address(rbp, 3*BytesPerWord)); |
|
636 __ push(temp_reg); |
634 __ movptr(temp_reg, Address(rbp, 2*BytesPerWord)); |
637 __ movptr(temp_reg, Address(rbp, 2*BytesPerWord)); |
635 __ push(temp_reg); |
638 __ push(temp_reg); |
636 #endif // _LP64 |
639 #endif // _LP64 |
637 } |
640 } |
638 int call_offset = __ call_RT(noreg, noreg, target, num_rt_args - 1); |
641 int call_offset = __ call_RT(noreg, noreg, target, num_rt_args - 1); |