3601 } 3602 3603 void TemplateTable::invokeinterface(int byte_no) { 3604 transition(vtos, vtos); 3605 3606 assert(byte_no == f1_byte, "use this argument"); 3607 Register klass = Z_ARG2, 3608 method = Z_ARG3, 3609 interface = Z_ARG4, 3610 flags = Z_ARG5, 3611 receiver = Z_tmp_1; 3612 3613 BLOCK_COMMENT("invokeinterface {"); 3614 3615 prepare_invoke(byte_no, interface, method, // Get f1 klassOop, f2 Method*. 3616 receiver, flags); 3617 3618 // Z_R14 (== Z_bytecode) : return entry 3619 3620 // Check for private method invocation - indicated by vfinal 3621 Label notVFinal; 3622 __ testbit(flags, ConstantPoolCacheEntry::is_vfinal_shift); 3623 __ z_brz(notVFinal); 3624 3625 __ null_check(receiver); 3626 3627 __ profile_final_call(Z_tmp_2); 3628 __ profile_arguments_type(Z_tmp_2, method, Z_ARG5, true); 3629 __ jump_from_interpreted(method, Z_tmp_2); 3630 3631 __ bind(notVFinal); 3632 3633 // Special case of invokeinterface called for virtual method of 3634 // java.lang.Object. See cpCacheOop.cpp for details. 3635 // This code isn't produced by javac, but could be produced by 3636 // another compliant java compiler. 3637 NearLabel notMethod, no_such_interface, no_such_method; 3638 __ testbit(flags, ConstantPoolCacheEntry::is_forced_virtual_shift); 3639 __ z_brz(notMethod); 3640 invokevirtual_helper(method, receiver, flags); 3641 __ bind(notMethod); 3642 3643 // Get receiver klass into klass - also a null check. 3644 __ restore_locals(); 3645 __ load_klass(klass, receiver); 3646 3647 __ lookup_interface_method(klass, interface, noreg, noreg, /*temp*/Z_ARG1, 3648 no_such_interface, /*return_method=*/false); 3649 3650 // Profile this call. 3651 __ profile_virtual_call(klass, Z_ARG1/*mdp*/, flags/*scratch*/); 3652 3653 // Find entry point to call. 3654 3655 // Get declaring interface class from method 3656 __ z_lg(interface, Address(method, Method::const_offset())); 3657 __ z_lg(interface, Address(interface, ConstMethod::constants_offset())); | 3601 } 3602 3603 void TemplateTable::invokeinterface(int byte_no) { 3604 transition(vtos, vtos); 3605 3606 assert(byte_no == f1_byte, "use this argument"); 3607 Register klass = Z_ARG2, 3608 method = Z_ARG3, 3609 interface = Z_ARG4, 3610 flags = Z_ARG5, 3611 receiver = Z_tmp_1; 3612 3613 BLOCK_COMMENT("invokeinterface {"); 3614 3615 prepare_invoke(byte_no, interface, method, // Get f1 klassOop, f2 Method*. 3616 receiver, flags); 3617 3618 // Z_R14 (== Z_bytecode) : return entry 3619 3620 // Check for private method invocation - indicated by vfinal 3621 NearLabel notVFinal; 3622 __ testbit(flags, ConstantPoolCacheEntry::is_vfinal_shift); 3623 __ z_brz(notVFinal); 3624 3625 // Get receiver klass into klass - also a null check. 3626 __ load_klass(klass, receiver); 3627 3628 NearLabel subtype, no_such_interface; 3629 3630 __ check_klass_subtype(klass, interface, Z_tmp_2, Z_temp_3, subtype); 3631 // If we get here the typecheck failed 3632 __ z_bru(no_such_interface); 3633 __ bind(subtype); 3634 3635 // do the call 3636 3637 __ profile_final_call(Z_tmp_2); 3638 __ profile_arguments_type(Z_tmp_2, method, Z_ARG5, true); 3639 __ jump_from_interpreted(method, Z_tmp_2); 3640 3641 __ bind(notVFinal); 3642 3643 // Special case of invokeinterface called for virtual method of 3644 // java.lang.Object. See cpCacheOop.cpp for details. 3645 // This code isn't produced by javac, but could be produced by 3646 // another compliant java compiler. 3647 NearLabel notMethod, no_such_method; 3648 __ testbit(flags, ConstantPoolCacheEntry::is_forced_virtual_shift); 3649 __ z_brz(notMethod); 3650 invokevirtual_helper(method, receiver, flags); 3651 __ bind(notMethod); 3652 3653 // Get receiver klass into klass - also a null check. 3654 __ restore_locals(); 3655 __ load_klass(klass, receiver); 3656 3657 __ lookup_interface_method(klass, interface, noreg, noreg, /*temp*/Z_ARG1, 3658 no_such_interface, /*return_method=*/false); 3659 3660 // Profile this call. 3661 __ profile_virtual_call(klass, Z_ARG1/*mdp*/, flags/*scratch*/); 3662 3663 // Find entry point to call. 3664 3665 // Get declaring interface class from method 3666 __ z_lg(interface, Address(method, Method::const_offset())); 3667 __ z_lg(interface, Address(interface, ConstMethod::constants_offset())); |