提交 be52bb37 编写于 作者: S sspitsyn

8034867: Object references from expression stack are not visible as roots via...

8034867: Object references from expression stack are not visible as roots via jvmti FollowReferences and HeapDump
Summary: The heap walking is inconsistent without following references from expression stack, so need to fix it
Reviewed-by: coleenp, sspitsyn
Contributed-by: axel.siebenborn@sap.com
上级 2586d2b1
......@@ -3081,6 +3081,23 @@ inline bool VM_HeapWalkOperation::collect_stack_roots(JavaThread* java_thread,
}
}
}
StackValueCollection* exprs = jvf->expressions();
for (int index=0; index < exprs->size(); index++) {
if (exprs->at(index)->type() == T_OBJECT) {
oop o = exprs->obj_at(index)();
if (o == NULL) {
continue;
}
// stack reference
if (!CallbackInvoker::report_stack_ref_root(thread_tag, tid, depth, method,
bci, locals->size() + index, o)) {
return false;
}
}
}
} else {
blk->set_context(thread_tag, tid, depth, method);
if (is_top_frame) {
......
......@@ -1604,6 +1604,18 @@ int VM_HeapDumper::do_thread(JavaThread* java_thread, u4 thread_serial_num) {
}
}
}
StackValueCollection *exprs = jvf->expressions();
for(int index = 0; index < exprs->size(); index++) {
if (exprs->at(index)->type() == T_OBJECT) {
oop o = exprs->obj_at(index)();
if (o != NULL) {
writer()->write_u1(HPROF_GC_ROOT_JAVA_FRAME);
writer()->write_objectID(o);
writer()->write_u4(thread_serial_num);
writer()->write_u4((u4) (stack_depth + extra_frames));
}
}
}
} else {
// native frame
if (stack_depth == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册