Path: blob/master/src/hotspot/share/gc/shenandoah/mode/shenandoahIUMode.cpp
40976 views
/*1* Copyright (c) 2020, 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/shenandoahIUMode.hpp"30#include "logging/log.hpp"31#include "logging/logTag.hpp"32#include "runtime/globals_extension.hpp"33#include "runtime/java.hpp"3435void ShenandoahIUMode::initialize_flags() const {36if (FLAG_IS_CMDLINE(ClassUnloadingWithConcurrentMark) && ClassUnloading) {37log_warning(gc)("Shenandoah I-U mode sets -XX:-ClassUnloadingWithConcurrentMark; see JDK-8261341 for details");38}39FLAG_SET_DEFAULT(ClassUnloadingWithConcurrentMark, false);4041if (ClassUnloading) {42FLAG_SET_DEFAULT(ShenandoahSuspendibleWorkers, true);43FLAG_SET_DEFAULT(VerifyBeforeExit, false);44}4546if (FLAG_IS_DEFAULT(ShenandoahIUBarrier)) {47FLAG_SET_DEFAULT(ShenandoahIUBarrier, true);48}49if (FLAG_IS_DEFAULT(ShenandoahSATBBarrier)) {50FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false);51}5253SHENANDOAH_ERGO_ENABLE_FLAG(ExplicitGCInvokesConcurrent);54SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahImplicitGCInvokesConcurrent);5556// Final configuration checks57SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);58SHENANDOAH_CHECK_FLAG_UNSET(ShenandoahSATBBarrier);59SHENANDOAH_CHECK_FLAG_SET(ShenandoahIUBarrier);60SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);61SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);62SHENANDOAH_CHECK_FLAG_SET(ShenandoahNMethodBarrier);63SHENANDOAH_CHECK_FLAG_SET(ShenandoahStackWatermarkBarrier);64}6566ShenandoahHeuristics* ShenandoahIUMode::initialize_heuristics() const {67if (ShenandoahGCHeuristics != NULL) {68if (strcmp(ShenandoahGCHeuristics, "aggressive") == 0) {69return new ShenandoahAggressiveHeuristics();70} else if (strcmp(ShenandoahGCHeuristics, "static") == 0) {71return new ShenandoahStaticHeuristics();72} else if (strcmp(ShenandoahGCHeuristics, "adaptive") == 0) {73return new ShenandoahAdaptiveHeuristics();74} else if (strcmp(ShenandoahGCHeuristics, "compact") == 0) {75return new ShenandoahCompactHeuristics();76} else {77vm_exit_during_initialization("Unknown -XX:ShenandoahGCHeuristics option");78}79}80ShouldNotReachHere();81return NULL;82}838485