From 160021d374b323966a59220c3f99ff6d1d65d8ad Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 23 Aug 2016 13:44:59 -0400 Subject: [PATCH] 8038797: JVMTI FollowReferences does not report roots reachable from nmethods Also follow nmethods found on the execution stack. Reviewed-by: dlong, mgerdin --- hotspot/src/share/vm/prims/jvmtiTagMap.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index fa9d5131e31..b2cf5660865 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -3119,6 +3119,11 @@ inline bool VM_HeapWalkOperation::collect_stack_roots(JavaThread* java_thread, } } + // Follow oops from compiled nmethod + if (jvf->cb() != NULL && jvf->cb()->is_nmethod()) { + blk->set_context(thread_tag, tid, depth, method); + jvf->cb()->as_nmethod()->oops_do(blk); + } } else { blk->set_context(thread_tag, tid, depth, method); if (is_top_frame) {