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