diff src/share/vm/oops/klass.cpp @ 4316:1fc4d4768b90

8007725: NPG: Klass::restore_unshareable_info() triggers assert(k->java_mirror() == NULL) Summary: Check for exception during SystemDictionary::resolve_instance_class_or_null() and clean up. Reviewed-by: coleenp, acorn, hseigel, minqi Contributed-by: ioi.lam@oracle.com
author coleenp
date Fri, 15 Mar 2013 17:24:40 -0400
parents 3efdfd6ddbf2
children 92ef81e2f571
line wrap: on
line diff
--- a/src/share/vm/oops/klass.cpp	Thu Mar 14 00:33:08 2013 -0700
+++ b/src/share/vm/oops/klass.cpp	Fri Mar 15 17:24:40 2013 -0400
@@ -486,6 +486,12 @@
 }
 
 void Klass::remove_unshareable_info() {
+  if (!DumpSharedSpaces) {
+    // Clean up after OOM during class loading
+    if (class_loader_data() != NULL) {
+      class_loader_data()->remove_class(this);
+    }
+  }
   set_subklass(NULL);
   set_next_sibling(NULL);
   // Clear the java mirror