Mercurial > hg > graal-compiler
view graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/BackendOptions.java @ 23209:f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 21 Dec 2015 16:19:35 +0100 |
parents | 8e5c7be6d1fb |
children |
line wrap: on
line source
/* * Copyright (c) 2015, 2015, 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. */ package com.oracle.graal.compiler.common; import com.oracle.graal.options.DerivedOptionValue; import com.oracle.graal.options.Option; import com.oracle.graal.options.OptionType; import com.oracle.graal.options.OptionValue; import com.oracle.graal.options.DerivedOptionValue.OptionSupplier; /** * Options to control the backend configuration. */ public final class BackendOptions { public static class UserOptions { // @formatter:off @Option(help = "Destruct SSA LIR eagerly (before other LIR phases).", type = OptionType.Debug) public static final OptionValue<Boolean> LIREagerSSADestruction = new OptionValue<>(false); @Option(help = "Enable Linear Scan on SSI form.", type = OptionType.Debug) public static final OptionValue<Boolean> LIROptSSILinearScan = new OptionValue<>(false); @Option(help = "Enable experimental Trace Register Allocation.", type = OptionType.Debug) public static final OptionValue<Boolean> TraceRA = new OptionValue<>(false); // @formatter:on } /* Enable SSI Construction. */ public static final DerivedOptionValue<Boolean> EnableSSIConstruction = new DerivedOptionValue<>(new OptionSupplier<Boolean>() { private static final long serialVersionUID = -7375589337502162545L; public Boolean get() { return UserOptions.LIROptSSILinearScan.getValue() || UserOptions.TraceRA.getValue(); } }); /* Create SSA LIR during LIR generation. */ public static final DerivedOptionValue<Boolean> ConstructionSSAlirDuringLirBuilding = new DerivedOptionValue<>(new OptionSupplier<Boolean>() { private static final long serialVersionUID = 7657622005438210681L; public Boolean get() { return GraalOptions.SSA_LIR.getValue() || EnableSSIConstruction.getValue(); } }); public enum LSRAVariant { NONSSA_LSAR, SSA_LSRA, SSI_LSRA } public static final DerivedOptionValue<LSRAVariant> LinearScanVariant = new DerivedOptionValue<>(new OptionSupplier<LSRAVariant>() { private static final long serialVersionUID = 364925071685235153L; public LSRAVariant get() { if (UserOptions.LIROptSSILinearScan.getValue()) { return LSRAVariant.SSI_LSRA; } if (GraalOptions.SSA_LIR.getValue() && !UserOptions.LIREagerSSADestruction.getValue()) { return LSRAVariant.SSA_LSRA; } return LSRAVariant.NONSSA_LSAR; } }); /* Does the backend emit stack to stack moves?. */ public static final DerivedOptionValue<Boolean> ShouldOptimizeStackToStackMoves = new DerivedOptionValue<>(new OptionSupplier<Boolean>() { private static final long serialVersionUID = 2366072840509944317L; public Boolean get() { switch (LinearScanVariant.getValue()) { case SSA_LSRA: case SSI_LSRA: return true; } if (UserOptions.TraceRA.getValue()) { return true; } return false; } }); }