The walks of a PackageEntry exports and a ModuleEntry reads list at a GC safepoint have the following issues:
1. The walk occurs at the wrong point in ClassLoaderDataGraph::do_unloading(). The walk should occur after the aliveness of each loader is determined and has been marked.
2. There is no reason to walk these lists if every module on these lists are defined to one of the 3 builtin loaders that never die or defined to the same loader as the PackageEntry and/or ModuleEntry itself.
1. The walk occurs at the wrong point in ClassLoaderDataGraph::do_unloading(). The walk should occur after the aliveness of each loader is determined and has been marked.
2. There is no reason to walk these lists if every module on these lists are defined to one of the 3 builtin loaders that never die or defined to the same loader as the PackageEntry and/or ModuleEntry itself.