src/cpu/x86/vm/templateTable_x86.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/cpu/x86/vm

src/cpu/x86/vm/templateTable_x86.cpp

Print this page




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 #if INCLUDE_JVMCI
3599   __ profile_called_method(method, rdx, rbcp);
3600 #endif
3601 
3602   __ profile_arguments_type(rdx, method, rbcp, true);
3603   __ jump_from_interpreted(method, rdx);
3604 }
3605 
3606 void TemplateTable::invokevirtual(int byte_no) {
3607   transition(vtos, vtos);
3608   assert(byte_no == f2_byte, "use this argument");
3609   prepare_invoke(byte_no,
3610                  rbx,    // method or vtable index
3611                  noreg,  // unused itable index
3612                  rcx, rdx); // recv, flags
3613 
3614   // rbx: index
3615   // rcx: receiver
3616   // rdx: flags
3617 
3618   invokevirtual_helper(rbx, rcx, rdx);
3619 }
3620 
3621 void TemplateTable::invokespecial(int byte_no) {


3681   // profile this call
3682   __ profile_virtual_call(rdx, rbcp, rlocals);
3683 
3684   Label no_such_interface, no_such_method;
3685 
3686   __ lookup_interface_method(// inputs: rec. class, interface, itable index
3687                              rdx, rax, rbx,
3688                              // outputs: method, scan temp. reg
3689                              rbx, rbcp,
3690                              no_such_interface);
3691 
3692   // rbx: Method* to call
3693   // rcx: receiver
3694   // Check for abstract method error
3695   // Note: This should be done more efficiently via a throw_abstract_method_error
3696   //       interpreter entry point and a conditional jump to it in case of a null
3697   //       method.
3698   __ testptr(rbx, rbx);
3699   __ jcc(Assembler::zero, no_such_method);
3700 
3701 #if INCLUDE_JVMCI
3702   __ profile_called_method(rbx, rbcp, rdx);
3703 #endif
3704   __ profile_arguments_type(rdx, rbx, rbcp, true);
3705 
3706   // do the call
3707   // rcx: receiver
3708   // rbx,: Method*
3709   __ jump_from_interpreted(rbx, rdx);
3710   __ should_not_reach_here();
3711 
3712   // exception handling code follows...
3713   // note: must restore interpreter registers to canonical
3714   //       state for exception handling to work correctly!
3715 
3716   __ bind(no_such_method);
3717   // throw exception
3718   __ pop(rbx);           // pop return address (pushed by prepare_invoke)
3719   __ restore_bcp();      // rbcp must be correct for exception handler   (was destroyed)
3720   __ restore_locals();   // make sure locals pointer is correct as well (was destroyed)
3721   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
3722   // the call_VM checks for exception, so we should never return here.
3723   __ should_not_reach_here();


src/cpu/x86/vm/templateTable_x86.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File