hotspot/src/share/vm/oops/klassVtable.cpp
changeset 21913 0e2fd7282ac6
parent 21770 e8932d2fda2c
child 22232 26acfad336c0
--- a/hotspot/src/share/vm/oops/klassVtable.cpp	Tue Dec 03 08:36:15 2013 -0800
+++ b/hotspot/src/share/vm/oops/klassVtable.cpp	Tue Dec 03 11:13:14 2013 -0800
@@ -665,6 +665,11 @@
 
 // check if a method is a miranda method, given a class's methods table,
 // its default_method table  and its super
+// Miranda methods are calculated twice:
+// first: before vtable size calculation: including abstract and default
+// This is seen by default method creation
+// Second: recalculated during vtable initialization: only abstract
+// This is seen by link resolution and selection.
 // "miranda" means not static, not defined by this class.
 // private methods in interfaces do not belong in the miranda list.
 // the caller must make sure that the method belongs to an interface implemented by the class
@@ -678,7 +683,8 @@
   }
   Symbol* name = m->name();
   Symbol* signature = m->signature();
-  if (InstanceKlass::find_method(class_methods, name, signature) == NULL) {
+
+  if (InstanceKlass::find_instance_method(class_methods, name, signature) == NULL) {
     // did not find it in the method table of the current class
     if ((default_methods == NULL) ||
         InstanceKlass::find_method(default_methods, name, signature) == NULL) {
@@ -688,6 +694,12 @@
       }
 
       Method* mo = InstanceKlass::cast(super)->lookup_method(name, signature);
+      while (mo != NULL && mo->access_flags().is_static()
+             && mo->method_holder() != NULL
+             && mo->method_holder()->super() != NULL)
+      {
+         mo = mo->method_holder()->super()->uncached_lookup_method(name, signature);
+      }
       if (mo == NULL || mo->access_flags().is_private() ) {
         // super class hierarchy does not implement it or protection is different
         return true;