8210856: Move InstanceKlass DependencyContext cleaning to SystemDictionary::do_unloading()

Already walk classes in ClassLoaderData::unload so generalize to also clean nmethod dependencies.

Reviewed-by: eosterlund, dlong, vlivanov
This commit is contained in:
Coleen Phillimore 2018-09-26 14:01:48 -04:00
parent 9c60728a28
commit 06a1ea846a
6 changed files with 25 additions and 33 deletions

View file

@ -605,9 +605,10 @@ void ClassLoaderData::unload() {
// if they are not already on the _klasses list.
free_deallocate_list_C_heap_structures();
// Tell serviceability tools these classes are unloading
// Clean up class dependencies and tell serviceability tools
// these classes are unloading. Must be called
// after erroneous classes are released.
classes_do(InstanceKlass::notify_unload_class);
classes_do(InstanceKlass::unload_class);
// Clean up global class iterator for compiler
static_klass_iterator.adjust_saved_class(this);