src/hotspot/share/classfile/classLoaderData.cpp
changeset 51682 a30461a359f5
parent 51608 625a5bdde0c5
child 51698 74dde8b66b7f
--- a/src/hotspot/share/classfile/classLoaderData.cpp	Mon Sep 10 13:07:42 2018 +0200
+++ b/src/hotspot/share/classfile/classLoaderData.cpp	Mon Sep 10 13:07:42 2018 +0200
@@ -671,6 +671,15 @@
   }
 }
 
+// Let the GC read the holder without keeping it alive.
+oop ClassLoaderData::holder_no_keepalive() const {
+  if (!_holder.is_null()) {  // NULL class_loader
+    return _holder.peek();
+  } else {
+    return NULL;
+  }
+}
+
 // Unloading support
 bool ClassLoaderData::is_alive() const {
   bool alive = keep_alive()         // null class loader and incomplete unsafe anonymous klasses.