src/share/vm/code/dependencies.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/code

src/share/vm/code/dependencies.cpp

Print this page
rev 8016 : 8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity
Summary: default methods added to classes confuse dependency processing
Reviewed-by:


 828     initialize(participant);
 829   }
 830 
 831   // This is common code for two searches:  One for concrete subtypes,
 832   // the other for concrete method implementations and overrides.
 833   bool doing_subtype_search() {
 834     return _name == NULL;
 835   }
 836 
 837   int num_participants() { return _num_participants; }
 838   Klass* participant(int n) {
 839     assert((uint)n <= (uint)_num_participants, "oob");
 840     return _participants[n];
 841   }
 842 
 843   // Note:  If n==num_participants, returns NULL.
 844   Method* found_method(int n) {
 845     assert((uint)n <= (uint)_num_participants, "oob");
 846     Method* fm = _found_methods[n];
 847     assert(n == _num_participants || fm != NULL, "proper usage");
 848     assert(fm == NULL || fm->method_holder() == _participants[n], "sanity");






 849     return fm;
 850   }
 851 
 852 #ifdef ASSERT
 853   // Assert that m is inherited into ctxk, without intervening overrides.
 854   // (May return true even if this is not true, in corner cases where we punt.)
 855   bool check_method_context(Klass* ctxk, Method* m) {
 856     if (m->method_holder() == ctxk)
 857       return true;  // Quick win.
 858     if (m->is_private())
 859       return false; // Quick lose.  Should not happen.
 860     if (!(m->is_public() || m->is_protected()))
 861       // The override story is complex when packages get involved.
 862       return true;  // Must punt the assertion to true.
 863     Klass* k = ctxk;
 864     Method* lm = k->lookup_method(m->name(), m->signature());
 865     if (lm == NULL && k->oop_is_instance()) {
 866       // It might be an interface method
 867         lm = ((InstanceKlass*)k)->lookup_method_in_ordered_interfaces(m->name(),
 868                                                                 m->signature());




 828     initialize(participant);
 829   }
 830 
 831   // This is common code for two searches:  One for concrete subtypes,
 832   // the other for concrete method implementations and overrides.
 833   bool doing_subtype_search() {
 834     return _name == NULL;
 835   }
 836 
 837   int num_participants() { return _num_participants; }
 838   Klass* participant(int n) {
 839     assert((uint)n <= (uint)_num_participants, "oob");
 840     return _participants[n];
 841   }
 842 
 843   // Note:  If n==num_participants, returns NULL.
 844   Method* found_method(int n) {
 845     assert((uint)n <= (uint)_num_participants, "oob");
 846     Method* fm = _found_methods[n];
 847     assert(n == _num_participants || fm != NULL, "proper usage");
 848     if (fm != NULL && fm->method_holder() != _participants[n]) {
 849       // Default methods from interfaces can be added to classes. In
 850       // that case the holder of the method is not the class but the
 851       // interface where it's defined.
 852       assert(fm->is_default_method(), "sanity");
 853       return NULL;
 854     }
 855     return fm;
 856   }
 857 
 858 #ifdef ASSERT
 859   // Assert that m is inherited into ctxk, without intervening overrides.
 860   // (May return true even if this is not true, in corner cases where we punt.)
 861   bool check_method_context(Klass* ctxk, Method* m) {
 862     if (m->method_holder() == ctxk)
 863       return true;  // Quick win.
 864     if (m->is_private())
 865       return false; // Quick lose.  Should not happen.
 866     if (!(m->is_public() || m->is_protected()))
 867       // The override story is complex when packages get involved.
 868       return true;  // Must punt the assertion to true.
 869     Klass* k = ctxk;
 870     Method* lm = k->lookup_method(m->name(), m->signature());
 871     if (lm == NULL && k->oop_is_instance()) {
 872       // It might be an interface method
 873         lm = ((InstanceKlass*)k)->lookup_method_in_ordered_interfaces(m->name(),
 874                                                                 m->signature());


src/share/vm/code/dependencies.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File