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