< prev index next >

src/share/vm/services/heapDumper.cpp

Print this page

        

@@ -897,10 +897,15 @@
 void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
   Klass* klass = k;
   assert(klass->oop_is_instance(), "not an InstanceKlass");
   InstanceKlass* ik = (InstanceKlass*)klass;
 
+  // Ignore the class if it hasn't been initialized yet
+  if (!ik->is_linked()) {
+    return;
+  }
+
   writer->write_u1(HPROF_GC_CLASS_DUMP);
 
   // class ID
   writer->write_classID(ik);
   writer->write_u4(STACK_TRACE_ID);

@@ -933,11 +938,12 @@
   // description of instance fields
   dump_instance_field_descriptors(writer, k);
 
   // array classes
   k = klass->array_klass_or_null();
-  while (k != NULL) {
+  // Check mirror != NULL to make sure that this class has been properly initialized
+  while (k != NULL && k->java_mirror() != NULL) {
     Klass* klass = k;
     assert(klass->oop_is_objArray(), "not an ObjArrayKlass");
 
     writer->write_u1(HPROF_GC_CLASS_DUMP);
     writer->write_classID(klass);
< prev index next >