src/hotspot/share/oops/klass.hpp
changeset 52907 7cc17c043ce0
parent 52784 621efe32eb0b
child 53152 08db5aa02f7b
--- a/src/hotspot/share/oops/klass.hpp	Fri Dec 07 13:59:19 2018 -0500
+++ b/src/hotspot/share/oops/klass.hpp	Fri Dec 07 14:48:35 2018 -0500
@@ -500,7 +500,11 @@
 
   oop class_loader() const;
 
-  virtual oop klass_holder() const      { return class_loader(); }
+  // This loads the klass's holder as a phantom. This is useful when a weak Klass
+  // pointer has been "peeked" and then must be kept alive before it may
+  // be used safely.  All uses of klass_holder need to apply the appropriate barriers,
+  // except during GC.
+  oop klass_holder() const { return class_loader_data()->holder_phantom(); }
 
  protected:
   virtual Klass* array_klass_impl(bool or_null, int rank, TRAPS);
@@ -655,11 +659,6 @@
   // unloading, and hence during concurrent class unloading.
   bool is_loader_alive() const { return class_loader_data()->is_alive(); }
 
-  // Load the klass's holder as a phantom. This is useful when a weak Klass
-  // pointer has been "peeked" and then must be kept alive before it may
-  // be used safely.
-  oop holder_phantom() const;
-
   void clean_subklass();
 
   static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);