changeset 6444:165b97219811

8150752: Share Class Data Reviewed-by: acorn, hseigel, mschoene
author iklam
date Fri, 15 Jul 2016 06:04:31 +0100
parents 9877542f0855
children 14d0f4da4a74
files src/share/vm/classfile/systemDictionary.cpp
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/systemDictionary.cpp	Wed May 11 12:03:46 2016 -0400
+++ b/src/share/vm/classfile/systemDictionary.cpp	Fri Jul 15 06:04:31 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1185,8 +1185,13 @@
 
     if (ik->super() != NULL) {
       Symbol*  cn = ik->super()->klass_part()->name();
-      resolve_super_or_fail(class_name, cn,
-                            class_loader, Handle(), true, CHECK_(nh));
+      klassOop s = resolve_super_or_fail(class_name, cn,
+                                         class_loader, Handle(), true, CHECK_(nh));
+      if (s->klass_part() != ik->super()->klass_part()) {
+        // The dynamically resolved super class is not the same as the one we used during dump time,
+        // so we cannot use ik.
+        return nh;
+      }
     }
 
     objArrayHandle interfaces (THREAD, ik->local_interfaces());
@@ -1199,7 +1204,12 @@
       // reinitialized yet (they will be once the interface classes
       // are loaded)
       Symbol*  name  = k->klass_part()->name();
-      resolve_super_or_fail(class_name, name, class_loader, Handle(), false, CHECK_(nh));
+      klassOop i = resolve_super_or_fail(class_name, name, class_loader, Handle(), false, CHECK_(nh));
+      if (k->klass_part() != i->klass_part()) {
+        // The dynamically resolved interface class is not the same as the one we used during dump time,
+        // so we cannot use i.
+        return nh;
+      }
     }
 
     // Adjust methods to recover missing data.  They need addresses for