changeset 30:65a06b4a51b8

6610906: inexplicable IncompatibleClassChangeError Summary: dependency check must treat polymorphic interfaces consistently Reviewed-by: kvn, never, sgoldman
author jrose
date Wed, 27 Feb 2008 00:23:37 -0800
parents d5fc211aea19
children 6152cbb08ce9
files src/share/vm/code/dependencies.cpp src/share/vm/code/nmethod.cpp
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/code/dependencies.cpp	Mon Feb 25 15:05:44 2008 -0800
+++ b/src/share/vm/code/dependencies.cpp	Wed Feb 27 00:23:37 2008 -0800
@@ -882,6 +882,14 @@
   // Must not move the class hierarchy during this check:
   assert_locked_or_safepoint(Compile_lock);
 
+  int nof_impls = instanceKlass::cast(context_type)->nof_implementors();
+  if (nof_impls > 1) {
+    // Avoid this case: *I.m > { A.m, C }; B.m > C
+    // %%% Until this is fixed more systematically, bail out.
+    // See corresponding comment in find_witness_anywhere.
+    return context_type;
+  }
+
   assert(!is_participant(new_type), "only old classes are participants");
   if (participants_hide_witnesses) {
     // If the new type is a subtype of a participant, we are done.
--- a/src/share/vm/code/nmethod.cpp	Mon Feb 25 15:05:44 2008 -0800
+++ b/src/share/vm/code/nmethod.cpp	Wed Feb 27 00:23:37 2008 -0800
@@ -1971,7 +1971,7 @@
     if (ctxk != NULL) {
       Klass* k = Klass::cast(ctxk);
       if (k->oop_is_instance() && ((instanceKlass*)k)->is_dependent_nmethod(this)) {
-        tty->print("   [nmethod<=klass]%s", k->external_name());
+        tty->print_cr("   [nmethod<=klass]%s", k->external_name());
       }
     }
     deps.log_dependency();  // put it into the xml log also