8209378: Fix Minimal VM after JDK-8208677
Reviewed-by: coleenp, shade
Contributed-by: Aleksei Voitylov <aleksei.voitylov@bell-sw.com>
--- a/src/hotspot/share/classfile/classLoaderData.inline.hpp Sat Aug 11 12:49:33 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderData.inline.hpp Mon Aug 13 10:28:01 2018 +0200
@@ -94,9 +94,12 @@
}
bool ClassLoaderDataGraph::should_clean_metaspaces_and_reset() {
- bool do_cleaning = _safepoint_cleanup_needed;
+ bool do_cleaning = _safepoint_cleanup_needed && _should_clean_deallocate_lists;
+#if INCLUDE_JVMTI
+ do_cleaning = do_cleaning || InstanceKlass::has_previous_versions();
+#endif
_safepoint_cleanup_needed = false; // reset
- return (do_cleaning && _should_clean_deallocate_lists) || InstanceKlass::has_previous_versions();
+ return do_cleaning;
}
#endif // SHARE_VM_CLASSFILE_CLASSLOADERDATA_INLINE_HPP