|
1 | 1 | /* |
2 | | - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
31 | 31 | #include "runtime/safepointMechanism.inline.hpp" |
32 | 32 | #include "runtime/stackWatermark.inline.hpp" |
33 | 33 | #include "runtime/stackWatermarkSet.inline.hpp" |
| 34 | +#include "runtime/threadSMR.hpp" |
| 35 | +#include "runtime/vmOperation.hpp" |
| 36 | +#include "runtime/vmThread.hpp" |
34 | 37 | #include "utilities/debug.hpp" |
35 | 38 | #include "utilities/globalDefinitions.hpp" |
36 | 39 | #include "utilities/preserveException.hpp" |
@@ -118,7 +121,6 @@ void StackWatermarkSet::on_safepoint(JavaThread* jt) { |
118 | 121 |
|
119 | 122 | void StackWatermarkSet::start_processing(JavaThread* jt, StackWatermarkKind kind) { |
120 | 123 | verify_processing_context(); |
121 | | - assert(!jt->is_terminated(), "Poll after termination is a bug"); |
122 | 124 | StackWatermark* watermark = get(jt, kind); |
123 | 125 | if (watermark != nullptr) { |
124 | 126 | watermark->start_processing(); |
@@ -158,3 +160,13 @@ uintptr_t StackWatermarkSet::lowest_watermark(JavaThread* jt) { |
158 | 160 | return watermark; |
159 | 161 | } |
160 | 162 | } |
| 163 | + |
| 164 | +void StackWatermarkSet::safepoint_synchronize_begin() { |
| 165 | + if (VMThread::vm_operation()->skip_thread_oop_barriers()) { |
| 166 | + return; |
| 167 | + } |
| 168 | + |
| 169 | + for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) { |
| 170 | + StackWatermarkSet::start_processing(thread, StackWatermarkKind::gc); |
| 171 | + } |
| 172 | +} |
0 commit comments