3568 generate_vtable_call(Rrecv_klass, Rmethod, Rret, Rscratch); 3569 } 3570 3571 void TemplateTable::invokeinterface(int byte_no) { 3572 assert(byte_no == f1_byte, "use this argument"); 3573 transition(vtos, vtos); 3574 3575 const Register Rscratch1 = R11_scratch1, 3576 Rscratch2 = R12_scratch2, 3577 Rmethod = R6_ARG4, 3578 Rmethod2 = R9_ARG7, 3579 Rinterface_klass = R5_ARG3, 3580 Rret_addr = R8_ARG6, 3581 Rindex = R10_ARG8, 3582 Rreceiver = R3_ARG1, 3583 Rrecv_klass = R4_ARG2, 3584 Rflags = R7_ARG5; 3585 3586 prepare_invoke(byte_no, Rinterface_klass, Rret_addr, Rmethod, Rreceiver, Rflags, Rscratch1); 3587 3588 // Check for private method invocation - indicated by vfinal 3589 Label LnotVFinal; 3590 3591 __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_vfinal_shift); 3592 __ bfalse(CCR0, LnotVFinal); 3593 3594 __ null_check_throw(Rreceiver, -1, Rscratch3); 3595 3596 Register Rscratch = Rflags; // Rflags is dead now. 3597 3598 __ profile_final_call(Rscratch1, Rscratch); 3599 __ profile_arguments_type(Rindex, Rscratch, Rrecv_klass /* scratch */, true); 3600 3601 __ call_from_interpreter(Rindex, Rret_addr, Rscratch, Rrecv_klass /* scratch */); 3602 3603 __ bind(LnotVFinal); 3604 3605 // Get receiver klass. 3606 __ null_check_throw(Rreceiver, oopDesc::klass_offset_in_bytes(), Rscratch2); 3607 __ load_klass(Rrecv_klass, Rreceiver); 3608 3609 // Check corner case object method. 3610 Label LobjectMethod, L_no_such_interface, Lthrow_ame; 3611 __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_forced_virtual_shift); 3612 __ btrue(CCR0, LobjectMethod); 3613 3614 __ lookup_interface_method(Rrecv_klass, Rinterface_klass, noreg, noreg, Rscratch1, Rscratch2, 3615 L_no_such_interface, /*return_method=*/false); 3616 3617 __ profile_virtual_call(Rrecv_klass, Rscratch1, Rscratch2, false); 3618 3619 // Find entry point to call. 3620 3621 // Get declaring interface class from method 3622 __ ld(Rinterface_klass, in_bytes(Method::const_offset()), Rmethod); 3623 __ ld(Rinterface_klass, in_bytes(ConstMethod::constants_offset()), Rinterface_klass); 3624 __ ld(Rinterface_klass, ConstantPool::pool_holder_offset_in_bytes(), Rinterface_klass); 3625 3626 // Get itable index from method 3627 __ lwa(Rindex, in_bytes(Method::itable_index_offset()), Rmethod); 3628 __ subfic(Rindex, Rindex, Method::itable_index_max); 3629 3630 __ lookup_interface_method(Rrecv_klass, Rinterface_klass, Rindex, Rmethod2, Rscratch1, Rscratch2, | 3568 generate_vtable_call(Rrecv_klass, Rmethod, Rret, Rscratch); 3569 } 3570 3571 void TemplateTable::invokeinterface(int byte_no) { 3572 assert(byte_no == f1_byte, "use this argument"); 3573 transition(vtos, vtos); 3574 3575 const Register Rscratch1 = R11_scratch1, 3576 Rscratch2 = R12_scratch2, 3577 Rmethod = R6_ARG4, 3578 Rmethod2 = R9_ARG7, 3579 Rinterface_klass = R5_ARG3, 3580 Rret_addr = R8_ARG6, 3581 Rindex = R10_ARG8, 3582 Rreceiver = R3_ARG1, 3583 Rrecv_klass = R4_ARG2, 3584 Rflags = R7_ARG5; 3585 3586 prepare_invoke(byte_no, Rinterface_klass, Rret_addr, Rmethod, Rreceiver, Rflags, Rscratch1); 3587 3588 // Get receiver klass - this is also a null check 3589 __ null_check_throw(Rreceiver, oopDesc::klass_offset_in_bytes(), Rscratch2); 3590 __ load_klass(Rrecv_klass, Rreceiver); 3591 3592 // Check for private method invocation - indicated by vfinal 3593 Label LnotVFinal, L_no_such_interface, L_subtype; 3594 3595 __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_vfinal_shift); 3596 __ bfalse(CCR0, LnotVFinal); 3597 3598 __ check_klass_subtype(Rrecv_klass, Rinterface_klass, Rscratch, Rscratch1, subtype); 3599 // If we get here the typecheck failed 3600 __ b(L_no_such_interface); 3601 __ bind(subtype); 3602 3603 // do the call 3604 3605 Register Rscratch = Rflags; // Rflags is dead now. 3606 3607 __ profile_final_call(Rscratch1, Rscratch); 3608 __ profile_arguments_type(Rindex, Rscratch, Rrecv_klass /* scratch */, true); 3609 3610 __ call_from_interpreter(Rindex, Rret_addr, Rscratch, Rrecv_klass /* scratch */); 3611 3612 __ bind(LnotVFinal); 3613 3614 // Check corner case object method. 3615 Label LobjectMethod, Lthrow_ame; 3616 __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_forced_virtual_shift); 3617 __ btrue(CCR0, LobjectMethod); 3618 3619 __ lookup_interface_method(Rrecv_klass, Rinterface_klass, noreg, noreg, Rscratch1, Rscratch2, 3620 L_no_such_interface, /*return_method=*/false); 3621 3622 __ profile_virtual_call(Rrecv_klass, Rscratch1, Rscratch2, false); 3623 3624 // Find entry point to call. 3625 3626 // Get declaring interface class from method 3627 __ ld(Rinterface_klass, in_bytes(Method::const_offset()), Rmethod); 3628 __ ld(Rinterface_klass, in_bytes(ConstMethod::constants_offset()), Rinterface_klass); 3629 __ ld(Rinterface_klass, ConstantPool::pool_holder_offset_in_bytes(), Rinterface_klass); 3630 3631 // Get itable index from method 3632 __ lwa(Rindex, in_bytes(Method::itable_index_offset()), Rmethod); 3633 __ subfic(Rindex, Rindex, Method::itable_index_max); 3634 3635 __ lookup_interface_method(Rrecv_klass, Rinterface_klass, Rindex, Rmethod2, Rscratch1, Rscratch2, |