From 6e571871e6a12eab248f73ef55674d80c99de207 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Wed, 18 Oct 2017 21:15:01 +0200 Subject: [PATCH] 8189360: JvmtiExport::weak_oops_do is called for all JNIHandleBlock instances Reviewed-by: pliden, kbarrett, sspitsyn --- src/hotspot/share/gc/shared/weakProcessor.cpp | 5 ++++- src/hotspot/share/runtime/jniHandles.cpp | 7 ------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/gc/shared/weakProcessor.cpp b/src/hotspot/share/gc/shared/weakProcessor.cpp index 6ff3b9b38b8..e1872f2d15a 100644 --- a/src/hotspot/share/gc/shared/weakProcessor.cpp +++ b/src/hotspot/share/gc/shared/weakProcessor.cpp @@ -24,10 +24,13 @@ #include "precompiled.hpp" #include "gc/shared/weakProcessor.hpp" +#include "prims/jvmtiExport.hpp" #include "runtime/jniHandles.hpp" void WeakProcessor::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete) { JNIHandles::weak_oops_do(is_alive, keep_alive); + JvmtiExport::weak_oops_do(is_alive, keep_alive); + if (complete != NULL) { complete->do_void(); } @@ -35,5 +38,5 @@ void WeakProcessor::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_a void WeakProcessor::oops_do(OopClosure* closure) { AlwaysTrueClosure always_true; - JNIHandles::weak_oops_do(&always_true, closure); + weak_oops_do(&always_true, closure, NULL); } diff --git a/src/hotspot/share/runtime/jniHandles.cpp b/src/hotspot/share/runtime/jniHandles.cpp index 1a87c6a6212..2f5049fcd27 100644 --- a/src/hotspot/share/runtime/jniHandles.cpp +++ b/src/hotspot/share/runtime/jniHandles.cpp @@ -27,7 +27,6 @@ #include "logging/log.hpp" #include "memory/iterator.hpp" #include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" #include "runtime/jniHandles.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/thread.inline.hpp" @@ -424,12 +423,6 @@ void JNIHandleBlock::weak_oops_do(BoolObjectClosure* is_alive, break; } } - - /* - * JVMTI data structures may also contain weak oops. The iteration of them - * is placed here so that we don't need to add it to each of the collectors. - */ - JvmtiExport::weak_oops_do(is_alive, f); }