/* * Copyright (c) 2009, 2019, 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 org.graalvm.compiler.core.common; import org.graalvm.compiler.options.Option; import org.graalvm.compiler.options.OptionKey; import org.graalvm.compiler.options.OptionType; /** * This class encapsulates options that control the behavior of the Graal compiler. */ // @formatter:off public final class GraalOptions { @Option(help = "Use compiler intrinsifications.", type = OptionType.Debug) public static final OptionKey Intrinsify = new OptionKey<>(true); @Option(help = "Inline calls with monomorphic type profile.", type = OptionType.Expert) public static final OptionKey InlineMonomorphicCalls = new OptionKey<>(true); @Option(help = "Inline calls with polymorphic type profile.", type = OptionType.Expert) public static final OptionKey InlinePolymorphicCalls = new OptionKey<>(true); @Option(help = "Inline calls with megamorphic type profile (i.e., not all types could be recorded).", type = OptionType.Expert) public static final OptionKey InlineMegamorphicCalls = new OptionKey<>(true); @Option(help = "Maximum desired size of the compiler graph in nodes.", type = OptionType.User) public static final OptionKey MaximumDesiredSize = new OptionKey<>(20000); @Option(help = "Minimum probability for methods to be inlined for megamorphic type profiles.", type = OptionType.Expert) public static final OptionKey MegamorphicInliningMinMethodProbability = new OptionKey<>(0.33D); @Option(help = "Maximum level of recursive inlining.", type = OptionType.Expert) public static final OptionKey MaximumRecursiveInlining = new OptionKey<>(5); @Option(help = "Graphs with less than this number of nodes are trivial and therefore always inlined.", type = OptionType.Expert) public static final OptionKey TrivialInliningSize = new OptionKey<>(10); @Option(help = "Inlining is explored up to this number of nodes in the graph for each call site.", type = OptionType.Expert) public static final OptionKey MaximumInliningSize = new OptionKey<>(300); @Option(help = "If the previous low-level graph size of the method exceeds the threshold, it is not inlined.", type = OptionType.Expert) public static final OptionKey SmallCompiledLowLevelGraphSize = new OptionKey<>(300); @Option(help = "", type = OptionType.Expert) public static final OptionKey LimitInlinedInvokes = new OptionKey<>(5.0); @Option(help = "", type = OptionType.Expert) public static final OptionKey InlineEverything = new OptionKey<>(false); // escape analysis settings @Option(help = "", type = OptionType.Debug) public static final OptionKey PartialEscapeAnalysis = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey EscapeAnalysisIterations = new OptionKey<>(2); @Option(help = "", type = OptionType.Debug) public static final OptionKey EscapeAnalysisLoopCutoff = new OptionKey<>(20); @Option(help = "", type = OptionType.Debug) public static final OptionKey EscapeAnalyzeOnly = new OptionKey<>(null); @Option(help = "The maximum length of an array that will be escape analyzed.", type = OptionType.Expert) public static final OptionKey MaximumEscapeAnalysisArrayLength = new OptionKey<>(128); @Option(help = "", type = OptionType.Debug) public static final OptionKey PEAInliningHints = new OptionKey<>(false); @Option(help = "", type = OptionType.Expert) public static final OptionKey TailDuplicationProbability = new OptionKey<>(0.5); @Option(help = "", type = OptionType.Expert) public static final OptionKey TailDuplicationTrivialSize = new OptionKey<>(1); @Option(help = "", type = OptionType.Expert) public static final OptionKey DeoptsToDisableOptimisticOptimization = new OptionKey<>(40); @Option(help = "", type = OptionType.Debug) public static final OptionKey LoopPeeling = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey ReassociateInvariants = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey FullUnroll = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey LoopUnswitch = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey PartialUnroll = new OptionKey<>(true); @Option(help = "", type = OptionType.Expert) public static final OptionKey MinimumPeelProbability = new OptionKey<>(0.35f); @Option(help = "", type = OptionType.Expert) public static final OptionKey LoopMaxUnswitch = new OptionKey<>(3); @Option(help = "", type = OptionType.Debug) public static final OptionKey UseLoopLimitChecks = new OptionKey<>(true); // debugging settings @Option(help = "", type = OptionType.Debug) public static final OptionKey ZapStackOnMethodEntry = new OptionKey<>(false); @Option(help = "", type = OptionType.Debug) public static final OptionKey DeoptALot = new OptionKey<>(false); @Option(help = "Stress the code emitting explicit exception throwing code.", type = OptionType.Debug) public static final OptionKey StressExplicitExceptionCode = new OptionKey<>(false); @Option(help = "Stress the code emitting invokes with explicit exception edges.", type = OptionType.Debug) public static final OptionKey StressInvokeWithExceptionNode = new OptionKey<>(false); @Option(help = "Stress the code by emitting reads at earliest instead of latest point.", type = OptionType.Debug) public static final OptionKey StressTestEarlyReads = new OptionKey<>(false); @Option(help = "", type = OptionType.Debug) public static final OptionKey VerifyPhases = new OptionKey<>(false); // Debug settings: @Option(help = "Start tracing compiled GC barriers after N garbage collections (disabled if N <= 0).", type = OptionType.Debug) public static final OptionKey GCDebugStartCycle = new OptionKey<>(-1); @Option(help = "Perform platform dependent validation of the Java heap at returns", type = OptionType.Debug) public static final OptionKey VerifyHeapAtReturn = new OptionKey<>(false); // Other printing settings @Option(help = "Print profiling information when parsing a method's bytecode", type = OptionType.Debug) public static final OptionKey PrintProfilingInformation = new OptionKey<>(false); @Option(help = "", type = OptionType.Debug) public static final OptionKey TraceEscapeAnalysis = new OptionKey<>(false); // HotSpot command line options @Option(help = "Print inlining optimizations", type = OptionType.Debug) public static final OptionKey HotSpotPrintInlining = new OptionKey<>(false); // Register allocator debugging @Option(help = "Comma separated list of registers that register allocation is limited to.", type = OptionType.Debug) public static final OptionKey RegisterPressure = new OptionKey<>(null); @Option(help = "", type = OptionType.Debug) public static final OptionKey ConditionalElimination = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey RawConditionalElimination = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey ReplaceInputsWithConstantsBasedOnStamps = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey RemoveNeverExecutedCode = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey UseExceptionProbability = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OmitHotExceptionStacktrace = new OptionKey<>(false); @Option(help = "", type = OptionType.Debug) public static final OptionKey GenSafepoints = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey GenLoopSafepoints = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey UseTypeCheckHints = new OptionKey<>(true); @Option(help = "", type = OptionType.Expert) public static final OptionKey InlineVTableStubs = new OptionKey<>(true); @Option(help = "", type = OptionType.Expert) public static final OptionKey AlwaysInlineVTableStubs = new OptionKey<>(false); @Option(help = "", type = OptionType.Debug) public static final OptionKey CanOmitFrame = new OptionKey<>(true); // Ahead of time compilation @Option(help = "Try to avoid emitting code where patching is required", type = OptionType.Expert) public static final OptionKey ImmutableCode = new OptionKey<>(false); @Option(help = "Generate position independent code", type = OptionType.Expert) public static final OptionKey GeneratePIC = new OptionKey<>(false); // Runtime settings @Option(help = "", type = OptionType.Expert) public static final OptionKey SupportJsrBytecodes = new OptionKey<>(true); @Option(help = "", type = OptionType.Expert) public static final OptionKey OptAssumptions = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptConvertDeoptsToGuards = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptReadElimination = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey ReadEliminationMaxLoopVisits = new OptionKey<>(5); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptDeoptimizationGrouping = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptScheduleOutOfLoops = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey GuardPriorities = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptEliminateGuards = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptImplicitNullChecks = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptClearNonLiveLocals = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptLoopTransform = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptFloatingReads = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptEliminatePartiallyRedundantGuards = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptFilterProfiledTypes = new OptionKey<>(true); @Option(help = "", type = OptionType.Debug) public static final OptionKey OptDevirtualizeInvokesOptimistically = new OptionKey<>(true); @Option(help = "Track the NodeSourcePosition.", type = OptionType.Debug) public static final OptionKey TrackNodeSourcePosition = new OptionKey<>(false); @Option(help = "Track source stack trace where a node was inserted into the graph.", type = OptionType.Debug) public static final OptionKey TrackNodeInsertion = new OptionKey<>(false); @Option(help = "Allow backend to match complex expressions.", type = OptionType.Debug) public static final OptionKey MatchExpressions = new OptionKey<>(true); @Option(help = "Enable counters for various paths in snippets.", type = OptionType.Debug) public static final OptionKey SnippetCounters = new OptionKey<>(false); @Option(help = "Eagerly construct extra snippet info.", type = OptionType.Debug) public static final OptionKey EagerSnippets = new OptionKey<>(false); @Option(help = "Use a cache for snippet graphs.", type = OptionType.Debug) public static final OptionKey UseSnippetGraphCache = new OptionKey<>(true); @Option(help = "file:doc-files/TraceInliningHelp.txt", type = OptionType.Debug) public static final OptionKey TraceInlining = new OptionKey<>(false); @Option(help = "Enable inlining decision tracing in stubs and snippets.", type = OptionType.Debug) public static final OptionKey TraceInliningForStubsAndSnippets = new OptionKey<>(false); @Option(help = "Use Graal-generated stubs for complicated LIR operations instead of embedding all the emitted code.") public static final OptionKey UseGraalStubs = new OptionKey<>(true); }