changeset 11342:a82343dd37c3

8145247: incorrect comment in SystemDictionary::load_shared_class Reviewed-by: jiangli, ccheung, gtriantafill
author iklam
date Fri, 27 May 2016 05:49:24 -0700
parents 86811737fdac
children 5e36c89aa7ad 2e7026f08dbf c3edf3d8f233 3fb3f33b1034
files src/share/vm/classfile/systemDictionary.cpp
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/systemDictionary.cpp	Thu May 26 20:43:13 2016 -0400
+++ b/src/share/vm/classfile/systemDictionary.cpp	Fri May 27 05:49:24 2016 -0700
@@ -1336,9 +1336,12 @@
       return nh;
     }
 
-    // Found the class, now load the superclass and interfaces.  If they
-    // are shared, add them to the main system dictionary and reset
-    // their hierarchy references (supers, subs, and interfaces).
+    // Resolve the superclass and interfaces. They must be the same
+    // as in dump time, because the layout of <ik> depends on
+    // the specific layout of ik->super() and ik->local_interfaces().
+    //
+    // If unexpected superclass or interfaces are found, we cannot
+    // load <ik> from the shared archive.
 
     if (ik->super() != NULL) {
       Symbol*  cn = ik->super()->name();
@@ -1348,6 +1351,8 @@
         // The dynamically resolved super class is not the same as the one we used during dump time,
         // so we cannot use ik.
         return nh;
+      } else {
+        assert(s->is_shared(), "must be");
       }
     }
 
@@ -1366,6 +1371,8 @@
         // The dynamically resolved interface class is not the same as the one we used during dump time,
         // so we cannot use ik.
         return nh;
+      } else {
+        assert(i->is_shared(), "must be");
       }
     }