From e43960a0170bf29b28ff4733e1c8c927947fb0bb Mon Sep 17 00:00:00 2001 From: David Holmes Date: Wed, 26 Feb 2025 20:14:11 +0000 Subject: [PATCH] 8350616: Skip ValidateHazardPtrsClosure in non-debug builds Reviewed-by: kbarrett, tschatzl, shade --- src/hotspot/share/runtime/threadSMR.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hotspot/share/runtime/threadSMR.cpp b/src/hotspot/share/runtime/threadSMR.cpp index 0a420590fad..bcfd950ee39 100644 --- a/src/hotspot/share/runtime/threadSMR.cpp +++ b/src/hotspot/share/runtime/threadSMR.cpp @@ -366,6 +366,7 @@ class ScanHazardPtrPrintMatchingThreadsClosure : public ThreadClosure { } }; +#ifdef ASSERT // Closure to validate hazard ptrs. // class ValidateHazardPtrsClosure : public ThreadClosure { @@ -386,6 +387,7 @@ class ValidateHazardPtrsClosure : public ThreadClosure { p2i(thread)); } }; +#endif // Closure to determine if the specified JavaThread is found by // threads_do(). @@ -950,8 +952,10 @@ void ThreadsSMRSupport::free_list(ThreadsList* threads) { log_debug(thread, smr)("tid=%zu: ThreadsSMRSupport::free_list: threads=" INTPTR_FORMAT " is not freed.", os::current_thread_id(), p2i(threads)); } +#ifdef ASSERT ValidateHazardPtrsClosure validate_cl; threads_do(&validate_cl); +#endif delete scan_table; }