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