1 /*
   2  * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 //
  26 // Defines all globals flags used by the server compiler.
  27 //
  28 
  29 #define C2_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct) \
  30                                                                             \
  31   notproduct(intx, CompileZapFirst, 0,                                      \
  32           "If +ZapDeadCompiledLocals, "                                     \
  33           "skip this many before compiling in zap calls")                   \
  34                                                                             \
  35   notproduct(intx, CompileZapLast, -1,                                      \
  36           "If +ZapDeadCompiledLocals, "                                     \
  37           "compile this many after skipping (incl. skip count, -1 = all)")  \
  38                                                                             \
  39   notproduct(intx, ZapDeadCompiledLocalsFirst, 0,                           \
  40           "If +ZapDeadCompiledLocals, "                                     \
  41           "skip this many before really doing it")                          \
  42                                                                             \
  43   notproduct(intx, ZapDeadCompiledLocalsLast, -1,                           \
  44           "If +ZapDeadCompiledLocals, "                                     \
  45           "do this many after skipping (incl. skip count, -1 = all)")       \
  46                                                                             \
  47   develop(intx, OptoPrologueNops, 0,                                        \
  48           "Insert this many extra nop instructions "                        \
  49           "in the prologue of every nmethod")                               \
  50                                                                             \
  51   product_pd(intx, InteriorEntryAlignment,                                  \
  52           "Code alignment for interior entry points "                       \
  53           "in generated code (in bytes)")                                   \
  54                                                                             \
  55   product(intx, MaxLoopPad, (OptoLoopAlignment-1),                          \
  56           "Align a loop if padding size in bytes is less or equal to this value") \
  57                                                                             \
  58   product(intx, NumberOfLoopInstrToAlign, 4,                                \
  59           "Number of first instructions in a loop to align")                \
  60                                                                             \
  61   notproduct(intx, IndexSetWatch, 0,                                        \
  62           "Trace all operations on this IndexSet (-1 means all, 0 none)")   \
  63                                                                             \
  64   develop(intx, OptoNodeListSize, 4,                                        \
  65           "Starting allocation size of Node_List data structures")          \
  66                                                                             \
  67   develop(intx, OptoBlockListSize, 8,                                       \
  68           "Starting allocation size of Block_List data structures")         \
  69                                                                             \
  70   develop(intx, OptoPeepholeAt, -1,                                         \
  71           "Apply peephole optimizations to this peephole rule")             \
  72                                                                             \
  73   notproduct(bool, PrintIdeal, false,                                       \
  74           "Print ideal graph before code generation")                       \
  75                                                                             \
  76   notproduct(bool, PrintOpto, false,                                        \
  77           "Print compiler2 attempts")                                       \
  78                                                                             \
  79   notproduct(bool, PrintOptoInlining, false,                                \
  80           "Print compiler2 inlining decisions")                             \
  81                                                                             \
  82   notproduct(bool, VerifyOpto, false,                                       \
  83           "Apply more time consuming verification during compilation")      \
  84                                                                             \
  85   notproduct(bool, VerifyOptoOopOffsets, false,                             \
  86           "Check types of base addresses in field references")              \
  87                                                                             \
  88   develop(bool, IdealizedNumerics, false,                                   \
  89           "Check performance difference allowing FP "                       \
  90           "associativity and commutativity...")                             \
  91                                                                             \
  92   develop(bool, OptoBreakpoint, false,                                      \
  93           "insert breakpoint at method entry")                              \
  94                                                                             \
  95   notproduct(bool, OptoBreakpointOSR, false,                                \
  96           "insert breakpoint at osr method entry")                          \
  97                                                                             \
  98   notproduct(intx, BreakAtNode, 0,                                          \
  99           "Break at construction of this Node (either _idx or _debug_idx)") \
 100                                                                             \
 101   notproduct(bool, OptoBreakpointC2R, false,                                \
 102           "insert breakpoint at runtime stub entry")                        \
 103                                                                             \
 104   notproduct(bool, OptoNoExecute, false,                                    \
 105           "Attempt to parse and compile but do not execute generated code") \
 106                                                                             \
 107   notproduct(bool, PrintOptoStatistics, false,                              \
 108           "Print New compiler statistics")                                  \
 109                                                                             \
 110   notproduct(bool, PrintOptoAssembly, false,                                \
 111           "Print New compiler assembly output")                             \
 112                                                                             \
 113   develop_pd(bool, OptoPeephole,                                            \
 114           "Apply peephole optimizations after register allocation")         \
 115                                                                             \
 116   develop(bool, OptoRemoveUseless, true,                                    \
 117           "Remove useless nodes after parsing")                             \
 118                                                                             \
 119   notproduct(bool, PrintFrameConverterAssembly, false,                      \
 120           "Print New compiler assembly output for frame converters")        \
 121                                                                             \
 122   notproduct(bool, PrintParseStatistics, false,                             \
 123           "Print nodes, transforms and new values made per bytecode parsed")\
 124                                                                             \
 125   notproduct(bool, PrintOptoPeephole, false,                                \
 126           "Print New compiler peephole replacements")                       \
 127                                                                             \
 128   develop(bool, PrintCFGBlockFreq, false,                                   \
 129           "Print CFG block freqencies")                                     \
 130                                                                             \
 131   develop(bool, TraceOptoParse, false,                                      \
 132           "Trace bytecode parse and control-flow merge")                    \
 133                                                                             \
 134   product_pd(intx,  LoopUnrollLimit,                                        \
 135           "Unroll loop bodies with node count less than this")              \
 136                                                                             \
 137   product(intx,  LoopUnrollMin, 4,                                          \
 138           "Minimum number of unroll loop bodies before checking progress"   \
 139           "of rounds of unroll,optimize,..")                                \
 140                                                                             \
 141   develop(intx, UnrollLimitForProfileCheck, 1,                              \
 142           "Don't use profile_trip_cnt() to restrict unrolling until "       \
 143           "unrolling would push the number of unrolled iterations above "   \
 144           "UnrollLimitForProfileCheck. A higher value allows more "         \
 145           "unrolling. Zero acts as a very large value." )                   \
 146                                                                             \
 147   product(intx, MultiArrayExpandLimit, 6,                                   \
 148           "Maximum number of individual allocations in an inline-expanded " \
 149           "multianewarray instruction")                                     \
 150                                                                             \
 151   notproduct(bool, TraceProfileTripCount, false,                            \
 152           "Trace profile loop trip count information")                      \
 153                                                                             \
 154   product(bool, UseLoopPredicate, true,                                     \
 155           "Generate a predicate to select fast/slow loop versions")         \
 156                                                                             \
 157   develop(bool, TraceLoopPredicate, false,                                  \
 158           "Trace generation of loop predicates")                            \
 159                                                                             \
 160   develop(bool, OptoCoalesce, true,                                         \
 161           "Use Conservative Copy Coalescing in the Register Allocator")     \
 162                                                                             \
 163   develop(bool, UseUniqueSubclasses, true,                                  \
 164           "Narrow an abstract reference to the unique concrete subclass")   \
 165                                                                             \
 166   develop(bool, UseExactTypes, true,                                        \
 167           "Use exact types to eliminate array store checks and v-calls")    \
 168                                                                             \
 169   product(intx, TrackedInitializationLimit, 50,                             \
 170           "When initializing fields, track up to this many words")          \
 171                                                                             \
 172   product(bool, ReduceFieldZeroing, true,                                   \
 173           "When initializing fields, try to avoid needless zeroing")        \
 174                                                                             \
 175   product(bool, ReduceInitialCardMarks, true,                               \
 176           "When initializing fields, try to avoid needless card marks")     \
 177                                                                             \
 178   product(bool, ReduceBulkZeroing, true,                                    \
 179           "When bulk-initializing, try to avoid needless zeroing")          \
 180                                                                             \
 181   develop_pd(intx, RegisterCostAreaRatio,                                   \
 182           "Spill selection in reg allocator: scale area by (X/64K) before " \
 183           "adding cost")                                                    \
 184                                                                             \
 185   develop_pd(bool, UseCISCSpill,                                            \
 186           "Use ADLC supplied cisc instructions during allocation")          \
 187                                                                             \
 188   notproduct(bool, VerifyGraphEdges , false,                                \
 189           "Verify Bi-directional Edges")                                    \
 190                                                                             \
 191   notproduct(bool, VerifyDUIterators, true,                                 \
 192           "Verify the safety of all iterations of Bi-directional Edges")    \
 193                                                                             \
 194   notproduct(bool, VerifyHashTableKeys, true,                               \
 195           "Verify the immutability of keys in the VN hash tables")          \
 196                                                                             \
 197   notproduct(bool, VerifyRegisterAllocator , false,                         \
 198           "Verify Register Allocator")                                      \
 199                                                                             \
 200   develop_pd(intx, FLOATPRESSURE,                                           \
 201           "Number of float LRG's that constitute high register pressure")   \
 202                                                                             \
 203   develop_pd(intx, INTPRESSURE,                                             \
 204           "Number of integer LRG's that constitute high register pressure") \
 205                                                                             \
 206   notproduct(bool, TraceOptoPipelining, false,                              \
 207           "Trace pipelining information")                                   \
 208                                                                             \
 209   notproduct(bool, TraceOptoOutput, false,                                  \
 210           "Trace pipelining information")                                   \
 211                                                                             \
 212   product_pd(bool, OptoScheduling,                                          \
 213           "Instruction Scheduling after register allocation")               \
 214                                                                             \
 215   product(bool, PartialPeelLoop, true,                                      \
 216           "Partial peel (rotate) loops")                                    \
 217                                                                             \
 218   product(intx, PartialPeelNewPhiDelta, 0,                                  \
 219           "Additional phis that can be created by partial peeling")         \
 220                                                                             \
 221   notproduct(bool, TracePartialPeeling, false,                              \
 222           "Trace partial peeling (loop rotation) information")              \
 223                                                                             \
 224   product(bool, PartialPeelAtUnsignedTests, true,                           \
 225           "Partial peel at unsigned tests if no signed test exists")        \
 226                                                                             \
 227   product(bool, ReassociateInvariants, true,                                \
 228           "Enable reassociation of expressions with loop invariants.")      \
 229                                                                             \
 230   product(bool, LoopUnswitching, true,                                      \
 231           "Enable loop unswitching (a form of invariant test hoisting)")    \
 232                                                                             \
 233   notproduct(bool, TraceLoopUnswitching, false,                             \
 234           "Trace loop unswitching")                                         \
 235                                                                             \
 236   product(bool, UseSuperWord, true,                                         \
 237           "Transform scalar operations into superword operations")          \
 238                                                                             \
 239   develop(bool, SuperWordRTDepCheck, false,                                 \
 240           "Enable runtime dependency checks.")                              \
 241                                                                             \
 242   product(bool, TraceSuperWord, false,                                      \
 243           "Trace superword transforms")                                     \
 244                                                                             \
 245   product_pd(bool, OptoBundling,                                            \
 246           "Generate nops to fill i-cache lines")                            \
 247                                                                             \
 248   product_pd(intx, ConditionalMoveLimit,                                    \
 249           "Limit of ops to make speculative when using CMOVE")              \
 250                                                                             \
 251   /* Set BranchOnRegister == false. See 4965987. */                         \
 252   product(bool, BranchOnRegister, false,                                    \
 253           "Use Sparc V9 branch-on-register opcodes")                        \
 254                                                                             \
 255   develop(bool, SparcV9RegsHiBitsZero, true,                                \
 256           "Assume Sparc V9 I&L registers on V8+ systems are zero-extended") \
 257                                                                             \
 258   develop(intx, PrintIdealGraphLevel, 0,                                    \
 259           "Print ideal graph to XML file / network interface. "             \
 260           "By default attempts to connect to the visualizer on a socket.")  \
 261                                                                             \
 262   develop(intx, PrintIdealGraphPort, 4444,                                  \
 263           "Ideal graph printer to network port")                            \
 264                                                                             \
 265   notproduct(ccstr, PrintIdealGraphAddress, "127.0.0.1",                    \
 266           "IP address to connect to visualizer")                            \
 267                                                                             \
 268   notproduct(ccstr, PrintIdealGraphFile, NULL,                              \
 269           "File to dump ideal graph to.  If set overrides the "             \
 270           "use of the network")                                             \
 271                                                                             \
 272   product(bool, UseOldInlining, true,                                       \
 273           "Enable the 1.3 inlining strategy")                               \
 274                                                                             \
 275   product(bool, UseBimorphicInlining, true,                                 \
 276           "Profiling based inlining for two receivers")                     \
 277                                                                             \
 278   product(bool, UseOnlyInlinedBimorphic, true,                              \
 279           "Don't use BimorphicInlining if can't inline a second method")    \
 280                                                                             \
 281   product(bool, InsertMemBarAfterArraycopy, true,                           \
 282           "Insert memory barrier after arraycopy call")                     \
 283                                                                             \
 284   develop(bool, SubsumeLoads, true,                                         \
 285           "Attempt to compile while subsuming loads into machine instructions.") \
 286                                                                             \
 287   /* controls for tier 1 compilations */                                    \
 288                                                                             \
 289   develop(bool, Tier1CountInvocations, true,                                \
 290           "Generate code, during tier 1, to update invocation counter")     \
 291                                                                             \
 292   product(intx, Tier1Inline, false,                                         \
 293           "enable inlining during tier 1")                                  \
 294                                                                             \
 295   product(intx, Tier1MaxInlineSize, 8,                                      \
 296           "maximum bytecode size of a method to be inlined, during tier 1") \
 297                                                                             \
 298   product(intx, Tier1FreqInlineSize, 35,                                    \
 299           "max bytecode size of a frequent method to be inlined, tier 1")   \
 300                                                                             \
 301   develop(intx, ImplicitNullCheckThreshold, 3,                              \
 302           "Don't do implicit null checks if NPE's in a method exceeds limit") \
 303                                                                             \
 304  /* controls for loop optimization */                                       \
 305   product(intx, Tier1LoopOptsCount, 0,                                      \
 306           "Set level of loop optimization for tier 1 compiles")             \
 307                                                                             \
 308   product(intx, LoopOptsCount, 43,                                          \
 309           "Set level of loop optimization for tier 1 compiles")             \
 310                                                                             \
 311   /* controls for heat-based inlining */                                    \
 312                                                                             \
 313   develop(intx, NodeCountInliningCutoff, 18000,                             \
 314           "If parser node generation exceeds limit stop inlining")          \
 315                                                                             \
 316   develop(intx, NodeCountInliningStep, 1000,                                \
 317           "Target size of warm calls inlined between optimization passes")  \
 318                                                                             \
 319   develop(bool, InlineWarmCalls, false,                                     \
 320           "Use a heat-based priority queue to govern inlining")             \
 321                                                                             \
 322   develop(intx, HotCallCountThreshold, 999999,                              \
 323           "large numbers of calls (per method invocation) force hotness")   \
 324                                                                             \
 325   develop(intx, HotCallProfitThreshold, 999999,                             \
 326           "highly profitable inlining opportunities force hotness")         \
 327                                                                             \
 328   develop(intx, HotCallTrivialWork, -1,                                     \
 329           "trivial execution time (no larger than this) forces hotness")    \
 330                                                                             \
 331   develop(intx, HotCallTrivialSize, -1,                                     \
 332           "trivial methods (no larger than this) force calls to be hot")    \
 333                                                                             \
 334   develop(intx, WarmCallMinCount, -1,                                       \
 335           "number of calls (per method invocation) to enable inlining")     \
 336                                                                             \
 337   develop(intx, WarmCallMinProfit, -1,                                      \
 338           "number of calls (per method invocation) to enable inlining")     \
 339                                                                             \
 340   develop(intx, WarmCallMaxWork, 999999,                                    \
 341           "execution time of the largest inlinable method")                 \
 342                                                                             \
 343   develop(intx, WarmCallMaxSize, 999999,                                    \
 344           "size of the largest inlinable method")                           \
 345                                                                             \
 346   product(intx, MaxNodeLimit, 65000,                                        \
 347           "Maximum number of nodes")                                        \
 348                                                                             \
 349   product(intx, NodeLimitFudgeFactor, 1000,                                 \
 350           "Fudge Factor for certain optimizations")                         \
 351                                                                             \
 352   product(bool, UseJumpTables, true,                                        \
 353           "Use JumpTables instead of a binary search tree for switches")    \
 354                                                                             \
 355   product(bool, UseDivMod, true,                                            \
 356           "Use combined DivMod instruction if available")                   \
 357                                                                             \
 358   product(intx, MinJumpTableSize, 18,                                       \
 359           "Minimum number of targets in a generated jump table")            \
 360                                                                             \
 361   product(intx, MaxJumpTableSize, 65000,                                    \
 362           "Maximum number of targets in a generated jump table")            \
 363                                                                             \
 364   product(intx, MaxJumpTableSparseness, 5,                                  \
 365           "Maximum sparseness for jumptables")                              \
 366                                                                             \
 367   product(bool, EliminateLocks, true,                                       \
 368           "Coarsen locks when possible")                                    \
 369                                                                             \
 370   notproduct(bool, PrintLockStatistics, false,                              \
 371           "Print precise statistics on the dynamic lock usage")             \
 372                                                                             \
 373   diagnostic(bool, PrintPreciseBiasedLockingStatistics, false,              \
 374           "Print per-lock-site statistics of biased locking in JVM")        \
 375                                                                             \
 376   notproduct(bool, PrintEliminateLocks, false,                              \
 377           "Print out when locks are eliminated")                            \
 378                                                                             \
 379   diagnostic(bool, EliminateAutoBox, false,                                 \
 380           "Private flag to control optimizations for autobox elimination")  \
 381                                                                             \
 382   product(intx, AutoBoxCacheMax, 128,                                       \
 383           "Sets max value cached by the java.lang.Integer autobox cache")   \
 384                                                                             \
 385   product(bool, DoEscapeAnalysis, true,                                     \
 386           "Perform escape analysis")                                        \
 387                                                                             \
 388   notproduct(bool, PrintEscapeAnalysis, false,                              \
 389           "Print the results of escape analysis")                           \
 390                                                                             \
 391   product(bool, EliminateAllocations, true,                                 \
 392           "Use escape analysis to eliminate allocations")                   \
 393                                                                             \
 394   notproduct(bool, PrintEliminateAllocations, false,                        \
 395           "Print out when allocations are eliminated")                      \
 396                                                                             \
 397   product(intx, EliminateAllocationArraySizeLimit, 64,                      \
 398           "Array size (number of elements) limit for scalar replacement")   \
 399                                                                             \
 400   product(bool, UseOptoBiasInlining, true,                                  \
 401           "Generate biased locking code in C2 ideal graph")                 \
 402                                                                             \
 403   product(bool, OptimizeStringConcat, false,                                \
 404           "Optimize the construction of Strings by StringBuilder")          \
 405                                                                             \
 406   notproduct(bool, PrintOptimizeStringConcat, false,                        \
 407           "Print information about transformations performed on Strings")   \
 408                                                                             \
 409   product(intx, ValueSearchLimit, 1000,                                     \
 410           "Recursion limit in PhaseMacroExpand::value_from_mem_phi")        \
 411                                                                             \
 412   product(intx, MaxLabelRootDepth, 1100,                                    \
 413           "Maximum times call Label_Root to prevent stack overflow")        \
 414                                                                             \
 415   diagnostic(intx, DominatorSearchLimit, 1000,                              \
 416           "Iterations limit in Node::dominates")                            \
 417                                                                             \
 418   product(bool, BlockLayoutByFrequency, true,                               \
 419           "Use edge frequencies to drive block ordering")                   \
 420                                                                             \
 421   product(intx, BlockLayoutMinDiamondPercentage, 20,                        \
 422           "Miniumum %% of a successor (predecessor) for which block layout "\
 423           "a will allow a fork (join) in a single chain")                   \
 424                                                                             \
 425   product(bool, BlockLayoutRotateLoops, true,                               \
 426           "Allow back branches to be fall throughs in the block layour")    \
 427 
 428 C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG)