< prev index next >
src/hotspot/share/oops/klass.hpp
Print this page
@@ -498,11 +498,15 @@
virtual oop protection_domain() const = 0;
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);
virtual Klass* array_klass_impl(bool or_null, TRAPS);
@@ -653,15 +657,10 @@
// Iff the class loader (or mirror for unsafe anonymous classes) is alive the
// Klass is considered alive. This is safe to call before the CLD is marked as
// 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);
static void clean_subklass_tree() {
clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
< prev index next >