Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/shenandoah/mode/shenandoahSATBMode.cpp
38922 views
/*1* Copyright (c) 2019, Red Hat, Inc. All rights reserved.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation.6*7* This code is distributed in the hope that it will be useful, but WITHOUT8* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License10* version 2 for more details (a copy is included in the LICENSE file that11* accompanied this code).12*13* You should have received a copy of the GNU General Public License version14* 2 along with this work; if not, write to the Free Software Foundation,15* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.16* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA17* or visit www.oracle.com if you need additional information or have any18* questions.19*20*/2122#include "precompiled.hpp"23#include "gc_implementation/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp"24#include "gc_implementation/shenandoah/heuristics/shenandoahAggressiveHeuristics.hpp"25#include "gc_implementation/shenandoah/heuristics/shenandoahCompactHeuristics.hpp"26#include "gc_implementation/shenandoah/heuristics/shenandoahStaticHeuristics.hpp"27#include "gc_implementation/shenandoah/mode/shenandoahSATBMode.hpp"28#include "gc_implementation/shenandoah/shenandoahLogging.hpp"2930void ShenandoahSATBMode::initialize_flags() const {31SHENANDOAH_ERGO_ENABLE_FLAG(ExplicitGCInvokesConcurrent);32SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahImplicitGCInvokesConcurrent);3334// Final configuration checks35SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);36SHENANDOAH_CHECK_FLAG_UNSET(ShenandoahStoreValEnqueueBarrier);37SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);38SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);39SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);40}4142ShenandoahHeuristics* ShenandoahSATBMode::initialize_heuristics() const {43if (ShenandoahGCHeuristics != NULL) {44if (strcmp(ShenandoahGCHeuristics, "aggressive") == 0) {45return new ShenandoahAggressiveHeuristics();46} else if (strcmp(ShenandoahGCHeuristics, "static") == 0) {47return new ShenandoahStaticHeuristics();48} else if (strcmp(ShenandoahGCHeuristics, "adaptive") == 0) {49return new ShenandoahAdaptiveHeuristics();50} else if (strcmp(ShenandoahGCHeuristics, "compact") == 0) {51return new ShenandoahCompactHeuristics();52} else {53vm_exit_during_initialization("Unknown -XX:ShenandoahGCHeuristics option");54}55}56ShouldNotReachHere();57return NULL;58}596061