8189360: JvmtiExport::weak_oops_do is called for all JNIHandleBlock instances
Reviewed-by: pliden, kbarrett, sspitsyn
--- a/src/hotspot/share/gc/shared/weakProcessor.cpp Wed Oct 18 21:13:35 2017 +0200
+++ b/src/hotspot/share/gc/shared/weakProcessor.cpp Wed Oct 18 21:15:01 2017 +0200
@@ -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::oops_do(OopClosure* closure) {
AlwaysTrueClosure always_true;
- JNIHandles::weak_oops_do(&always_true, closure);
+ weak_oops_do(&always_true, closure, NULL);
}
--- a/src/hotspot/share/runtime/jniHandles.cpp Wed Oct 18 21:13:35 2017 +0200
+++ b/src/hotspot/share/runtime/jniHandles.cpp Wed Oct 18 21:15:01 2017 +0200
@@ -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 @@
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);
}