1 /* 2 * Copyright (c) 2000, 2020, 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_OPTO_C2_GLOBALS_HPP 26 #define SHARE_OPTO_C2_GLOBALS_HPP 27 28 #include "runtime/flags/jvmFlagConstraintsCompiler.hpp" 29 #include "runtime/globals_shared.hpp" 30 #include "utilities/macros.hpp" 31 32 #include CPU_HEADER(c2_globals) 33 #include OS_HEADER(c2_globals) 34 35 extern "C" intx OptoLoopAlignment; // declared in globals.hpp 36 37 // 38 // Declare all globals flags used by the server compiler. 39 // 40 41 #include "utilities/macros.hpp" 42 #if COMPILER2 43 #include "runtime/flags/jvmFlag.hpp" 44 PRODUCT_FLAG(bool, StressLCM, false, JVMFlag::DIAGNOSTIC, 45 "Randomize instruction scheduling in LCM"); 46 47 PRODUCT_FLAG(bool, StressGCM, false, JVMFlag::DIAGNOSTIC, 48 "Randomize instruction scheduling in GCM"); 49 50 DEVELOP_FLAG(bool, StressMethodHandleLinkerInlining, false, JVMFlag::DEFAULT, 51 "Stress inlining through method handle linkers"); 52 53 DEVELOP_FLAG(intx, OptoPrologueNops, 0, JVMFlag::RANGE, 54 "Insert this many extra nop instructions " 55 "in the prologue of every nmethod"); 56 FLAG_RANGE( OptoPrologueNops, 0, 128); 57 58 PRODUCT_FLAG_PD(intx, InteriorEntryAlignment, JVMFlag::CONSTRAINT, 59 "Code alignment for interior entry points " 60 "in generated code (in bytes)"); 61 FLAG_CONSTRAINT( InteriorEntryAlignment, (void*)InteriorEntryAlignmentConstraintFunc, JVMFlag::AfterErgo); 62 63 PRODUCT_FLAG(intx, MaxLoopPad, (OptoLoopAlignment-1), JVMFlag::RANGE, 64 "Align a loop if padding size in bytes is less or equal to this " 65 "value"); 66 FLAG_RANGE( MaxLoopPad, 0, max_jint); 67 68 PRODUCT_FLAG(intx, MaxVectorSize, 64, JVMFlag::RANGE, 69 "Max vector size in bytes, " 70 "actual size could be less depending on elements type"); 71 FLAG_RANGE( MaxVectorSize, 0, max_jint); 72 73 PRODUCT_FLAG(bool, AlignVector, true, JVMFlag::DEFAULT, 74 "Perform vector store/load alignment in loop"); 75 76 PRODUCT_FLAG(intx, NumberOfLoopInstrToAlign, 4, JVMFlag::RANGE, 77 "Number of first instructions in a loop to align"); 78 FLAG_RANGE( NumberOfLoopInstrToAlign, 0, max_jint); 79 80 NOTPROD_FLAG(intx, IndexSetWatch, 0, JVMFlag::RANGE, 81 "Trace all operations on this IndexSet (-1 means all, 0 none)"); 82 FLAG_RANGE( IndexSetWatch, -1, 0); 83 84 DEVELOP_FLAG(intx, OptoNodeListSize, 4, JVMFlag::RANGE, 85 "Starting allocation size of Node_List data structures"); 86 FLAG_RANGE( OptoNodeListSize, 0, max_jint); 87 88 DEVELOP_FLAG(intx, OptoBlockListSize, 8, JVMFlag::RANGE, 89 "Starting allocation size of Block_List data structures"); 90 FLAG_RANGE( OptoBlockListSize, 0, max_jint); 91 92 DEVELOP_FLAG(intx, OptoPeepholeAt, -1, JVMFlag::DEFAULT, 93 "Apply peephole optimizations to this peephole rule"); 94 95 NOTPROD_FLAG(bool, PrintIdeal, false, JVMFlag::DEFAULT, 96 "Print ideal graph before code generation"); 97 98 DEVELOP_FLAG(bool, PrintOpto, false, JVMFlag::DEFAULT, 99 "Print compiler2 attempts"); 100 101 DEVELOP_FLAG(bool, PrintOptoInlining, false, JVMFlag::DEFAULT, 102 "Print compiler2 inlining decisions"); 103 104 NOTPROD_FLAG(bool, VerifyIdealNodeCount, false, JVMFlag::DEFAULT, 105 "Verify that tracked dead ideal node count is accurate"); 106 107 NOTPROD_FLAG(bool, PrintIdealNodeCount, false, JVMFlag::DEFAULT, 108 "Print liveness counts of ideal nodes"); 109 110 NOTPROD_FLAG(bool, VerifyOptoOopOffsets, false, JVMFlag::DEFAULT, 111 "Check types of base addresses in field references"); 112 113 DEVELOP_FLAG(bool, IdealizedNumerics, false, JVMFlag::DEFAULT, 114 "Check performance difference allowing FP " 115 "associativity and commutativity..."); 116 117 PRODUCT_FLAG_PD(bool, IdealizeClearArrayNode, JVMFlag::DIAGNOSTIC, 118 "Replace ClearArrayNode by subgraph of basic operations."); 119 120 DEVELOP_FLAG(bool, OptoBreakpoint, false, JVMFlag::DEFAULT, 121 "insert breakpoint at method entry"); 122 123 DEVELOP_FLAG(bool, OptoBreakpointOSR, false, JVMFlag::DEFAULT, 124 "insert breakpoint at osr method entry"); 125 126 NOTPROD_FLAG(intx, BreakAtNode, 0, JVMFlag::DEFAULT, 127 "Break at construction of this Node (either _idx or _debug_idx)"); 128 129 DEVELOP_FLAG(bool, OptoBreakpointC2R, false, JVMFlag::DEFAULT, 130 "insert breakpoint at runtime stub entry"); 131 132 NOTPROD_FLAG(bool, OptoNoExecute, false, JVMFlag::DEFAULT, 133 "Attempt to parse and compile but do not execute generated code"); 134 135 NOTPROD_FLAG(bool, PrintOptoStatistics, false, JVMFlag::DEFAULT, 136 "Print New compiler statistics"); 137 138 PRODUCT_FLAG(bool, PrintOptoAssembly, false, JVMFlag::DIAGNOSTIC, 139 "Print New compiler assembly output"); 140 141 DEVELOP_FLAG_PD(bool, OptoPeephole, JVMFlag::DEFAULT, 142 "Apply peephole optimizations after register allocation"); 143 144 DEVELOP_FLAG(bool, OptoRemoveUseless, true, JVMFlag::DEFAULT, 145 "Remove useless nodes after parsing"); 146 147 NOTPROD_FLAG(bool, PrintFrameConverterAssembly, false, JVMFlag::DEFAULT, 148 "Print New compiler assembly output for frame converters"); 149 150 NOTPROD_FLAG(bool, PrintParseStatistics, false, JVMFlag::DEFAULT, 151 "Print nodes, transforms and new values made per bytecode parsed"); 152 153 NOTPROD_FLAG(bool, PrintOptoPeephole, false, JVMFlag::DEFAULT, 154 "Print New compiler peephole replacements"); 155 156 DEVELOP_FLAG(bool, PrintCFGBlockFreq, false, JVMFlag::DEFAULT, 157 "Print CFG block freqencies"); 158 159 DEVELOP_FLAG(bool, TraceOptoParse, false, JVMFlag::DEFAULT, 160 "Trace bytecode parse and control-flow merge"); 161 162 PRODUCT_FLAG_PD(intx, LoopUnrollLimit, JVMFlag::RANGE, 163 "Unroll loop bodies with node count less than this"); 164 FLAG_RANGE( LoopUnrollLimit, 0, max_jint / 4); 165 166 PRODUCT_FLAG_PD(intx, LoopPercentProfileLimit, JVMFlag::RANGE, 167 "Unroll loop bodies with % node count of profile limit"); 168 FLAG_RANGE( LoopPercentProfileLimit, 10, 100); 169 170 PRODUCT_FLAG(intx, LoopMaxUnroll, 16, JVMFlag::RANGE, 171 "Maximum number of unrolls for main loop"); 172 FLAG_RANGE( LoopMaxUnroll, 0, max_jint); 173 174 PRODUCT_FLAG_PD(bool, SuperWordLoopUnrollAnalysis, JVMFlag::DEFAULT, 175 "Map number of unrolls for main loop via " 176 "Superword Level Parallelism analysis"); 177 178 PRODUCT_FLAG(bool, PostLoopMultiversioning, false, JVMFlag::EXPERIMENTAL, 179 "Multi versioned post loops to eliminate range checks"); 180 181 DEVELOP_FLAG(bool, TraceSuperWordLoopUnrollAnalysis, false, JVMFlag::DEFAULT, 182 "Trace what Superword Level Parallelism analysis applies"); 183 184 PRODUCT_FLAG(bool, UseVectorMacroLogic, true, JVMFlag::DIAGNOSTIC, 185 "Use ternary macro logic instructions"); 186 187 PRODUCT_FLAG(intx, LoopUnrollMin, 4, JVMFlag::RANGE, 188 "Minimum number of unroll loop bodies before checking progress" 189 "of rounds of unroll,optimize,.."); 190 FLAG_RANGE( LoopUnrollMin, 0, max_jint); 191 192 PRODUCT_FLAG(bool, UseSubwordForMaxVector, true, JVMFlag::DEFAULT, 193 "Use Subword Analysis to set maximum vector size"); 194 195 PRODUCT_FLAG(bool, UseVectorCmov, false, JVMFlag::DEFAULT, 196 "Use Vectorized Cmov"); 197 198 DEVELOP_FLAG(intx, UnrollLimitForProfileCheck, 1, JVMFlag::RANGE, 199 "Don't use profile_trip_cnt() to restrict unrolling until " 200 "unrolling would push the number of unrolled iterations above " 201 "UnrollLimitForProfileCheck. A higher value allows more " 202 "unrolling. Zero acts as a very large value."); 203 FLAG_RANGE( UnrollLimitForProfileCheck, 0, max_intx); 204 205 PRODUCT_FLAG(intx, MultiArrayExpandLimit, 6, JVMFlag::RANGE, 206 "Maximum number of individual allocations in an inline-expanded " 207 "multianewarray instruction"); 208 FLAG_RANGE( MultiArrayExpandLimit, 0, max_jint); 209 210 NOTPROD_FLAG(bool, TraceProfileTripCount, false, JVMFlag::DEFAULT, 211 "Trace profile loop trip count information"); 212 213 PRODUCT_FLAG(bool, UseCountedLoopSafepoints, false, JVMFlag::DEFAULT, 214 "Force counted loops to keep a safepoint"); 215 216 PRODUCT_FLAG(bool, UseLoopPredicate, true, JVMFlag::DEFAULT, 217 "Generate a predicate to select fast/slow loop versions"); 218 219 DEVELOP_FLAG(bool, TraceLoopPredicate, false, JVMFlag::DEFAULT, 220 "Trace generation of loop predicates"); 221 222 DEVELOP_FLAG(bool, TraceLoopOpts, false, JVMFlag::DEFAULT, 223 "Trace executed loop optimizations"); 224 225 DEVELOP_FLAG(bool, TraceLoopLimitCheck, false, JVMFlag::DEFAULT, 226 "Trace generation of loop limits checks"); 227 228 DEVELOP_FLAG(bool, TraceRangeLimitCheck, false, JVMFlag::DEFAULT, 229 "Trace additional overflow checks in RCE"); 230 231 232 // OptimizeFill not yet supported on PowerPC. 233 PRODUCT_FLAG(bool, OptimizeFill, true PPC64_ONLY(&& false), JVMFlag::DEFAULT, 234 "convert fill/copy loops into intrinsic"); 235 236 DEVELOP_FLAG(bool, TraceOptimizeFill, false, JVMFlag::DEFAULT, 237 "print detailed information about fill conversion"); 238 239 DEVELOP_FLAG(bool, OptoCoalesce, true, JVMFlag::DEFAULT, 240 "Use Conservative Copy Coalescing in the Register Allocator"); 241 242 DEVELOP_FLAG(bool, UseUniqueSubclasses, true, JVMFlag::DEFAULT, 243 "Narrow an abstract reference to the unique concrete subclass"); 244 245 DEVELOP_FLAG(bool, UseExactTypes, true, JVMFlag::DEFAULT, 246 "Use exact types to eliminate array store checks and v-calls"); 247 248 PRODUCT_FLAG(intx, TrackedInitializationLimit, 50, JVMFlag::RANGE, 249 "When initializing fields, track up to this many words"); 250 FLAG_RANGE( TrackedInitializationLimit, 0, 65535); 251 252 PRODUCT_FLAG(bool, ReduceFieldZeroing, true, JVMFlag::DEFAULT, 253 "When initializing fields, try to avoid needless zeroing"); 254 255 PRODUCT_FLAG(bool, ReduceInitialCardMarks, true, JVMFlag::DEFAULT, 256 "When initializing fields, try to avoid needless card marks"); 257 258 PRODUCT_FLAG(bool, ReduceBulkZeroing, true, JVMFlag::DEFAULT, 259 "When bulk-initializing, try to avoid needless zeroing"); 260 261 PRODUCT_FLAG(bool, UseFPUForSpilling, false, JVMFlag::DEFAULT, 262 "Spill integer registers to FPU instead of stack when possible"); 263 264 DEVELOP_FLAG_PD(intx, RegisterCostAreaRatio, JVMFlag::DEFAULT, 265 "Spill selection in reg allocator: scale area by (X/64K) before " 266 "adding cost"); 267 268 DEVELOP_FLAG_PD(bool, UseCISCSpill, JVMFlag::DEFAULT, 269 "Use ADLC supplied cisc instructions during allocation"); 270 271 NOTPROD_FLAG(bool, VerifyGraphEdges, false, JVMFlag::DEFAULT, 272 "Verify Bi-directional Edges"); 273 274 NOTPROD_FLAG(bool, VerifyDUIterators, true, JVMFlag::DEFAULT, 275 "Verify the safety of all iterations of Bi-directional Edges"); 276 277 NOTPROD_FLAG(bool, VerifyHashTableKeys, true, JVMFlag::DEFAULT, 278 "Verify the immutability of keys in the VN hash tables"); 279 280 NOTPROD_FLAG(bool, VerifyRegisterAllocator, false, JVMFlag::DEFAULT, 281 "Verify Register Allocator"); 282 283 DEVELOP_FLAG_PD(intx, FLOATPRESSURE, JVMFlag::RANGE, 284 "Number of float LRG's that constitute high register pressure"); 285 FLAG_RANGE( FLOATPRESSURE, 0, max_jint); 286 287 DEVELOP_FLAG_PD(intx, INTPRESSURE, JVMFlag::RANGE, 288 "Number of integer LRG's that constitute high register pressure"); 289 FLAG_RANGE( INTPRESSURE, 0, max_jint); 290 291 NOTPROD_FLAG(bool, TraceOptoPipelining, false, JVMFlag::DEFAULT, 292 "Trace pipelining information"); 293 294 NOTPROD_FLAG(bool, TraceOptoOutput, false, JVMFlag::DEFAULT, 295 "Trace pipelining information"); 296 297 PRODUCT_FLAG_PD(bool, OptoScheduling, JVMFlag::DEFAULT, 298 "Instruction Scheduling after register allocation"); 299 300 PRODUCT_FLAG_PD(bool, OptoRegScheduling, JVMFlag::DEFAULT, 301 "Instruction Scheduling before register allocation for pressure"); 302 303 PRODUCT_FLAG(bool, PartialPeelLoop, true, JVMFlag::DEFAULT, 304 "Partial peel (rotate) loops"); 305 306 PRODUCT_FLAG(intx, PartialPeelNewPhiDelta, 0, JVMFlag::RANGE, 307 "Additional phis that can be created by partial peeling"); 308 FLAG_RANGE( PartialPeelNewPhiDelta, 0, max_jint); 309 310 NOTPROD_FLAG(bool, TracePartialPeeling, false, JVMFlag::DEFAULT, 311 "Trace partial peeling (loop rotation) information"); 312 313 PRODUCT_FLAG(bool, PartialPeelAtUnsignedTests, true, JVMFlag::DEFAULT, 314 "Partial peel at unsigned tests if no signed test exists"); 315 316 PRODUCT_FLAG(bool, ReassociateInvariants, true, JVMFlag::DEFAULT, 317 "Enable reassociation of expressions with loop invariants."); 318 319 PRODUCT_FLAG(bool, LoopUnswitching, true, JVMFlag::DEFAULT, 320 "Enable loop unswitching (a form of invariant test hoisting)"); 321 322 NOTPROD_FLAG(bool, TraceLoopUnswitching, false, JVMFlag::DEFAULT, 323 "Trace loop unswitching"); 324 325 PRODUCT_FLAG(bool, AllowVectorizeOnDemand, true, JVMFlag::DEFAULT, 326 "Globally supress vectorization set in VectorizeMethod"); 327 328 PRODUCT_FLAG(bool, UseSuperWord, true, JVMFlag::DEFAULT, 329 "Transform scalar operations into superword operations"); 330 331 DEVELOP_FLAG(bool, SuperWordRTDepCheck, false, JVMFlag::DEFAULT, 332 "Enable runtime dependency checks."); 333 334 PRODUCT_FLAG(bool, SuperWordReductions, true, JVMFlag::DEFAULT, 335 "Enable reductions support in superword."); 336 337 PRODUCT_FLAG(bool, UseCMoveUnconditionally, false, JVMFlag::DEFAULT, 338 "Use CMove (scalar and vector) ignoring profitability test."); 339 340 PRODUCT_FLAG(bool, DoReserveCopyInSuperWord, true, JVMFlag::DEFAULT, 341 "Create reserve copy of graph in SuperWord."); 342 343 DEVELOP_FLAG(bool, TraceSuperWord, false, JVMFlag::DEFAULT, 344 "Trace superword transforms"); 345 346 NOTPROD_FLAG(bool, TraceNewVectors, false, JVMFlag::DEFAULT, 347 "Trace creation of Vector nodes"); 348 349 PRODUCT_FLAG_PD(bool, OptoBundling, JVMFlag::DEFAULT, 350 "Generate nops to fill i-cache lines"); 351 352 PRODUCT_FLAG_PD(intx, ConditionalMoveLimit, JVMFlag::RANGE, 353 "Limit of ops to make speculative when using CMOVE"); 354 FLAG_RANGE( ConditionalMoveLimit, 0, max_jint); 355 356 357 // Set BranchOnRegister == false. See 4965987. 358 PRODUCT_FLAG(bool, BranchOnRegister, false, JVMFlag::DEFAULT, 359 "Use Sparc V9 branch-on-register opcodes"); 360 361 DEVELOP_FLAG(bool, SparcV9RegsHiBitsZero, true, JVMFlag::DEFAULT, 362 "Assume Sparc V9 I&L registers on V8+ systems are zero-extended"); 363 364 PRODUCT_FLAG(bool, UseRDPCForConstantTableBase, false, JVMFlag::DEFAULT, 365 "Use Sparc RDPC instruction for the constant table base."); 366 367 NOTPROD_FLAG(bool, PrintIdealGraph, false, JVMFlag::DEFAULT, 368 "Print ideal graph to XML file / network interface. " 369 "By default attempts to connect to the visualizer on a socket."); 370 371 NOTPROD_FLAG(intx, PrintIdealGraphLevel, 0, JVMFlag::RANGE, 372 "Level of detail of the ideal graph printout. " 373 "System-wide value, 0=nothing is printed, 4=all details printed. " 374 "Level of detail of printouts can be set on a per-method level " 375 "as well by using CompileCommand=option."); 376 FLAG_RANGE( PrintIdealGraphLevel, 0, 4); 377 378 NOTPROD_FLAG(intx, PrintIdealGraphPort, 4444, JVMFlag::RANGE, 379 "Ideal graph printer to network port"); 380 FLAG_RANGE( PrintIdealGraphPort, 0, SHRT_MAX); 381 382 NOTPROD_FLAG(ccstr, PrintIdealGraphAddress, "127.0.0.1", JVMFlag::DEFAULT, 383 "IP address to connect to visualizer"); 384 385 NOTPROD_FLAG(ccstr, PrintIdealGraphFile, NULL, JVMFlag::DEFAULT, 386 "File to dump ideal graph to. If set overrides the " 387 "use of the network"); 388 389 PRODUCT_FLAG(bool, UseBimorphicInlining, true, JVMFlag::DEFAULT, 390 "Profiling based inlining for two receivers"); 391 392 PRODUCT_FLAG(bool, UseOnlyInlinedBimorphic, true, JVMFlag::DEFAULT, 393 "Don't use BimorphicInlining if can't inline a second method"); 394 395 PRODUCT_FLAG(bool, InsertMemBarAfterArraycopy, true, JVMFlag::DEFAULT, 396 "Insert memory barrier after arraycopy call"); 397 398 DEVELOP_FLAG(bool, SubsumeLoads, true, JVMFlag::DEFAULT, 399 "Attempt to compile while subsuming loads into machine " 400 "instructions."); 401 402 DEVELOP_FLAG(bool, StressRecompilation, false, JVMFlag::DEFAULT, 403 "Recompile each compiled method without subsuming loads " 404 "or escape analysis."); 405 406 DEVELOP_FLAG(intx, ImplicitNullCheckThreshold, 3, JVMFlag::RANGE, 407 "Don't do implicit null checks if NPE's in a method exceeds " 408 "limit"); 409 FLAG_RANGE( ImplicitNullCheckThreshold, 0, max_jint); 410 411 PRODUCT_FLAG(intx, LoopOptsCount, 43, JVMFlag::RANGE, 412 "Set level of loop optimization for tier 1 compiles"); 413 FLAG_RANGE( LoopOptsCount, 5, 43); 414 415 416 // controls for heat-based inlining 417 DEVELOP_FLAG(intx, NodeCountInliningCutoff, 18000, JVMFlag::RANGE, 418 "If parser node generation exceeds limit stop inlining"); 419 FLAG_RANGE( NodeCountInliningCutoff, 0, max_jint); 420 421 DEVELOP_FLAG(intx, NodeCountInliningStep, 1000, JVMFlag::RANGE, 422 "Target size of warm calls inlined between optimization passes"); 423 FLAG_RANGE( NodeCountInliningStep, 0, max_jint); 424 425 DEVELOP_FLAG(bool, InlineWarmCalls, false, JVMFlag::DEFAULT, 426 "Use a heat-based priority queue to govern inlining"); 427 428 429 // Max values must not exceed WarmCallInfo::MAX_VALUE(). 430 DEVELOP_FLAG(intx, HotCallCountThreshold, 999999, JVMFlag::RANGE, 431 "large numbers of calls (per method invocation) force hotness"); 432 FLAG_RANGE( HotCallCountThreshold, 0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))); 433 434 DEVELOP_FLAG(intx, HotCallProfitThreshold, 999999, JVMFlag::RANGE, 435 "highly profitable inlining opportunities force hotness"); 436 FLAG_RANGE( HotCallProfitThreshold, 0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))); 437 438 DEVELOP_FLAG(intx, HotCallTrivialWork, -1, JVMFlag::RANGE, 439 "trivial execution time (no larger than this) forces hotness"); 440 FLAG_RANGE( HotCallTrivialWork, -1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))); 441 442 DEVELOP_FLAG(intx, HotCallTrivialSize, -1, JVMFlag::RANGE, 443 "trivial methods (no larger than this) force calls to be hot"); 444 FLAG_RANGE( HotCallTrivialSize, -1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))); 445 446 DEVELOP_FLAG(intx, WarmCallMinCount, -1, JVMFlag::RANGE, 447 "number of calls (per method invocation) to enable inlining"); 448 FLAG_RANGE( WarmCallMinCount, -1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))); 449 450 DEVELOP_FLAG(intx, WarmCallMinProfit, -1, JVMFlag::RANGE, 451 "number of calls (per method invocation) to enable inlining"); 452 FLAG_RANGE( WarmCallMinProfit, -1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))); 453 454 DEVELOP_FLAG(intx, WarmCallMaxWork, 999999, JVMFlag::RANGE, 455 "execution time of the largest inlinable method"); 456 FLAG_RANGE( WarmCallMaxWork, 0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))); 457 458 DEVELOP_FLAG(intx, WarmCallMaxSize, 999999, JVMFlag::RANGE, 459 "size of the largest inlinable method"); 460 FLAG_RANGE( WarmCallMaxSize, 0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))); 461 462 PRODUCT_FLAG(intx, MaxNodeLimit, 80000, JVMFlag::RANGE, 463 "Maximum number of nodes"); 464 FLAG_RANGE( MaxNodeLimit, 1000, max_jint / 3); 465 466 PRODUCT_FLAG(intx, NodeLimitFudgeFactor, 2000, JVMFlag::CONSTRAINT, 467 "Fudge Factor for certain optimizations"); 468 FLAG_CONSTRAINT( NodeLimitFudgeFactor, (void*)NodeLimitFudgeFactorConstraintFunc, JVMFlag::AfterErgo); 469 470 PRODUCT_FLAG(bool, UseJumpTables, true, JVMFlag::DEFAULT, 471 "Use JumpTables instead of a binary search tree for switches"); 472 473 PRODUCT_FLAG(bool, UseDivMod, true, JVMFlag::DEFAULT, 474 "Use combined DivMod instruction if available"); 475 476 PRODUCT_FLAG_PD(intx, MinJumpTableSize, JVMFlag::RANGE, 477 "Minimum number of targets in a generated jump table"); 478 FLAG_RANGE( MinJumpTableSize, 0, max_intx); 479 480 PRODUCT_FLAG(intx, MaxJumpTableSize, 65000, JVMFlag::RANGE, 481 "Maximum number of targets in a generated jump table"); 482 FLAG_RANGE( MaxJumpTableSize, 0, max_intx); 483 484 PRODUCT_FLAG(intx, MaxJumpTableSparseness, 5, JVMFlag::RANGE, 485 "Maximum sparseness for jumptables"); 486 FLAG_RANGE( MaxJumpTableSparseness, 0, max_intx / 4); 487 488 PRODUCT_FLAG(bool, EliminateLocks, true, JVMFlag::DEFAULT, 489 "Coarsen locks when possible"); 490 491 PRODUCT_FLAG(bool, EliminateNestedLocks, true, JVMFlag::DEFAULT, 492 "Eliminate nested locks of the same object when possible"); 493 494 NOTPROD_FLAG(bool, PrintLockStatistics, false, JVMFlag::DEFAULT, 495 "Print precise statistics on the dynamic lock usage"); 496 497 PRODUCT_FLAG(bool, PrintPreciseBiasedLockingStatistics, false, JVMFlag::DIAGNOSTIC, 498 "Print per-lock-site statistics of biased locking in JVM"); 499 500 PRODUCT_FLAG(bool, PrintPreciseRTMLockingStatistics, false, JVMFlag::DIAGNOSTIC, 501 "Print per-lock-site statistics of rtm locking in JVM"); 502 503 NOTPROD_FLAG(bool, PrintEliminateLocks, false, JVMFlag::DEFAULT, 504 "Print out when locks are eliminated"); 505 506 PRODUCT_FLAG(bool, EliminateAutoBox, true, JVMFlag::DEFAULT, 507 "Control optimizations for autobox elimination"); 508 509 PRODUCT_FLAG(intx, AutoBoxCacheMax, 128, JVMFlag::RANGE, 510 "Sets max value cached by the java.lang.Integer autobox cache"); 511 FLAG_RANGE( AutoBoxCacheMax, 0, max_jint); 512 513 PRODUCT_FLAG(bool, AggressiveUnboxing, true, JVMFlag::DIAGNOSTIC, 514 "Control optimizations for aggressive boxing elimination"); 515 516 DEVELOP_FLAG(bool, TracePostallocExpand, false, JVMFlag::DEFAULT, 517 "Trace expanding nodes after" 518 " register allocation."); 519 520 PRODUCT_FLAG(bool, DoEscapeAnalysis, true, JVMFlag::DEFAULT, 521 "Perform escape analysis"); 522 523 PRODUCT_FLAG(double, EscapeAnalysisTimeout, 20. DEBUG_ONLY(+40.), JVMFlag::RANGE, 524 "Abort EA when it reaches time limit (in sec)"); 525 FLAG_RANGE( EscapeAnalysisTimeout, 0, DBL_MAX); 526 527 DEVELOP_FLAG(bool, ExitEscapeAnalysisOnTimeout, true, JVMFlag::DEFAULT, 528 "Exit or throw assert in EA when it reaches time limit"); 529 530 NOTPROD_FLAG(bool, PrintEscapeAnalysis, false, JVMFlag::DEFAULT, 531 "Print the results of escape analysis"); 532 533 PRODUCT_FLAG(bool, EliminateAllocations, true, JVMFlag::DEFAULT, 534 "Use escape analysis to eliminate allocations"); 535 536 NOTPROD_FLAG(bool, PrintEliminateAllocations, false, JVMFlag::DEFAULT, 537 "Print out when allocations are eliminated"); 538 539 PRODUCT_FLAG(intx, EliminateAllocationArraySizeLimit, 64, JVMFlag::RANGE, 540 "Array size (number of elements) limit for scalar replacement"); 541 FLAG_RANGE( EliminateAllocationArraySizeLimit, 0, max_jint); 542 543 PRODUCT_FLAG(bool, OptimizePtrCompare, true, JVMFlag::DEFAULT, 544 "Use escape analysis to optimize pointers compare"); 545 546 NOTPROD_FLAG(bool, PrintOptimizePtrCompare, false, JVMFlag::DEFAULT, 547 "Print information about optimized pointers compare"); 548 549 NOTPROD_FLAG(bool, VerifyConnectionGraph, true, JVMFlag::DEFAULT, 550 "Verify Connection Graph construction in Escape Analysis"); 551 552 PRODUCT_FLAG(bool, UseOptoBiasInlining, true, JVMFlag::DEFAULT, 553 "Generate biased locking code in C2 ideal graph"); 554 555 PRODUCT_FLAG(bool, OptimizeStringConcat, true, JVMFlag::DEFAULT, 556 "Optimize the construction of Strings by StringBuilder"); 557 558 NOTPROD_FLAG(bool, PrintOptimizeStringConcat, false, JVMFlag::DEFAULT, 559 "Print information about transformations performed on Strings"); 560 561 PRODUCT_FLAG(intx, ValueSearchLimit, 1000, JVMFlag::RANGE, 562 "Recursion limit in PhaseMacroExpand::value_from_mem_phi"); 563 FLAG_RANGE( ValueSearchLimit, 0, max_jint); 564 565 PRODUCT_FLAG(intx, MaxLabelRootDepth, 1100, JVMFlag::RANGE, 566 "Maximum times call Label_Root to prevent stack overflow"); 567 FLAG_RANGE( MaxLabelRootDepth, 100, max_jint); 568 569 PRODUCT_FLAG(intx, DominatorSearchLimit, 1000, JVMFlag::DIAGNOSTIC | JVMFlag::RANGE, 570 "Iterations limit in Node::dominates"); 571 FLAG_RANGE( DominatorSearchLimit, 0, max_jint); 572 573 PRODUCT_FLAG(bool, BlockLayoutByFrequency, true, JVMFlag::DEFAULT, 574 "Use edge frequencies to drive block ordering"); 575 576 PRODUCT_FLAG(intx, BlockLayoutMinDiamondPercentage, 20, JVMFlag::RANGE, 577 "Miniumum %% of a successor (predecessor) for which block " 578 "layout a will allow a fork (join) in a single chain"); 579 FLAG_RANGE( BlockLayoutMinDiamondPercentage, 0, 100); 580 581 PRODUCT_FLAG(bool, BlockLayoutRotateLoops, true, JVMFlag::DEFAULT, 582 "Allow back branches to be fall throughs in the block layout"); 583 584 PRODUCT_FLAG(bool, InlineReflectionGetCallerClass, true, JVMFlag::DIAGNOSTIC, 585 "inline sun.reflect.Reflection.getCallerClass(), known to be " 586 "part of base library DLL"); 587 588 PRODUCT_FLAG(bool, InlineObjectCopy, true, JVMFlag::DIAGNOSTIC, 589 "inline Object.clone and Arrays.copyOf[Range] intrinsics"); 590 591 PRODUCT_FLAG(bool, SpecialStringCompareTo, true, JVMFlag::DIAGNOSTIC, 592 "special version of string compareTo"); 593 594 PRODUCT_FLAG(bool, SpecialStringIndexOf, true, JVMFlag::DIAGNOSTIC, 595 "special version of string indexOf"); 596 597 PRODUCT_FLAG(bool, SpecialStringEquals, true, JVMFlag::DIAGNOSTIC, 598 "special version of string equals"); 599 600 PRODUCT_FLAG(bool, SpecialArraysEquals, true, JVMFlag::DIAGNOSTIC, 601 "special version of Arrays.equals(char[],char[])"); 602 603 PRODUCT_FLAG(bool, SpecialEncodeISOArray, true, JVMFlag::DIAGNOSTIC, 604 "special version of ISO_8859_1$Encoder.encodeISOArray"); 605 606 DEVELOP_FLAG(bool, BailoutToInterpreterForThrows, false, JVMFlag::DEFAULT, 607 "Compiled methods which throws/catches exceptions will be " 608 "deopt and intp."); 609 610 DEVELOP_FLAG(bool, ConvertCmpD2CmpF, true, JVMFlag::DEFAULT, 611 "Convert cmpD to cmpF when one input is constant in float range"); 612 613 DEVELOP_FLAG(bool, ConvertFloat2IntClipping, true, JVMFlag::DEFAULT, 614 "Convert float2int clipping idiom to integer clipping"); 615 616 DEVELOP_FLAG(bool, MonomorphicArrayCheck, true, JVMFlag::DEFAULT, 617 "Uncommon-trap array store checks that require full type check"); 618 619 NOTPROD_FLAG(bool, TracePhaseCCP, false, JVMFlag::DEFAULT, 620 "Print progress during Conditional Constant Propagation"); 621 622 DEVELOP_FLAG(bool, PrintDominators, false, JVMFlag::DEFAULT, 623 "Print out dominator trees for GVN"); 624 625 PRODUCT_FLAG(bool, TraceSpilling, false, JVMFlag::DIAGNOSTIC, 626 "Trace spilling"); 627 628 PRODUCT_FLAG(bool, TraceTypeProfile, false, JVMFlag::DIAGNOSTIC, 629 "Trace type profile"); 630 631 DEVELOP_FLAG(bool, PoisonOSREntry, true, JVMFlag::DEFAULT, 632 "Detect abnormal calls to OSR code"); 633 634 DEVELOP_FLAG(bool, SoftMatchFailure, trueInProduct, JVMFlag::DEFAULT, 635 "If the DFA fails to match a node, print a message and bail out"); 636 637 DEVELOP_FLAG(bool, InlineAccessors, true, JVMFlag::DEFAULT, 638 "inline accessor methods (get/set)"); 639 640 PRODUCT_FLAG(intx, TypeProfileMajorReceiverPercent, 90, JVMFlag::RANGE, 641 "% of major receiver type to all profiled receivers"); 642 FLAG_RANGE( TypeProfileMajorReceiverPercent, 0, 100); 643 644 PRODUCT_FLAG(bool, PrintIntrinsics, false, JVMFlag::DIAGNOSTIC, 645 "prints attempted and successful inlining of intrinsics"); 646 647 DEVELOP_FLAG(bool, StressReflectiveCode, false, JVMFlag::DEFAULT, 648 "Use inexact types at allocations, etc., to test reflection"); 649 650 PRODUCT_FLAG(bool, DebugInlinedCalls, true, JVMFlag::DIAGNOSTIC, 651 "If false, restricts profiled locations to the root method only"); 652 653 DEVELOP_FLAG(bool, VerifyLoopOptimizations, false, JVMFlag::DEFAULT, 654 "verify major loop optimizations"); 655 656 PRODUCT_FLAG(bool, ProfileDynamicTypes, true, JVMFlag::DIAGNOSTIC, 657 "do extra type profiling and use it more aggressively"); 658 659 DEVELOP_FLAG(bool, TraceIterativeGVN, false, JVMFlag::DEFAULT, 660 "Print progress during Iterative Global Value Numbering"); 661 662 DEVELOP_FLAG(bool, VerifyIterativeGVN, false, JVMFlag::DEFAULT, 663 "Verify Def-Use modifications during sparse Iterative Global " 664 "Value Numbering"); 665 666 NOTPROD_FLAG(bool, TraceCISCSpill, false, JVMFlag::DEFAULT, 667 "Trace allocators use of cisc spillable instructions"); 668 669 PRODUCT_FLAG(bool, SplitIfBlocks, true, JVMFlag::DEFAULT, 670 "Clone compares and control flow through merge points to fold " 671 "some branches"); 672 673 DEVELOP_FLAG(intx, FreqCountInvocations, 1, JVMFlag::RANGE, 674 "Scaling factor for branch frequencies (deprecated)"); 675 FLAG_RANGE( FreqCountInvocations, 1, max_intx); 676 677 PRODUCT_FLAG(intx, AliasLevel, 3, JVMFlag::RANGE | JVMFlag::CONSTRAINT, 678 "0 for no aliasing, 1 for oop/field/static/array split, " 679 "2 for class split, 3 for unique instances"); 680 FLAG_RANGE( AliasLevel, 0, 3); 681 FLAG_CONSTRAINT( AliasLevel, (void*)AliasLevelConstraintFunc, JVMFlag::AfterErgo); 682 683 DEVELOP_FLAG(bool, VerifyAliases, false, JVMFlag::DEFAULT, 684 "perform extra checks on the results of alias analysis"); 685 686 PRODUCT_FLAG(bool, IncrementalInline, true, JVMFlag::DEFAULT, 687 "do post parse inlining"); 688 689 DEVELOP_FLAG(bool, AlwaysIncrementalInline, false, JVMFlag::DEFAULT, 690 "do all inlining incrementally"); 691 692 PRODUCT_FLAG(intx, LiveNodeCountInliningCutoff, 40000, JVMFlag::RANGE, 693 "max number of live nodes in a method"); 694 FLAG_RANGE( LiveNodeCountInliningCutoff, 0, max_juint / 8); 695 696 PRODUCT_FLAG(bool, OptimizeExpensiveOps, true, JVMFlag::DIAGNOSTIC, 697 "Find best control for expensive operations"); 698 699 PRODUCT_FLAG(bool, UseMathExactIntrinsics, true, JVMFlag::DIAGNOSTIC, 700 "Enables intrinsification of various java.lang.Math functions"); 701 702 PRODUCT_FLAG(bool, UseCharacterCompareIntrinsics, false, JVMFlag::DIAGNOSTIC, 703 "Enables intrinsification of java.lang.Character functions"); 704 705 PRODUCT_FLAG(bool, UseMultiplyToLenIntrinsic, false, JVMFlag::DIAGNOSTIC, 706 "Enables intrinsification of BigInteger.multiplyToLen()"); 707 708 PRODUCT_FLAG(bool, UseSquareToLenIntrinsic, false, JVMFlag::DIAGNOSTIC, 709 "Enables intrinsification of BigInteger.squareToLen()"); 710 711 PRODUCT_FLAG(bool, UseMulAddIntrinsic, false, JVMFlag::DIAGNOSTIC, 712 "Enables intrinsification of BigInteger.mulAdd()"); 713 714 PRODUCT_FLAG(bool, UseMontgomeryMultiplyIntrinsic, false, JVMFlag::DIAGNOSTIC, 715 "Enables intrinsification of BigInteger.montgomeryMultiply()"); 716 717 PRODUCT_FLAG(bool, UseMontgomerySquareIntrinsic, false, JVMFlag::DIAGNOSTIC, 718 "Enables intrinsification of BigInteger.montgomerySquare()"); 719 720 PRODUCT_FLAG(bool, UseTypeSpeculation, true, JVMFlag::DEFAULT, 721 "Speculatively propagate types from profiles"); 722 723 PRODUCT_FLAG(bool, UseInlineDepthForSpeculativeTypes, true, JVMFlag::DIAGNOSTIC, 724 "Carry inline depth of profile point with speculative type " 725 "and give priority to profiling from lower inline depth"); 726 727 PRODUCT_FLAG_PD(bool, TrapBasedRangeChecks, JVMFlag::DEFAULT, 728 "Generate code for range checks that uses a cmp and trap " 729 "instruction raising SIGTRAP. Used on PPC64."); 730 731 PRODUCT_FLAG(intx, ArrayCopyLoadStoreMaxElem, 8, JVMFlag::RANGE, 732 "Maximum number of arraycopy elements inlined as a sequence of" 733 "loads/stores"); 734 FLAG_RANGE( ArrayCopyLoadStoreMaxElem, 0, max_intx); 735 736 DEVELOP_FLAG(bool, StressArrayCopyMacroNode, false, JVMFlag::DEFAULT, 737 "Perform ArrayCopy load/store replacement during IGVN only"); 738 739 DEVELOP_FLAG(bool, RenumberLiveNodes, true, JVMFlag::DEFAULT, 740 "Renumber live nodes"); 741 742 PRODUCT_FLAG(uintx, LoopStripMiningIter, 0, JVMFlag::RANGE, 743 "Number of iterations in strip mined loop"); 744 FLAG_RANGE( LoopStripMiningIter, 0, max_juint); 745 746 PRODUCT_FLAG(uintx, LoopStripMiningIterShortLoop, 0, JVMFlag::RANGE, 747 "Loop with fewer iterations are not strip mined"); 748 FLAG_RANGE( LoopStripMiningIterShortLoop, 0, max_juint); 749 750 PRODUCT_FLAG(bool, UseProfiledLoopPredicate, true, JVMFlag::DEFAULT, 751 "Move predicates out of loops based on profiling data"); 752 753 PRODUCT_FLAG(bool, ExpandSubTypeCheckAtParseTime, false, JVMFlag::DIAGNOSTIC, 754 "Do not use subtype check macro node"); 755 #endif // COMPILER2 756 #endif // SHARE_OPTO_C2_GLOBALS_HPP