8232112: MDO extra_data_lock leaks during class unloading

Call the MDO destructor during class unloading.

Reviewed-by: dholmes, eosterlund
This commit is contained in:
Coleen Phillimore 2019-10-17 07:35:22 -04:00
parent d8c6516c92
commit 86fdbc0f85
4 changed files with 21 additions and 6 deletions

View file

@ -118,11 +118,6 @@ Method::Method(ConstMethod* xconst, AccessFlags access_flags) {
void Method::deallocate_contents(ClassLoaderData* loader_data) {
MetadataFactory::free_metadata(loader_data, constMethod());
set_constMethod(NULL);
#if INCLUDE_JVMCI
if (method_data()) {
FailedSpeculation::free_failed_speculations(method_data()->get_failed_speculations_address());
}
#endif
MetadataFactory::free_metadata(loader_data, method_data());
set_method_data(NULL);
MetadataFactory::free_metadata(loader_data, method_counters());
@ -131,6 +126,16 @@ void Method::deallocate_contents(ClassLoaderData* loader_data) {
if (code() != NULL) _code = NULL;
}
void Method::release_C_heap_structures() {
if (method_data()) {
#if INCLUDE_JVMCI
FailedSpeculation::free_failed_speculations(method_data()->get_failed_speculations_address());
#endif
// Destroy MethodData
method_data()->~MethodData();
}
}
address Method::get_i2c_entry() {
assert(adapter() != NULL, "must have");
return adapter()->get_i2c_entry();