3039 __ profile_virtual_call(RKlass, O4); 3040 generate_vtable_call(RKlass, Rindex, Rret); 3041 } 3042 3043 3044 void TemplateTable::invokeinterface(int byte_no) { 3045 transition(vtos, vtos); 3046 assert(byte_no == f1_byte, "use this argument"); 3047 3048 const Register Rinterface = G1_scratch; 3049 const Register Rmethod = Lscratch; 3050 const Register Rret = G3_scratch; 3051 const Register O0_recv = O0; 3052 const Register O1_flags = O1; 3053 const Register O2_Klass = O2; 3054 const Register Rscratch = G4_scratch; 3055 assert_different_registers(Rscratch, G5_method); 3056 3057 prepare_invoke(byte_no, Rinterface, Rret, Rmethod, O0_recv, O1_flags); 3058 3059 // Check for private method invocation - indicated by vfinal 3060 Label notVFinal; 3061 __ set((1 << ConstantPoolCacheEntry::is_vfinal_shift), Rscratch); 3062 __ btst(O1_flags, Rscratch); 3063 __ br(Assembler::zero, false, Assembler::pt, notVFinal); 3064 __ delayed()->nop(); 3065 3066 __ null_check(O0_recv); 3067 3068 { 3069 Register Rcall = Rinterface; 3070 __ mov(Rmethod, G5_method); 3071 assert_different_registers(Rcall, G5_method, Gargs, Rret); 3072 3073 __ profile_arguments_type(G5_method, Rcall, Gargs, true); 3074 __ profile_final_call(Rscratch); 3075 __ call_from_interpreter(Rcall, Gargs, Rret); 3076 } 3077 __ bind(notVFinal); 3078 3079 // get receiver klass 3080 __ null_check(O0_recv, oopDesc::klass_offset_in_bytes()); 3081 __ load_klass(O0_recv, O2_Klass); 3082 3083 // Special case of invokeinterface called for virtual method of 3084 // java.lang.Object. See cpCacheOop.cpp for details. 3085 // This code isn't produced by javac, but could be produced by 3086 // another compliant java compiler. 3087 Label notMethod; 3088 __ set((1 << ConstantPoolCacheEntry::is_forced_virtual_shift), Rscratch); 3089 __ btst(O1_flags, Rscratch); 3090 __ br(Assembler::zero, false, Assembler::pt, notMethod); 3091 __ delayed()->nop(); 3092 3093 invokeinterface_object_method(O2_Klass, Rinterface, Rret, O1_flags); 3094 3095 __ bind(notMethod); 3096 3097 Register Rtemp = O1_flags; 3098 3099 Label L_no_such_interface; 3100 3101 // Receiver subtype check against REFC. 3102 __ lookup_interface_method(// inputs: rec. class, interface, itable index 3103 O2_Klass, Rinterface, noreg, 3104 // outputs: temp reg1, temp reg2, temp reg3 3105 G5_method, Rscratch, Rtemp, 3106 L_no_such_interface, 3107 /*return_method=*/false); 3108 3109 __ profile_virtual_call(O2_Klass, O4); 3110 3111 // 3112 // find entry point to call 3113 // 3114 3115 // Get declaring interface class from method 3116 __ ld_ptr(Rmethod, Method::const_offset(), Rinterface); 3117 __ ld_ptr(Rinterface, ConstMethod::constants_offset(), Rinterface); 3118 __ ld_ptr(Rinterface, ConstantPool::pool_holder_offset_in_bytes(), Rinterface); 3119 | 3039 __ profile_virtual_call(RKlass, O4); 3040 generate_vtable_call(RKlass, Rindex, Rret); 3041 } 3042 3043 3044 void TemplateTable::invokeinterface(int byte_no) { 3045 transition(vtos, vtos); 3046 assert(byte_no == f1_byte, "use this argument"); 3047 3048 const Register Rinterface = G1_scratch; 3049 const Register Rmethod = Lscratch; 3050 const Register Rret = G3_scratch; 3051 const Register O0_recv = O0; 3052 const Register O1_flags = O1; 3053 const Register O2_Klass = O2; 3054 const Register Rscratch = G4_scratch; 3055 assert_different_registers(Rscratch, G5_method); 3056 3057 prepare_invoke(byte_no, Rinterface, Rret, Rmethod, O0_recv, O1_flags); 3058 3059 Label L_no_such_interface; 3060 3061 // Check for private method invocation - indicated by vfinal 3062 Label notVFinal; 3063 { 3064 __ set((1 << ConstantPoolCacheEntry::is_vfinal_shift), Rscratch); 3065 __ btst(O1_flags, Rscratch); 3066 __ br(Assembler::zero, false, Assembler::pt, notVFinal); 3067 __ delayed()->nop(); 3068 3069 // get receiver klass - this is also a null check 3070 __ null_check(O0_recv, oopDesc::klass_offset_in_bytes()); 3071 __ load_klass(O0_recv, O2_Klass); 3072 3073 Label subtype; 3074 Register Rtemp = O1_flags; 3075 __ check_klass_subtype(O2_Klass, Rinterface, Rscratch, Rtemp, subtype); 3076 // If we get here the typecheck failed 3077 __ ba(L_no_such_interface); 3078 __ delayed()->nop(); 3079 __ bind(subtype); 3080 3081 // do the call 3082 Register Rcall = Rinterface; 3083 __ mov(Rmethod, G5_method); 3084 assert_different_registers(Rcall, G5_method, Gargs, Rret); 3085 3086 __ profile_arguments_type(G5_method, Rcall, Gargs, true); 3087 __ profile_final_call(Rscratch); 3088 __ call_from_interpreter(Rcall, Gargs, Rret); 3089 } 3090 __ bind(notVFinal); 3091 3092 // get receiver klass - this is also a null check 3093 __ null_check(O0_recv, oopDesc::klass_offset_in_bytes()); 3094 __ load_klass(O0_recv, O2_Klass); 3095 3096 // Special case of invokeinterface called for virtual method of 3097 // java.lang.Object. See cpCacheOop.cpp for details. 3098 // This code isn't produced by javac, but could be produced by 3099 // another compliant java compiler. 3100 Label notMethod; 3101 __ set((1 << ConstantPoolCacheEntry::is_forced_virtual_shift), Rscratch); 3102 __ btst(O1_flags, Rscratch); 3103 __ br(Assembler::zero, false, Assembler::pt, notMethod); 3104 __ delayed()->nop(); 3105 3106 invokeinterface_object_method(O2_Klass, Rinterface, Rret, O1_flags); 3107 3108 __ bind(notMethod); 3109 3110 Register Rtemp = O1_flags; 3111 3112 // Receiver subtype check against REFC. 3113 __ lookup_interface_method(// inputs: rec. class, interface, itable index 3114 O2_Klass, Rinterface, noreg, 3115 // outputs: temp reg1, temp reg2, temp reg3 3116 G5_method, Rscratch, Rtemp, 3117 L_no_such_interface, 3118 /*return_method=*/false); 3119 3120 __ profile_virtual_call(O2_Klass, O4); 3121 3122 // 3123 // find entry point to call 3124 // 3125 3126 // Get declaring interface class from method 3127 __ ld_ptr(Rmethod, Method::const_offset(), Rinterface); 3128 __ ld_ptr(Rinterface, ConstMethod::constants_offset(), Rinterface); 3129 __ ld_ptr(Rinterface, ConstantPool::pool_holder_offset_in_bytes(), Rinterface); 3130 |