8210321: Create NO_KEEPALIVE CLD holder accessor

Reviewed-by: coleenp, kbarrett
This commit is contained in:
Erik Österlund 2018-09-10 13:07:42 +02:00
parent 842bc09b01
commit c8be228513
3 changed files with 12 additions and 2 deletions

View file

@ -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.