mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-18 14:25:33 +00:00
8210321: Create NO_KEEPALIVE CLD holder accessor
Reviewed-by: coleenp, kbarrett
This commit is contained in:
parent
842bc09b01
commit
c8be228513
@ -671,6 +671,15 @@ oop ClassLoaderData::holder_phantom() const {
|
||||
}
|
||||
}
|
||||
|
||||
// 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.
|
||||
|
||||
@ -307,8 +307,9 @@ class ClassLoaderData : public CHeapObj<mtClass> {
|
||||
void accumulate_modified_oops() { if (has_modified_oops()) _accumulated_modified_oops = true; }
|
||||
void clear_accumulated_modified_oops() { _accumulated_modified_oops = false; }
|
||||
bool has_accumulated_modified_oops() { return _accumulated_modified_oops; }
|
||||
private:
|
||||
oop holder_no_keepalive() const;
|
||||
|
||||
private:
|
||||
void unload();
|
||||
bool keep_alive() const { return _keep_alive > 0; }
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
inline oop ClassLoaderData::class_loader() const {
|
||||
assert(!_unloading, "This oop is not available to unloading class loader data");
|
||||
assert(_holder.is_null() || _holder.peek() != NULL , "This class loader data holder must be alive");
|
||||
assert(_holder.is_null() || holder_no_keepalive() != NULL , "This class loader data holder must be alive");
|
||||
return _class_loader.resolve();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user