changeset 51380:e081161320e4

8209378: Fix Minimal VM after JDK-8208677 Reviewed-by: coleenp, shade Contributed-by: Aleksei Voitylov <aleksei.voitylov@bell-sw.com>
author shade
date Mon, 13 Aug 2018 10:28:01 +0200
parents 802f7e5e7e6b
children e354938b4073
files src/hotspot/share/classfile/classLoaderData.inline.hpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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