src/share/vm/services/heapDumper.cpp

changeset 9668
acb9351e3a29
parent 9344
ad057f2e3211
child 9703
2fdf635bcf28
child 9820
a67e9c6edcdd
equal deleted inserted replaced
9667:1a1aec8c87b7 9668:acb9351e3a29
939 939
940 // creates HPROF_GC_CLASS_DUMP record for the given class and each of 940 // creates HPROF_GC_CLASS_DUMP record for the given class and each of
941 // its array classes 941 // its array classes
942 void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) { 942 void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
943 Klass* klass = k; 943 Klass* klass = k;
944 assert(klass->oop_is_instance(), "not an InstanceKlass"); 944 InstanceKlass* ik = InstanceKlass::cast(k);
945 InstanceKlass* ik = (InstanceKlass*)klass; 945
946 // We can safepoint and do a heap dump at a point where we have a Klass,
947 // but no java mirror class has been setup for it. So we need to check
948 // that the class is at least loaded, to avoid crash from a null mirror.
949 if (!ik->is_loaded()) {
950 return;
951 }
946 952
947 writer->write_u1(HPROF_GC_CLASS_DUMP); 953 writer->write_u1(HPROF_GC_CLASS_DUMP);
948 954
949 // class ID 955 // class ID
950 writer->write_classID(ik); 956 writer->write_classID(ik);

mercurial