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