< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page

        

@@ -3367,15 +3367,25 @@
   // r0: interface klass (from f1)
   // rmethod: method (from f2)
   // r2: receiver
   // r3: flags
 
+  Label no_such_interface;
+
   // Check for private method invocation - indicated by vfinal
   Label notVFinal;
   __ tbz(flags, ConstantPoolCacheEntry::is_vfinal_shift, notVFinal);
 
-  __ null_check(r2);
+  // Get receiver klass into r3 - also a null check
+  __ null_check(r2, oopDesc::klass_offset_in_bytes());
+  __ load_klass(r3, r2);
+
+  Label subtype;
+  __ check_klass_subtype(r3, r0, r4, subtype);
+  // If we get here the typecheck failed
+  __ b(no_such_interface);
+  __ bind(subtype);
 
   __ profile_final_call(r0);
   __ profile_arguments_type(r0, rmethod, r4, true);
   __ jump_from_interpreted(rmethod, r0);
 

@@ -3394,11 +3404,11 @@
   // Get receiver klass into r3 - also a null check
   __ restore_locals();
   __ null_check(r2, oopDesc::klass_offset_in_bytes());
   __ load_klass(r3, r2);
 
-  Label no_such_interface, no_such_method;
+  Label no_such_method;
 
   // Preserve method for throw_AbstractMethodErrorVerbose.
   __ mov(r16, rmethod);
   // Receiver subtype check against REFC.
   // Superklass in r0. Subklass in r3. Blows rscratch2, r13
< prev index next >