< prev index next >

src/hotspot/cpu/s390/templateTable_s390.cpp

Print this page
rev 50604 : imported patch jep181-rev1
rev 50607 : imported patch jep181-rev4

@@ -3608,24 +3608,47 @@
            flags     = Z_ARG5,
            receiver  = Z_tmp_1;
 
   BLOCK_COMMENT("invokeinterface {");
 
-  prepare_invoke(byte_no, interface, method,  // Get f1 klassOop, f2 itable index.
+  prepare_invoke(byte_no, interface, method,  // Get f1 klassOop, f2 Method*.
                  receiver, flags);
 
   // Z_R14 (== Z_bytecode) : return entry
 
+  // First check for Object case, then private interface method,
+  // then regular interface method.
+
   // Special case of invokeinterface called for virtual method of
-  // java.lang.Object. See cpCacheOop.cpp for details.
-  // This code isn't produced by javac, but could be produced by
-  // another compliant java compiler.
-  NearLabel notMethod, no_such_interface, no_such_method;
+  // java.lang.Object. See cpCache.cpp for details.
+  NearLabel notObjectMethod, no_such_method;
   __ testbit(flags, ConstantPoolCacheEntry::is_forced_virtual_shift);
-  __ z_brz(notMethod);
+  __ z_brz(notObjectMethod);
   invokevirtual_helper(method, receiver, flags);
-  __ bind(notMethod);
+  __ bind(notObjectMethod);
+
+  // Check for private method invocation - indicated by vfinal
+  NearLabel notVFinal;
+  __ testbit(flags, ConstantPoolCacheEntry::is_vfinal_shift);
+  __ z_brz(notVFinal);
+
+  // Get receiver klass into klass - also a null check.
+  __ load_klass(klass, receiver);
+
+  NearLabel subtype, no_such_interface;
+
+  __ check_klass_subtype(klass, interface, Z_tmp_2, Z_tmp_3, subtype);
+  // If we get here the typecheck failed
+  __ z_bru(no_such_interface);
+  __ bind(subtype);
+
+  // do the call
+  __ profile_final_call(Z_tmp_2);
+  __ profile_arguments_type(Z_tmp_2, method, Z_ARG5, true);
+  __ jump_from_interpreted(method, Z_tmp_2);
+
+  __ bind(notVFinal);
 
   // Get receiver klass into klass - also a null check.
   __ restore_locals();
   __ load_klass(klass, receiver);
 
< prev index next >