8350572: ZGC: Enhance z_verify_safepoints_are_blocked interactions with VMError

Reviewed-by: eosterlund, stefank
This commit is contained in:
Axel Boldt-Christmas 2025-03-10 11:53:50 +00:00
parent fb0efbe874
commit 64caf08534

View File

@ -53,6 +53,7 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/preserveException.hpp"
#include "utilities/resourceHash.hpp"
#include "utilities/vmError.hpp"
#ifdef ASSERT
@ -60,6 +61,13 @@
// with callers to this function. Typically used to verify that object oops
// and headers are safe to access.
void z_verify_safepoints_are_blocked() {
if (VMError::is_error_reported_in_current_thread()) {
// The current thread has crashed and is creating an error report.
// This may occur from any thread state, skip the safepoint_are_blocked
// verification.
return;
}
Thread* current = Thread::current();
if (current->is_ConcurrentGC_thread()) {