Path: blob/master/src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.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/shenandoahPassiveHeuristics.hpp"26#include "gc/shenandoah/mode/shenandoahPassiveMode.hpp"27#include "logging/log.hpp"28#include "logging/logTag.hpp"29#include "runtime/globals_extension.hpp"3031void ShenandoahPassiveMode::initialize_flags() const {32// Do not allow concurrent cycles.33FLAG_SET_DEFAULT(ExplicitGCInvokesConcurrent, false);34FLAG_SET_DEFAULT(ShenandoahImplicitGCInvokesConcurrent, false);3536// Passive runs with max speed for allocation, because GC is always STW37SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahPacing);3839// No need for evacuation reserve with Full GC, only for Degenerated GC.40if (!ShenandoahDegeneratedGC) {41SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahEvacReserve, 0);42}4344// Disable known barriers by default.45SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahLoadRefBarrier);46SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahSATBBarrier);47SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahIUBarrier);48SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahCASBarrier);49SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahCloneBarrier);50SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahNMethodBarrier);51SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahStackWatermarkBarrier);5253// Final configuration checks54// No barriers are required to run.55}56ShenandoahHeuristics* ShenandoahPassiveMode::initialize_heuristics() const {57if (ShenandoahGCHeuristics != NULL) {58return new ShenandoahPassiveHeuristics();59}60ShouldNotReachHere();61return NULL;62}636465