8067713: Move clean_weak_method_links for redefinition out of class unloading

Do this work during class redefinition, only verify clean during class unloading in debug mode.

Reviewed-by: sspitsyn, roland, kbarrett
This commit is contained in:
Coleen Phillimore 2014-12-18 16:15:21 -05:00
parent de70286a0a
commit feb09bc118
6 changed files with 62 additions and 20 deletions

View file

@ -786,17 +786,12 @@ void ClassLoaderDataGraph::clean_metaspaces() {
MetadataOnStackMark md_on_stack(has_redefined_a_class);
if (has_redefined_a_class) {
// purge_previous_versions also cleans weak method links. Because
// one method's MDO can reference another method from another
// class loader, we need to first clean weak method links for all
// class loaders here. Below, we can then free redefined methods
// for all class loaders.
for (ClassLoaderData* data = _head; data != NULL; data = data->next()) {
data->classes_do(InstanceKlass::purge_previous_versions);
}
}
// Need to purge the previous version before deallocating.
// Should purge the previous version before deallocating.
free_deallocate_lists();
}
@ -834,8 +829,6 @@ void ClassLoaderDataGraph::post_class_unload_events(void) {
void ClassLoaderDataGraph::free_deallocate_lists() {
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
// We need to keep this data until InstanceKlass::purge_previous_version has been
// called on all alive classes. See the comment in ClassLoaderDataGraph::clean_metaspaces.
cld->free_deallocate_list();
}
}