Path: blob/master/src/hotspot/share/gc/shenandoah/mode/shenandoahSATBMode.cpp
40976 views
/*1* Copyright (c) 2019, 2021, Red Hat, Inc. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp"26#include "gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.hpp"27#include "gc/shenandoah/heuristics/shenandoahCompactHeuristics.hpp"28#include "gc/shenandoah/heuristics/shenandoahStaticHeuristics.hpp"29#include "gc/shenandoah/mode/shenandoahSATBMode.hpp"30#include "logging/log.hpp"31#include "logging/logTag.hpp"32#include "runtime/globals_extension.hpp"33#include "runtime/java.hpp"3435void ShenandoahSATBMode::initialize_flags() const {36if (ClassUnloading) {37FLAG_SET_DEFAULT(ShenandoahSuspendibleWorkers, true);38FLAG_SET_DEFAULT(VerifyBeforeExit, false);39}4041SHENANDOAH_ERGO_ENABLE_FLAG(ExplicitGCInvokesConcurrent);42SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahImplicitGCInvokesConcurrent);4344// Final configuration checks45SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);46SHENANDOAH_CHECK_FLAG_UNSET(ShenandoahIUBarrier);47SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);48SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);49SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);50SHENANDOAH_CHECK_FLAG_SET(ShenandoahNMethodBarrier);51SHENANDOAH_CHECK_FLAG_SET(ShenandoahStackWatermarkBarrier);52}5354ShenandoahHeuristics* ShenandoahSATBMode::initialize_heuristics() const {55if (ShenandoahGCHeuristics != NULL) {56if (strcmp(ShenandoahGCHeuristics, "aggressive") == 0) {57return new ShenandoahAggressiveHeuristics();58} else if (strcmp(ShenandoahGCHeuristics, "static") == 0) {59return new ShenandoahStaticHeuristics();60} else if (strcmp(ShenandoahGCHeuristics, "adaptive") == 0) {61return new ShenandoahAdaptiveHeuristics();62} else if (strcmp(ShenandoahGCHeuristics, "compact") == 0) {63return new ShenandoahCompactHeuristics();64} else {65vm_exit_during_initialization("Unknown -XX:ShenandoahGCHeuristics option");66}67}68ShouldNotReachHere();69return NULL;70}717273