/
githubmirror
/
jdk22
Обзор
Документация
Войти
/
githubmirror
/
jdk22
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/hotspot/share/runtime/keepStackGCProcessed.cpp
60 строк
2 KB
Johan Sjölen
8300651: Replace NULL with nullptr in share/runtime/
25 янв 2023, 13:30
25 янв 2023, 13:30
71107f4
Код
Авторство
О чём код?
/* * Copyright (c) 2020, 2023, 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 == nullptr) { _active = false; return; } StackWatermark* their_watermark = StackWatermarkSet::get(jt, StackWatermarkKind::gc); our_watermark->push_linked_watermark(their_watermark); } KeepStackGCProcessedMark::~KeepStackGCProcessedMark() { if (!_active) { return; } StackWatermark* our_watermark = StackWatermarkSet::get(JavaThread::current(), StackWatermarkKind::gc); our_watermark->pop_linked_watermark(); } void KeepStackGCProcessedMark::finish_processing() { StackWatermarkSet::finish_processing(_jt, nullptr /* context */, StackWatermarkKind::gc); }