src/hotspot/cpu/sparc/templateTable_sparc.cpp
changeset 50735 2f2af62dfac7
parent 50728 9375184cec98
child 53746 bdccafc038a2
equal deleted inserted replaced
50734:0828a0f6676b 50735:2f2af62dfac7
  3200   const Register Rscratch    = G4_scratch;
  3200   const Register Rscratch    = G4_scratch;
  3201   assert_different_registers(Rscratch, G5_method);
  3201   assert_different_registers(Rscratch, G5_method);
  3202 
  3202 
  3203   prepare_invoke(byte_no, Rinterface, Rret, Rmethod, O0_recv, O1_flags);
  3203   prepare_invoke(byte_no, Rinterface, Rret, Rmethod, O0_recv, O1_flags);
  3204 
  3204 
  3205   // get receiver klass
  3205   // First check for Object case, then private interface method,
       
  3206   // then regular interface method.
       
  3207 
       
  3208   // get receiver klass - this is also a null check
  3206   __ null_check(O0_recv, oopDesc::klass_offset_in_bytes());
  3209   __ null_check(O0_recv, oopDesc::klass_offset_in_bytes());
  3207   __ load_klass(O0_recv, O2_Klass);
  3210   __ load_klass(O0_recv, O2_Klass);
  3208 
  3211 
  3209   // Special case of invokeinterface called for virtual method of
  3212   // Special case of invokeinterface called for virtual method of
  3210   // java.lang.Object.  See cpCacheOop.cpp for details.
  3213   // java.lang.Object.  See cpCache.cpp for details.
  3211   // This code isn't produced by javac, but could be produced by
  3214   Label notObjectMethod;
  3212   // another compliant java compiler.
       
  3213   Label notMethod;
       
  3214   __ set((1 << ConstantPoolCacheEntry::is_forced_virtual_shift), Rscratch);
  3215   __ set((1 << ConstantPoolCacheEntry::is_forced_virtual_shift), Rscratch);
  3215   __ btst(O1_flags, Rscratch);
  3216   __ btst(O1_flags, Rscratch);
  3216   __ br(Assembler::zero, false, Assembler::pt, notMethod);
  3217   __ br(Assembler::zero, false, Assembler::pt, notObjectMethod);
  3217   __ delayed()->nop();
  3218   __ delayed()->nop();
  3218 
  3219 
  3219   invokeinterface_object_method(O2_Klass, Rinterface, Rret, O1_flags);
  3220   invokeinterface_object_method(O2_Klass, Rinterface, Rret, O1_flags);
  3220 
  3221 
  3221   __ bind(notMethod);
  3222   __ bind(notObjectMethod);
       
  3223 
       
  3224   Label L_no_such_interface;
       
  3225 
       
  3226   // Check for private method invocation - indicated by vfinal
       
  3227   Label notVFinal;
       
  3228   {
       
  3229     __ set((1 << ConstantPoolCacheEntry::is_vfinal_shift), Rscratch);
       
  3230     __ btst(O1_flags, Rscratch);
       
  3231     __ br(Assembler::zero, false, Assembler::pt, notVFinal);
       
  3232     __ delayed()->nop();
       
  3233 
       
  3234     Label subtype;
       
  3235     Register Rtemp = O1_flags;
       
  3236     __ check_klass_subtype(O2_Klass, Rinterface, Rscratch, Rtemp, subtype);
       
  3237     // If we get here the typecheck failed
       
  3238     __ ba(L_no_such_interface);
       
  3239     __ delayed()->nop();
       
  3240     __ bind(subtype);
       
  3241 
       
  3242     // do the call
       
  3243     Register Rcall = Rinterface;
       
  3244     __ mov(Rmethod, G5_method);
       
  3245     assert_different_registers(Rcall, G5_method, Gargs, Rret);
       
  3246 
       
  3247     __ profile_arguments_type(G5_method, Rcall, Gargs, true);
       
  3248     __ profile_final_call(Rscratch);
       
  3249     __ call_from_interpreter(Rcall, Gargs, Rret);
       
  3250   }
       
  3251   __ bind(notVFinal);
  3222 
  3252 
  3223   Register Rtemp = O1_flags;
  3253   Register Rtemp = O1_flags;
  3224 
       
  3225   Label L_no_such_interface;
       
  3226 
  3254 
  3227   // Receiver subtype check against REFC.
  3255   // Receiver subtype check against REFC.
  3228   __ lookup_interface_method(// inputs: rec. class, interface, itable index
  3256   __ lookup_interface_method(// inputs: rec. class, interface, itable index
  3229                              O2_Klass, Rinterface, noreg,
  3257                              O2_Klass, Rinterface, noreg,
  3230                              // outputs: temp reg1, temp reg2, temp reg3
  3258                              // outputs: temp reg1, temp reg2, temp reg3