8209378: Fix Minimal VM after JDK-8208677
authorshade
Mon, 13 Aug 2018 10:28:01 +0200
changeset 51380 e081161320e4
parent 51379 802f7e5e7e6b
child 51381 e354938b4073
8209378: Fix Minimal VM after JDK-8208677 Reviewed-by: coleenp, shade Contributed-by: Aleksei Voitylov <aleksei.voitylov@bell-sw.com>
src/hotspot/share/classfile/classLoaderData.inline.hpp
--- 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