提交 6efa90da 编写于 作者: A aeriksso

8134030: test/serviceability/dcmd/gc/HeapDumpTest fails to verify the dump

Reviewed-by: dholmes
上级 f0b94cb4
...@@ -941,8 +941,14 @@ void DumperSupport::dump_instance(DumpWriter* writer, oop o) { ...@@ -941,8 +941,14 @@ void DumperSupport::dump_instance(DumpWriter* writer, oop o) {
// its array classes // its array classes
void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) { void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
Klass* klass = k; Klass* klass = k;
assert(klass->oop_is_instance(), "not an InstanceKlass"); InstanceKlass* ik = InstanceKlass::cast(k);
InstanceKlass* ik = (InstanceKlass*)klass;
// We can safepoint and do a heap dump at a point where we have a Klass,
// but no java mirror class has been setup for it. So we need to check
// that the class is at least loaded, to avoid crash from a null mirror.
if (!ik->is_loaded()) {
return;
}
writer->write_u1(HPROF_GC_CLASS_DUMP); writer->write_u1(HPROF_GC_CLASS_DUMP);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册