Either a class_loader object or a mirror is the oop that determines whether a ClassLoaderData should be unloaded and reclaimed.
Wrapping the holder in a type called WeakHandle encapsulates the Access barrier semantics for the holder of a class, so that when cleared, the runtime can unload this ClassLoaderData.
This work is preliminary work to fix bug
https://bugs.openjdk.java.net/browse/JDK-8197844
JVMTI GetLoadedClasses should use the Access API
This encapsulation will be used to set the proper Access barrier when the ClassLoaderData is iterated on concurrently, in places that call ClassLoaderDataGraph::classes_do() so that GC doesn't miss marking and relocating the mirror or other object found during ClassLoaderDataGraph iteration.
This work is also preparation for gc-agnostic class unloading and in preparation for concurrent class unloading.
Wrapping the holder in a type called WeakHandle encapsulates the Access barrier semantics for the holder of a class, so that when cleared, the runtime can unload this ClassLoaderData.
This work is preliminary work to fix bug
https://bugs.openjdk.java.net/browse/JDK-8197844
JVMTI GetLoadedClasses should use the Access API
This encapsulation will be used to set the proper Access barrier when the ClassLoaderData is iterated on concurrently, in places that call ClassLoaderDataGraph::classes_do() so that GC doesn't miss marking and relocating the mirror or other object found during ClassLoaderDataGraph iteration.
This work is also preparation for gc-agnostic class unloading and in preparation for concurrent class unloading.