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