3578
3579 // It's final, need a null check here!
3580 __ null_check(recv);
3581
3582 // profile this call
3583 __ profile_final_call(rax);
3584 __ profile_arguments_type(rax, method, rbcp, true);
3585
3586 __ jump_from_interpreted(method, rax);
3587
3588 __ bind(notFinal);
3589
3590 // get receiver klass
3591 __ null_check(recv, oopDesc::klass_offset_in_bytes());
3592 __ load_klass(rax, recv);
3593
3594 // profile this call
3595 __ profile_virtual_call(rax, rlocals, rdx);
3596 // get target Method* & entry point
3597 __ lookup_virtual_method(rax, index, method);
3598 __ profile_arguments_type(rdx, method, rbcp, true);
3599 __ jump_from_interpreted(method, rdx);
3600 }
3601
3602 void TemplateTable::invokevirtual(int byte_no) {
3603 transition(vtos, vtos);
3604 assert(byte_no == f2_byte, "use this argument");
3605 prepare_invoke(byte_no,
3606 rbx, // method or vtable index
3607 noreg, // unused itable index
3608 rcx, rdx); // recv, flags
3609
3610 // rbx: index
3611 // rcx: receiver
3612 // rdx: flags
3613
3614 invokevirtual_helper(rbx, rcx, rdx);
3615 }
3616
3617 void TemplateTable::invokespecial(int byte_no) {
3677 // profile this call
3678 __ profile_virtual_call(rdx, rbcp, rlocals);
3679
3680 Label no_such_interface, no_such_method;
3681
3682 __ lookup_interface_method(// inputs: rec. class, interface, itable index
3683 rdx, rax, rbx,
3684 // outputs: method, scan temp. reg
3685 rbx, rbcp,
3686 no_such_interface);
3687
3688 // rbx: Method* to call
3689 // rcx: receiver
3690 // Check for abstract method error
3691 // Note: This should be done more efficiently via a throw_abstract_method_error
3692 // interpreter entry point and a conditional jump to it in case of a null
3693 // method.
3694 __ testptr(rbx, rbx);
3695 __ jcc(Assembler::zero, no_such_method);
3696
3697 __ profile_arguments_type(rdx, rbx, rbcp, true);
3698
3699 // do the call
3700 // rcx: receiver
3701 // rbx,: Method*
3702 __ jump_from_interpreted(rbx, rdx);
3703 __ should_not_reach_here();
3704
3705 // exception handling code follows...
3706 // note: must restore interpreter registers to canonical
3707 // state for exception handling to work correctly!
3708
3709 __ bind(no_such_method);
3710 // throw exception
3711 __ pop(rbx); // pop return address (pushed by prepare_invoke)
3712 __ restore_bcp(); // rbcp must be correct for exception handler (was destroyed)
3713 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
3714 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
3715 // the call_VM checks for exception, so we should never return here.
3716 __ should_not_reach_here();
|
3578
3579 // It's final, need a null check here!
3580 __ null_check(recv);
3581
3582 // profile this call
3583 __ profile_final_call(rax);
3584 __ profile_arguments_type(rax, method, rbcp, true);
3585
3586 __ jump_from_interpreted(method, rax);
3587
3588 __ bind(notFinal);
3589
3590 // get receiver klass
3591 __ null_check(recv, oopDesc::klass_offset_in_bytes());
3592 __ load_klass(rax, recv);
3593
3594 // profile this call
3595 __ profile_virtual_call(rax, rlocals, rdx);
3596 // get target Method* & entry point
3597 __ lookup_virtual_method(rax, index, method);
3598 __ profile_called_method(method, rdx, rbcp);
3599
3600 __ profile_arguments_type(rdx, method, rbcp, true);
3601 __ jump_from_interpreted(method, rdx);
3602 }
3603
3604 void TemplateTable::invokevirtual(int byte_no) {
3605 transition(vtos, vtos);
3606 assert(byte_no == f2_byte, "use this argument");
3607 prepare_invoke(byte_no,
3608 rbx, // method or vtable index
3609 noreg, // unused itable index
3610 rcx, rdx); // recv, flags
3611
3612 // rbx: index
3613 // rcx: receiver
3614 // rdx: flags
3615
3616 invokevirtual_helper(rbx, rcx, rdx);
3617 }
3618
3619 void TemplateTable::invokespecial(int byte_no) {
3679 // profile this call
3680 __ profile_virtual_call(rdx, rbcp, rlocals);
3681
3682 Label no_such_interface, no_such_method;
3683
3684 __ lookup_interface_method(// inputs: rec. class, interface, itable index
3685 rdx, rax, rbx,
3686 // outputs: method, scan temp. reg
3687 rbx, rbcp,
3688 no_such_interface);
3689
3690 // rbx: Method* to call
3691 // rcx: receiver
3692 // Check for abstract method error
3693 // Note: This should be done more efficiently via a throw_abstract_method_error
3694 // interpreter entry point and a conditional jump to it in case of a null
3695 // method.
3696 __ testptr(rbx, rbx);
3697 __ jcc(Assembler::zero, no_such_method);
3698
3699 __ profile_called_method(rbx, rbcp, rdx);
3700 __ profile_arguments_type(rdx, rbx, rbcp, true);
3701
3702 // do the call
3703 // rcx: receiver
3704 // rbx,: Method*
3705 __ jump_from_interpreted(rbx, rdx);
3706 __ should_not_reach_here();
3707
3708 // exception handling code follows...
3709 // note: must restore interpreter registers to canonical
3710 // state for exception handling to work correctly!
3711
3712 __ bind(no_such_method);
3713 // throw exception
3714 __ pop(rbx); // pop return address (pushed by prepare_invoke)
3715 __ restore_bcp(); // rbcp must be correct for exception handler (was destroyed)
3716 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
3717 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
3718 // the call_VM checks for exception, so we should never return here.
3719 __ should_not_reach_here();
|