1 /*
   2  * Copyright (c) 2000, 2012, 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 #ifndef SHARE_VM_C1_C1_GLOBALS_HPP
  26 #define SHARE_VM_C1_C1_GLOBALS_HPP
  27 
  28 #include "runtime/globals.hpp"
  29 #ifdef TARGET_ARCH_x86
  30 # include "c1_globals_x86.hpp"
  31 #endif
  32 #ifdef TARGET_ARCH_sparc
  33 # include "c1_globals_sparc.hpp"
  34 #endif
  35 #ifdef TARGET_ARCH_arm
  36 # include "c1_globals_arm.hpp"
  37 #endif
  38 #ifdef TARGET_ARCH_ppc
  39 # include "c1_globals_ppc.hpp"
  40 #endif
  41 #ifdef TARGET_OS_FAMILY_linux
  42 # include "c1_globals_linux.hpp"
  43 #endif
  44 #ifdef TARGET_OS_FAMILY_solaris
  45 # include "c1_globals_solaris.hpp"
  46 #endif
  47 #ifdef TARGET_OS_FAMILY_windows
  48 # include "c1_globals_windows.hpp"
  49 #endif
  50 #ifdef TARGET_OS_FAMILY_bsd
  51 # include "c1_globals_bsd.hpp"
  52 #endif
  53 
  54 //
  55 // Defines all global flags used by the client compiler.
  56 //
  57 #define C1_FLAGS(develop, develop_pd, product, product_pd, notproduct)      \
  58                                                                             \
  59   /* Printing */                                                            \
  60   notproduct(bool, PrintC1Statistics, false,                                \
  61           "Print Compiler1 statistics" )                                    \
  62                                                                             \
  63   notproduct(bool, PrintInitialBlockList, false,                            \
  64           "Print block list of BlockListBuilder")                           \
  65                                                                             \
  66   notproduct(bool, PrintCFG, false,                                         \
  67           "Print control flow graph after each change")                     \
  68                                                                             \
  69   notproduct(bool, PrintCFG0, false,                                        \
  70           "Print control flow graph after construction")                    \
  71                                                                             \
  72   notproduct(bool, PrintCFG1, false,                                        \
  73           "Print control flow graph after optimizations")                   \
  74                                                                             \
  75   notproduct(bool, PrintCFG2, false,                                        \
  76           "Print control flow graph before code generation")                \
  77                                                                             \
  78   notproduct(bool, PrintIRDuringConstruction, false,                        \
  79           "Print IR as it's being constructed (helpful for debugging frontend)")\
  80                                                                             \
  81   notproduct(bool, PrintPhiFunctions, false,                                \
  82           "Print phi functions when they are created and simplified")       \
  83                                                                             \
  84   notproduct(bool, PrintIR, false,                                          \
  85           "Print full intermediate representation after each change")       \
  86                                                                             \
  87   notproduct(bool, PrintIR0, false,                                         \
  88           "Print full intermediate representation after construction")      \
  89                                                                             \
  90   notproduct(bool, PrintIR1, false,                                         \
  91           "Print full intermediate representation after optimizations")     \
  92                                                                             \
  93   notproduct(bool, PrintIR2, false,                                         \
  94           "Print full intermediate representation before code generation")  \
  95                                                                             \
  96   notproduct(bool, PrintSimpleStubs, false,                                 \
  97           "Print SimpleStubs")                                              \
  98                                                                             \
  99   /* C1 optimizations */                                                    \
 100                                                                             \
 101   develop(bool, UseC1Optimizations, true,                                   \
 102           "Turn on C1 optimizations")                                       \
 103                                                                             \
 104   develop(bool, SelectivePhiFunctions, true,                                \
 105           "create phi functions at loop headers only when necessary")       \
 106                                                                             \
 107   develop(bool, OptimizeIfOps, true,                                        \
 108           "Optimize multiple IfOps")                                        \
 109                                                                             \
 110   develop(bool, DoCEE, true,                                                \
 111           "Do Conditional Expression Elimination to simplify CFG")          \
 112                                                                             \
 113   develop(bool, PrintCEE, false,                                            \
 114           "Print Conditional Expression Elimination")                       \
 115                                                                             \
 116   develop(bool, UseLocalValueNumbering, true,                               \
 117           "Use Local Value Numbering (embedded in GraphBuilder)")           \
 118                                                                             \
 119   develop(bool, UseGlobalValueNumbering, true,                              \
 120           "Use Global Value Numbering (separate phase)")                    \
 121                                                                             \
 122   product(bool, UseLoopInvariantCodeMotion, true,                           \
 123           "Simple loop invariant code motion for short loops during GVN")   \
 124                                                                             \
 125   develop(bool, TracePredicateFailedTraps, false,                           \
 126           "trace runtime traps caused by predicate failure")                \
 127                                                                             \
 128   develop(bool, StressLoopInvariantCodeMotion, false,                       \
 129           "stress loop invariant code motion")                              \
 130                                                                             \
 131   develop(bool, TraceRangeCheckElimination, false,                          \
 132           "Trace Range Check Elimination")                                  \
 133                                                                             \
 134   develop(bool, AssertRangeCheckElimination, false,                         \
 135           "Assert Range Check Elimination")                                 \
 136                                                                             \
 137   develop(bool, StressRangeCheckElimination, false,                         \
 138           "stress Range Check Elimination")                                 \
 139                                                                             \
 140   develop(bool, PrintValueNumbering, false,                                 \
 141           "Print Value Numbering")                                          \
 142                                                                             \
 143   product(intx, ValueMapInitialSize, 11,                                    \
 144           "Initial size of a value map")                                    \
 145                                                                             \
 146   product(intx, ValueMapMaxLoopSize, 8,                                     \
 147           "maximum size of a loop optimized by global value numbering")     \
 148                                                                             \
 149   develop(bool, EliminateBlocks, true,                                      \
 150           "Eliminate unneccessary basic blocks")                            \
 151                                                                             \
 152   develop(bool, PrintBlockElimination, false,                               \
 153           "Print basic block elimination")                                  \
 154                                                                             \
 155   develop(bool, EliminateNullChecks, true,                                  \
 156           "Eliminate unneccessary null checks")                             \
 157                                                                             \
 158   develop(bool, PrintNullCheckElimination, false,                           \
 159           "Print null check elimination")                                   \
 160                                                                             \
 161   develop(bool, EliminateFieldAccess, true,                                 \
 162           "Optimize field loads and stores")                                \
 163                                                                             \
 164   develop(bool, InlineMethodsWithExceptionHandlers, true,                   \
 165           "Inline methods containing exception handlers "                   \
 166           "(NOTE: does not work with current backend)")                     \
 167                                                                             \
 168   product(bool, InlineSynchronizedMethods, true,                            \
 169           "Inline synchronized methods")                                    \
 170                                                                             \
 171   develop(bool, InlineNIOCheckIndex, true,                                  \
 172           "Intrinsify java.nio.Buffer.checkIndex")                          \
 173                                                                             \
 174   develop(bool, CanonicalizeNodes, true,                                    \
 175           "Canonicalize graph nodes")                                       \
 176                                                                             \
 177   develop(bool, PrintCanonicalization, false,                               \
 178           "Print graph node canonicalization")                              \
 179                                                                             \
 180   develop(bool, UseTableRanges, true,                                       \
 181           "Faster versions of lookup table using ranges")                   \
 182                                                                             \
 183   develop_pd(bool, RoundFPResults,                                          \
 184           "Indicates whether rounding is needed for floating point results")\
 185                                                                             \
 186   develop(intx, NestedInliningSizeRatio, 90,                                \
 187           "Percentage of prev. allowed inline size in recursive inlining")  \
 188                                                                             \
 189   notproduct(bool, PrintIRWithLIR, false,                                   \
 190           "Print IR instructions with generated LIR")                       \
 191                                                                             \
 192   notproduct(bool, PrintLIRWithAssembly, false,                             \
 193           "Show LIR instruction with generated assembly")                   \
 194                                                                             \
 195   develop(bool, CommentedAssembly, trueInDebug,                             \
 196           "Show extra info in PrintNMethods output")                        \
 197                                                                             \
 198   develop(bool, LIRTracePeephole, false,                                    \
 199           "Trace peephole optimizer")                                       \
 200                                                                             \
 201   develop(bool, LIRTraceExecution, false,                                   \
 202           "add LIR code which logs the execution of blocks")                \
 203                                                                             \
 204   product_pd(bool, LIRFillDelaySlots,                                       \
 205              "fill delays on on SPARC with LIR")                            \
 206                                                                             \
 207   develop_pd(bool, CSEArrayLength,                                          \
 208           "Create separate nodes for length in array accesses")             \
 209                                                                             \
 210   develop_pd(bool, TwoOperandLIRForm,                                       \
 211           "true if LIR requires src1 and dst to match in binary LIR ops")   \
 212                                                                             \
 213   develop(intx, TraceLinearScanLevel, 0,                                    \
 214           "Debug levels for the linear scan allocator")                     \
 215                                                                             \
 216   develop(bool, StressLinearScan, false,                                    \
 217           "scramble block order used by LinearScan (stress test)")          \
 218                                                                             \
 219   product(bool, TimeLinearScan, false,                                      \
 220           "detailed timing of LinearScan phases")                           \
 221                                                                             \
 222   develop(bool, TimeEachLinearScan, false,                                  \
 223           "print detailed timing of each LinearScan run")                   \
 224                                                                             \
 225   develop(bool, CountLinearScan, false,                                     \
 226           "collect statistic counters during LinearScan")                   \
 227                                                                             \
 228   /* C1 variable */                                                         \
 229                                                                             \
 230   develop(bool, C1Breakpoint, false,                                        \
 231           "Sets a breakpoint at entry of each compiled method")             \
 232                                                                             \
 233   develop(bool, ImplicitDiv0Checks, true,                                   \
 234           "Use implicit division by zero checks")                           \
 235                                                                             \
 236   develop(bool, PinAllInstructions, false,                                  \
 237           "All instructions are pinned")                                    \
 238                                                                             \
 239   develop(bool, UseFastNewInstance, true,                                   \
 240           "Use fast inlined instance allocation")                           \
 241                                                                             \
 242   develop(bool, UseFastNewTypeArray, true,                                  \
 243           "Use fast inlined type array allocation")                         \
 244                                                                             \
 245   develop(bool, UseFastNewObjectArray, true,                                \
 246           "Use fast inlined object array allocation")                       \
 247                                                                             \
 248   develop(bool, UseFastLocking, true,                                       \
 249           "Use fast inlined locking code")                                  \
 250                                                                             \
 251   develop(bool, UseSlowPath, false,                                         \
 252           "For debugging: test slow cases by always using them")            \
 253                                                                             \
 254   develop(bool, GenerateArrayStoreCheck, true,                              \
 255           "Generates code for array store checks")                          \
 256                                                                             \
 257   develop(bool, DeoptC1, true,                                              \
 258           "Use deoptimization in C1")                                       \
 259                                                                             \
 260   develop(bool, PrintBailouts, false,                                       \
 261           "Print bailout and its reason")                                   \
 262                                                                             \
 263   develop(bool, TracePatching, false,                                       \
 264          "Trace patching of field access on uninitialized classes")         \
 265                                                                             \
 266   develop(bool, PatchALot, false,                                           \
 267           "Marks all fields as having unloaded classes")                    \
 268                                                                             \
 269   develop(bool, PrintNotLoaded, false,                                      \
 270           "Prints where classes are not loaded during code generation")     \
 271                                                                             \
 272   notproduct(bool, VerifyOopMaps, false,                                    \
 273           "Adds oopmap verification code to the generated code")            \
 274                                                                             \
 275   develop(bool, PrintLIR, false,                                            \
 276           "print low-level IR")                                             \
 277                                                                             \
 278   develop(bool, BailoutAfterHIR, false,                                     \
 279           "bailout of compilation after building of HIR")                   \
 280                                                                             \
 281   develop(bool, BailoutAfterLIR, false,                                     \
 282           "bailout of compilation after building of LIR")                   \
 283                                                                             \
 284   develop(bool, BailoutOnExceptionHandlers, false,                          \
 285           "bailout of compilation for methods with exception handlers")     \
 286                                                                             \
 287   develop(bool, InstallMethods, true,                                       \
 288           "Install methods at the end of successful compilations")          \
 289                                                                             \
 290   product(intx, CompilationRepeat, 0,                                       \
 291           "Number of times to recompile method before returning result")    \
 292                                                                             \
 293   develop(intx, NMethodSizeLimit, (64*K)*wordSize,                          \
 294           "Maximum size of a compiled method.")                             \
 295                                                                             \
 296   develop(bool, TraceFPUStack, false,                                       \
 297           "Trace emulation of the FPU stack (intel only)")                  \
 298                                                                             \
 299   develop(bool, TraceFPURegisterUsage, false,                               \
 300           "Trace usage of FPU registers at start of blocks (intel only)")   \
 301                                                                             \
 302   develop(bool, OptimizeUnsafes, true,                                      \
 303           "Optimize raw unsafe ops")                                        \
 304                                                                             \
 305   develop(bool, PrintUnsafeOptimization, false,                             \
 306           "Print optimization of raw unsafe ops")                           \
 307                                                                             \
 308   develop(intx, InstructionCountCutoff, 37000,                              \
 309           "If GraphBuilder adds this many instructions, bails out")         \
 310                                                                             \
 311   product_pd(intx, SafepointPollOffset,                                     \
 312           "Offset added to polling address (Intel only)")                   \
 313                                                                             \
 314   develop(bool, ComputeExactFPURegisterUsage, true,                         \
 315           "Compute additional live set for fpu registers to simplify fpu stack merge (Intel only)") \
 316                                                                             \
 317   product(bool, C1ProfileCalls, true,                                       \
 318           "Profile calls when generating code for updating MDOs")           \
 319                                                                             \
 320   product(bool, C1ProfileVirtualCalls, true,                                \
 321           "Profile virtual calls when generating code for updating MDOs")   \
 322                                                                             \
 323   product(bool, C1ProfileInlinedCalls, true,                                \
 324           "Profile inlined calls when generating code for updating MDOs")   \
 325                                                                             \
 326   product(bool, C1ProfileBranches, true,                                    \
 327           "Profile branches when generating code for updating MDOs")        \
 328                                                                             \
 329   product(bool, C1ProfileCheckcasts, true,                                  \
 330           "Profile checkcasts when generating code for updating MDOs")      \
 331                                                                             \
 332   product(bool, C1OptimizeVirtualCallProfiling, true,                       \
 333           "Use CHA and exact type results at call sites when updating MDOs")\
 334                                                                             \
 335   product(bool, C1UpdateMethodData, trueInTiered,                           \
 336           "Update MethodData*s in Tier1-generated code")                  \
 337                                                                             \
 338   develop(bool, PrintCFGToFile, false,                                      \
 339           "print control flow graph to a separate file during compilation") \
 340                                                                             \
 341 
 342 
 343 // Read default values for c1 globals
 344 
 345 C1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_NOTPRODUCT_FLAG)
 346 
 347 #endif // SHARE_VM_C1_C1_GLOBALS_HPP