src/share/vm/oops/klassVtable.cpp

changeset 5786
36b97be47bde
parent 5732
b2e698d2276c
child 5848
ac9cb1d5a202
     1.1 --- a/src/share/vm/oops/klassVtable.cpp	Fri Sep 27 10:08:56 2013 -0400
     1.2 +++ b/src/share/vm/oops/klassVtable.cpp	Tue Oct 01 08:10:42 2013 -0400
     1.3 @@ -292,9 +292,10 @@
     1.4      return allocate_new;
     1.5    }
     1.6  
     1.7 -  // private methods always have a new entry in the vtable
     1.8 +  // private methods in classes always have a new entry in the vtable
     1.9    // specification interpretation since classic has
    1.10    // private methods not overriding
    1.11 +  // JDK8 adds private methods in interfaces which require invokespecial
    1.12    if (target_method()->is_private()) {
    1.13      return allocate_new;
    1.14    }
    1.15 @@ -442,9 +443,10 @@
    1.16      return true;
    1.17    }
    1.18  
    1.19 -  // private methods always have a new entry in the vtable
    1.20 +  // private methods in classes always have a new entry in the vtable
    1.21    // specification interpretation since classic has
    1.22    // private methods not overriding
    1.23 +  // JDK8 adds private methods in interfaces which require invokespecial
    1.24    if (target_method()->is_private()) {
    1.25      return true;
    1.26    }
    1.27 @@ -520,7 +522,7 @@
    1.28    Klass* method_holder = m->method_holder();
    1.29    InstanceKlass *mhk = InstanceKlass::cast(method_holder);
    1.30  
    1.31 -  // miranda methods are interface methods in a class's vtable
    1.32 +  // miranda methods are public abstract instance interface methods in a class's vtable
    1.33    if (mhk->is_interface()) {
    1.34      assert(m->is_public(), "should be public");
    1.35      assert(ik()->implements_interface(method_holder) , "this class should implement the interface");
    1.36 @@ -534,6 +536,8 @@
    1.37  // "miranda" means not static, not defined by this class, and not defined
    1.38  // in super unless it is private and therefore inaccessible to this class.
    1.39  // the caller must make sure that the method belongs to an interface implemented by the class
    1.40 +// Miranda methods only include public interface instance methods
    1.41 +// Not private methods, not static methods, not default = concrete abstract
    1.42  bool klassVtable::is_miranda(Method* m, Array<Method*>* class_methods, Klass* super) {
    1.43    if (m->is_static()) {
    1.44      return false;

mercurial