mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8255243: Reinforce escape barrier interactions with ZGC conc stack processing
Co-authored-by: Richard Reingruber <rrich@openjdk.org> Reviewed-by: rrich, sspitsyn
This commit is contained in:
parent
faf23de54d
commit
5b185585e8
15 changed files with 196 additions and 104 deletions
60
src/hotspot/share/runtime/keepStackGCProcessed.cpp
Normal file
60
src/hotspot/share/runtime/keepStackGCProcessed.cpp
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
#include "runtime/stackWatermark.inline.hpp"
|
||||
#include "runtime/stackWatermarkSet.inline.hpp"
|
||||
#include "runtime/keepStackGCProcessed.hpp"
|
||||
|
||||
KeepStackGCProcessedMark::KeepStackGCProcessedMark(JavaThread* jt) :
|
||||
_active(true),
|
||||
_jt(jt) {
|
||||
finish_processing();
|
||||
if (!Thread::current()->is_Java_thread()) {
|
||||
assert(SafepointSynchronize::is_at_safepoint() && Thread::current()->is_VM_thread(),
|
||||
"must be either Java thread or VM thread in a safepoint");
|
||||
_active = false;
|
||||
return;
|
||||
}
|
||||
StackWatermark* our_watermark = StackWatermarkSet::get(JavaThread::current(), StackWatermarkKind::gc);
|
||||
if (our_watermark == NULL) {
|
||||
_active = false;
|
||||
return;
|
||||
}
|
||||
StackWatermark* their_watermark = StackWatermarkSet::get(jt, StackWatermarkKind::gc);
|
||||
our_watermark->link_watermark(their_watermark);
|
||||
}
|
||||
|
||||
KeepStackGCProcessedMark::~KeepStackGCProcessedMark() {
|
||||
if (!_active) {
|
||||
return;
|
||||
}
|
||||
StackWatermark* our_watermark = StackWatermarkSet::get(JavaThread::current(), StackWatermarkKind::gc);
|
||||
our_watermark->link_watermark(NULL);
|
||||
}
|
||||
|
||||
void KeepStackGCProcessedMark::finish_processing() {
|
||||
StackWatermarkSet::finish_processing(_jt, NULL /* context */, StackWatermarkKind::gc);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue