--- old/src/hotspot/share/c1/c1_globals.hpp 2020-04-05 21:34:58.230206890 -0700 +++ new/src/hotspot/share/c1/c1_globals.hpp 2020-04-05 21:34:57.882193790 -0700 @@ -32,293 +32,286 @@ #include OS_HEADER(c1_globals) // -// Defines all global flags used by the client compiler. +// Declare all global flags used by the client compiler. // -#define C1_FLAGS(develop, \ - develop_pd, \ - product, \ - product_pd, \ - diagnostic, \ - diagnostic_pd, \ - notproduct, \ - range, \ - constraint) \ - \ - /* Printing */ \ - notproduct(bool, PrintC1Statistics, false, \ - "Print Compiler1 statistics" ) \ - \ - notproduct(bool, PrintInitialBlockList, false, \ - "Print block list of BlockListBuilder") \ - \ - notproduct(bool, PrintCFG, false, \ - "Print control flow graph after each change") \ - \ - notproduct(bool, PrintCFG0, false, \ - "Print control flow graph after construction") \ - \ - notproduct(bool, PrintCFG1, false, \ - "Print control flow graph after optimizations") \ - \ - notproduct(bool, PrintCFG2, false, \ - "Print control flow graph before code generation") \ - \ - notproduct(bool, PrintIRDuringConstruction, false, \ - "Print IR as it's being constructed (helpful for debugging frontend)")\ - \ - notproduct(bool, PrintPhiFunctions, false, \ - "Print phi functions when they are created and simplified") \ - \ - notproduct(bool, PrintIR, false, \ - "Print full intermediate representation after each change") \ - \ - notproduct(bool, PrintIR0, false, \ - "Print full intermediate representation after construction") \ - \ - notproduct(bool, PrintIR1, false, \ - "Print full intermediate representation after optimizations") \ - \ - notproduct(bool, PrintIR2, false, \ - "Print full intermediate representation before code generation") \ - \ - notproduct(bool, PrintSimpleStubs, false, \ - "Print SimpleStubs") \ - \ - /* C1 optimizations */ \ - \ - develop(bool, UseC1Optimizations, true, \ - "Turn on C1 optimizations") \ - \ - develop(bool, SelectivePhiFunctions, true, \ - "create phi functions at loop headers only when necessary") \ - \ - develop(bool, OptimizeIfOps, true, \ - "Optimize multiple IfOps") \ - \ - develop(bool, DoCEE, true, \ - "Do Conditional Expression Elimination to simplify CFG") \ - \ - develop(bool, PrintCEE, false, \ - "Print Conditional Expression Elimination") \ - \ - develop(bool, UseLocalValueNumbering, true, \ - "Use Local Value Numbering (embedded in GraphBuilder)") \ - \ - develop(bool, UseGlobalValueNumbering, true, \ - "Use Global Value Numbering (separate phase)") \ - \ - product(bool, UseLoopInvariantCodeMotion, true, \ - "Simple loop invariant code motion for short loops during GVN") \ - \ - develop(bool, TracePredicateFailedTraps, false, \ - "trace runtime traps caused by predicate failure") \ - \ - develop(bool, StressLoopInvariantCodeMotion, false, \ - "stress loop invariant code motion") \ - \ - develop(bool, TraceRangeCheckElimination, false, \ - "Trace Range Check Elimination") \ - \ - develop(bool, AssertRangeCheckElimination, false, \ - "Assert Range Check Elimination") \ - \ - develop(bool, StressRangeCheckElimination, false, \ - "stress Range Check Elimination") \ - \ - develop(bool, PrintValueNumbering, false, \ - "Print Value Numbering") \ - \ - product(intx, ValueMapInitialSize, 11, \ - "Initial size of a value map") \ - range(1, NOT_LP64(1*K) LP64_ONLY(32*K)) \ - \ - product(intx, ValueMapMaxLoopSize, 8, \ - "maximum size of a loop optimized by global value numbering") \ - range(0, 128) \ - \ - develop(bool, EliminateBlocks, true, \ - "Eliminate unneccessary basic blocks") \ - \ - develop(bool, PrintBlockElimination, false, \ - "Print basic block elimination") \ - \ - develop(bool, EliminateNullChecks, true, \ - "Eliminate unneccessary null checks") \ - \ - develop(bool, PrintNullCheckElimination, false, \ - "Print null check elimination") \ - \ - develop(bool, EliminateFieldAccess, true, \ - "Optimize field loads and stores") \ - \ - develop(bool, InlineMethodsWithExceptionHandlers, true, \ - "Inline methods containing exception handlers " \ - "(NOTE: does not work with current backend)") \ - \ - product(bool, InlineSynchronizedMethods, true, \ - "Inline synchronized methods") \ - \ - diagnostic(bool, InlineNIOCheckIndex, true, \ - "Intrinsify java.nio.Buffer.checkIndex") \ - \ - develop(bool, CanonicalizeNodes, true, \ - "Canonicalize graph nodes") \ - \ - develop(bool, PrintCanonicalization, false, \ - "Print graph node canonicalization") \ - \ - develop(bool, UseTableRanges, true, \ - "Faster versions of lookup table using ranges") \ - \ - develop(intx, NestedInliningSizeRatio, 90, \ - "Percentage of prev. allowed inline size in recursive inlining") \ - range(0, 100) \ - \ - notproduct(bool, PrintIRWithLIR, false, \ - "Print IR instructions with generated LIR") \ - \ - notproduct(bool, PrintLIRWithAssembly, false, \ - "Show LIR instruction with generated assembly") \ - \ - develop(bool, CommentedAssembly, trueInDebug, \ - "Show extra info in PrintNMethods output") \ - \ - develop(bool, LIRTracePeephole, false, \ - "Trace peephole optimizer") \ - \ - develop(bool, LIRTraceExecution, false, \ - "add LIR code which logs the execution of blocks") \ - \ - product_pd(bool, LIRFillDelaySlots, \ - "fill delays on on SPARC with LIR") \ - \ - develop_pd(bool, CSEArrayLength, \ - "Create separate nodes for length in array accesses") \ - \ - develop_pd(bool, TwoOperandLIRForm, \ - "true if LIR requires src1 and dst to match in binary LIR ops") \ - \ - develop(intx, TraceLinearScanLevel, 0, \ - "Debug levels for the linear scan allocator") \ - range(0, 4) \ - \ - develop(bool, StressLinearScan, false, \ - "scramble block order used by LinearScan (stress test)") \ - \ - product(bool, TimeLinearScan, false, \ - "detailed timing of LinearScan phases") \ - \ - develop(bool, TimeEachLinearScan, false, \ - "print detailed timing of each LinearScan run") \ - \ - develop(bool, CountLinearScan, false, \ - "collect statistic counters during LinearScan") \ - \ - /* C1 variable */ \ - \ - develop(bool, C1Breakpoint, false, \ - "Sets a breakpoint at entry of each compiled method") \ - \ - develop(bool, ImplicitDiv0Checks, true, \ - "Use implicit division by zero checks") \ - \ - develop(bool, PinAllInstructions, false, \ - "All instructions are pinned") \ - \ - develop(bool, UseFastNewInstance, true, \ - "Use fast inlined instance allocation") \ - \ - develop(bool, UseFastNewTypeArray, true, \ - "Use fast inlined type array allocation") \ - \ - develop(bool, UseFastNewObjectArray, true, \ - "Use fast inlined object array allocation") \ - \ - develop(bool, UseFastLocking, true, \ - "Use fast inlined locking code") \ - \ - develop(bool, UseSlowPath, false, \ - "For debugging: test slow cases by always using them") \ - \ - develop(bool, GenerateArrayStoreCheck, true, \ - "Generates code for array store checks") \ - \ - develop(bool, DeoptC1, true, \ - "Use deoptimization in C1") \ - \ - develop(bool, PrintBailouts, false, \ - "Print bailout and its reason") \ - \ - develop(bool, TracePatching, false, \ - "Trace patching of field access on uninitialized classes") \ - \ - develop(bool, PatchALot, false, \ - "Marks all fields as having unloaded classes") \ - \ - develop(bool, PrintNotLoaded, false, \ - "Prints where classes are not loaded during code generation") \ - \ - develop(bool, PrintLIR, false, \ - "print low-level IR") \ - \ - develop(bool, BailoutAfterHIR, false, \ - "bailout of compilation after building of HIR") \ - \ - develop(bool, BailoutAfterLIR, false, \ - "bailout of compilation after building of LIR") \ - \ - develop(bool, BailoutOnExceptionHandlers, false, \ - "bailout of compilation for methods with exception handlers") \ - \ - develop(bool, InstallMethods, true, \ - "Install methods at the end of successful compilations") \ - \ - develop(intx, NMethodSizeLimit, (64*K)*wordSize, \ - "Maximum size of a compiled method.") \ - range(0, max_jint) \ - \ - develop(bool, TraceFPUStack, false, \ - "Trace emulation of the FPU stack (intel only)") \ - \ - develop(bool, TraceFPURegisterUsage, false, \ - "Trace usage of FPU registers at start of blocks (intel only)") \ - \ - develop(bool, OptimizeUnsafes, true, \ - "Optimize raw unsafe ops") \ - \ - develop(bool, PrintUnsafeOptimization, false, \ - "Print optimization of raw unsafe ops") \ - \ - develop(intx, InstructionCountCutoff, 37000, \ - "If GraphBuilder adds this many instructions, bails out") \ - range(0, max_jint) \ - \ - develop(bool, ComputeExactFPURegisterUsage, true, \ - "Compute additional live set for fpu registers to simplify fpu stack merge (Intel only)") \ - \ - product(bool, C1ProfileCalls, true, \ - "Profile calls when generating code for updating MDOs") \ - \ - product(bool, C1ProfileVirtualCalls, true, \ - "Profile virtual calls when generating code for updating MDOs") \ - \ - product(bool, C1ProfileInlinedCalls, true, \ - "Profile inlined calls when generating code for updating MDOs") \ - \ - product(bool, C1ProfileBranches, true, \ - "Profile branches when generating code for updating MDOs") \ - \ - product(bool, C1ProfileCheckcasts, true, \ - "Profile checkcasts when generating code for updating MDOs") \ - \ - product(bool, C1OptimizeVirtualCallProfiling, true, \ - "Use CHA and exact type results at call sites when updating MDOs")\ - \ - product(bool, C1UpdateMethodData, trueInTiered, \ - "Update MethodData*s in Tier1-generated code") \ - \ - develop(bool, PrintCFGToFile, false, \ - "print control flow graph to a separate file during compilation") \ - \ +#include "utilities/macros.hpp" +#if COMPILER1 +#include "runtime/flags/jvmFlag.hpp" + // Printing +NOTPROD_FLAG(bool, PrintC1Statistics, false, JVMFlag::DEFAULT, + "Print Compiler1 statistics"); + +DEVELOP_FLAG(bool, PrintInitialBlockList, false, JVMFlag::DEFAULT, + "Print block list of BlockListBuilder"); + +NOTPROD_FLAG(bool, PrintCFG, false, JVMFlag::DEFAULT, + "Print control flow graph after each change"); + +NOTPROD_FLAG(bool, PrintCFG0, false, JVMFlag::DEFAULT, + "Print control flow graph after construction"); + +NOTPROD_FLAG(bool, PrintCFG1, false, JVMFlag::DEFAULT, + "Print control flow graph after optimizations"); + +NOTPROD_FLAG(bool, PrintCFG2, false, JVMFlag::DEFAULT, + "Print control flow graph before code generation"); + +NOTPROD_FLAG(bool, PrintIRDuringConstruction, false, JVMFlag::DEFAULT, + "Print IR as it's being constructed (helpful for debugging frontend)"); + +NOTPROD_FLAG(bool, PrintPhiFunctions, false, JVMFlag::DEFAULT, + "Print phi functions when they are created and simplified"); + +NOTPROD_FLAG(bool, PrintIR, false, JVMFlag::DEFAULT, + "Print full intermediate representation after each change"); + +NOTPROD_FLAG(bool, PrintIR0, false, JVMFlag::DEFAULT, + "Print full intermediate representation after construction"); + +NOTPROD_FLAG(bool, PrintIR1, false, JVMFlag::DEFAULT, + "Print full intermediate representation after optimizations"); + +NOTPROD_FLAG(bool, PrintIR2, false, JVMFlag::DEFAULT, + "Print full intermediate representation before code generation"); + +NOTPROD_FLAG(bool, PrintSimpleStubs, false, JVMFlag::DEFAULT, + "Print SimpleStubs"); + + + // C1 optimizations +DEVELOP_FLAG(bool, UseC1Optimizations, true, JVMFlag::DEFAULT, + "Turn on C1 optimizations"); + +DEVELOP_FLAG(bool, SelectivePhiFunctions, true, JVMFlag::DEFAULT, + "create phi functions at loop headers only when necessary"); + +DEVELOP_FLAG(bool, OptimizeIfOps, true, JVMFlag::DEFAULT, + "Optimize multiple IfOps"); + +DEVELOP_FLAG(bool, DoCEE, true, JVMFlag::DEFAULT, + "Do Conditional Expression Elimination to simplify CFG"); + +DEVELOP_FLAG(bool, PrintCEE, false, JVMFlag::DEFAULT, + "Print Conditional Expression Elimination"); + +DEVELOP_FLAG(bool, UseLocalValueNumbering, true, JVMFlag::DEFAULT, + "Use Local Value Numbering (embedded in GraphBuilder)"); + +DEVELOP_FLAG(bool, UseGlobalValueNumbering, true, JVMFlag::DEFAULT, + "Use Global Value Numbering (separate phase)"); + +PRODUCT_FLAG(bool, UseLoopInvariantCodeMotion, true, JVMFlag::DEFAULT, + "Simple loop invariant code motion for short loops during GVN"); + +DEVELOP_FLAG(bool, TracePredicateFailedTraps, false, JVMFlag::DEFAULT, + "trace runtime traps caused by predicate failure"); + +DEVELOP_FLAG(bool, StressLoopInvariantCodeMotion, false, JVMFlag::DEFAULT, + "stress loop invariant code motion"); + +DEVELOP_FLAG(bool, TraceRangeCheckElimination, false, JVMFlag::DEFAULT, + "Trace Range Check Elimination"); + +DEVELOP_FLAG(bool, AssertRangeCheckElimination, false, JVMFlag::DEFAULT, + "Assert Range Check Elimination"); + +DEVELOP_FLAG(bool, StressRangeCheckElimination, false, JVMFlag::DEFAULT, + "stress Range Check Elimination"); + +DEVELOP_FLAG(bool, PrintValueNumbering, false, JVMFlag::DEFAULT, + "Print Value Numbering"); + +PRODUCT_FLAG(intx, ValueMapInitialSize, 11, JVMFlag::RANGE, + "Initial size of a value map"); + FLAG_RANGE( ValueMapInitialSize, 1, NOT_LP64(1*K) LP64_ONLY(32*K)); + +PRODUCT_FLAG(intx, ValueMapMaxLoopSize, 8, JVMFlag::RANGE, + "maximum size of a loop optimized by global value numbering"); + FLAG_RANGE( ValueMapMaxLoopSize, 0, 128); + +DEVELOP_FLAG(bool, EliminateBlocks, true, JVMFlag::DEFAULT, + "Eliminate unneccessary basic blocks"); + +DEVELOP_FLAG(bool, PrintBlockElimination, false, JVMFlag::DEFAULT, + "Print basic block elimination"); + +DEVELOP_FLAG(bool, EliminateNullChecks, true, JVMFlag::DEFAULT, + "Eliminate unneccessary null checks"); + +DEVELOP_FLAG(bool, PrintNullCheckElimination, false, JVMFlag::DEFAULT, + "Print null check elimination"); + +DEVELOP_FLAG(bool, EliminateFieldAccess, true, JVMFlag::DEFAULT, + "Optimize field loads and stores"); + +DEVELOP_FLAG(bool, InlineMethodsWithExceptionHandlers, true, JVMFlag::DEFAULT, + "Inline methods containing exception handlers " + "(NOTE: does not work with current backend)"); + +PRODUCT_FLAG(bool, InlineSynchronizedMethods, true, JVMFlag::DEFAULT, + "Inline synchronized methods"); + +PRODUCT_FLAG(bool, InlineNIOCheckIndex, true, JVMFlag::DIAGNOSTIC, + "Intrinsify java.nio.Buffer.checkIndex"); + +DEVELOP_FLAG(bool, CanonicalizeNodes, true, JVMFlag::DEFAULT, + "Canonicalize graph nodes"); + +DEVELOP_FLAG(bool, PrintCanonicalization, false, JVMFlag::DEFAULT, + "Print graph node canonicalization"); + +DEVELOP_FLAG(bool, UseTableRanges, true, JVMFlag::DEFAULT, + "Faster versions of lookup table using ranges"); + +DEVELOP_FLAG(intx, NestedInliningSizeRatio, 90, JVMFlag::RANGE, + "Percentage of prev. allowed inline size in recursive inlining"); + FLAG_RANGE( NestedInliningSizeRatio, 0, 100); + +NOTPROD_FLAG(bool, PrintIRWithLIR, false, JVMFlag::DEFAULT, + "Print IR instructions with generated LIR"); + +NOTPROD_FLAG(bool, PrintLIRWithAssembly, false, JVMFlag::DEFAULT, + "Show LIR instruction with generated assembly"); + +DEVELOP_FLAG(bool, CommentedAssembly, trueInDebug, JVMFlag::DEFAULT, + "Show extra info in PrintNMethods output"); + +DEVELOP_FLAG(bool, LIRTracePeephole, false, JVMFlag::DEFAULT, + "Trace peephole optimizer"); + +DEVELOP_FLAG(bool, LIRTraceExecution, false, JVMFlag::DEFAULT, + "add LIR code which logs the execution of blocks"); + +PRODUCT_FLAG_PD(bool, LIRFillDelaySlots, JVMFlag::DEFAULT, + "fill delays on on SPARC with LIR"); + +DEVELOP_FLAG_PD(bool, CSEArrayLength, JVMFlag::DEFAULT, + "Create separate nodes for length in array accesses"); + +DEVELOP_FLAG_PD(bool, TwoOperandLIRForm, JVMFlag::DEFAULT, + "true if LIR requires src1 and dst to match in binary LIR ops"); + +DEVELOP_FLAG(intx, TraceLinearScanLevel, 0, JVMFlag::RANGE, + "Debug levels for the linear scan allocator"); + FLAG_RANGE( TraceLinearScanLevel, 0, 4); + +DEVELOP_FLAG(bool, StressLinearScan, false, JVMFlag::DEFAULT, + "scramble block order used by LinearScan (stress test)"); + +PRODUCT_FLAG(bool, TimeLinearScan, false, JVMFlag::DEFAULT, + "detailed timing of LinearScan phases"); + +DEVELOP_FLAG(bool, TimeEachLinearScan, false, JVMFlag::DEFAULT, + "print detailed timing of each LinearScan run"); + +DEVELOP_FLAG(bool, CountLinearScan, false, JVMFlag::DEFAULT, + "collect statistic counters during LinearScan"); + + + // C1 variable +DEVELOP_FLAG(bool, C1Breakpoint, false, JVMFlag::DEFAULT, + "Sets a breakpoint at entry of each compiled method"); + +DEVELOP_FLAG(bool, ImplicitDiv0Checks, true, JVMFlag::DEFAULT, + "Use implicit division by zero checks"); + +DEVELOP_FLAG(bool, PinAllInstructions, false, JVMFlag::DEFAULT, + "All instructions are pinned"); + +DEVELOP_FLAG(bool, UseFastNewInstance, true, JVMFlag::DEFAULT, + "Use fast inlined instance allocation"); + +DEVELOP_FLAG(bool, UseFastNewTypeArray, true, JVMFlag::DEFAULT, + "Use fast inlined type array allocation"); + +DEVELOP_FLAG(bool, UseFastNewObjectArray, true, JVMFlag::DEFAULT, + "Use fast inlined object array allocation"); + +DEVELOP_FLAG(bool, UseFastLocking, true, JVMFlag::DEFAULT, + "Use fast inlined locking code"); + +DEVELOP_FLAG(bool, UseSlowPath, false, JVMFlag::DEFAULT, + "For debugging: test slow cases by always using them"); + +DEVELOP_FLAG(bool, GenerateArrayStoreCheck, true, JVMFlag::DEFAULT, + "Generates code for array store checks"); + +DEVELOP_FLAG(bool, DeoptC1, true, JVMFlag::DEFAULT, + "Use deoptimization in C1"); + +DEVELOP_FLAG(bool, PrintBailouts, false, JVMFlag::DEFAULT, + "Print bailout and its reason"); + +DEVELOP_FLAG(bool, TracePatching, false, JVMFlag::DEFAULT, + "Trace patching of field access on uninitialized classes"); + +DEVELOP_FLAG(bool, PatchALot, false, JVMFlag::DEFAULT, + "Marks all fields as having unloaded classes"); + +DEVELOP_FLAG(bool, PrintNotLoaded, false, JVMFlag::DEFAULT, + "Prints where classes are not loaded during code generation"); + +DEVELOP_FLAG(bool, PrintLIR, false, JVMFlag::DEFAULT, + "print low-level IR"); + +DEVELOP_FLAG(bool, BailoutAfterHIR, false, JVMFlag::DEFAULT, + "bailout of compilation after building of HIR"); + +DEVELOP_FLAG(bool, BailoutAfterLIR, false, JVMFlag::DEFAULT, + "bailout of compilation after building of LIR"); + +DEVELOP_FLAG(bool, BailoutOnExceptionHandlers, false, JVMFlag::DEFAULT, + "bailout of compilation for methods with exception handlers"); + +DEVELOP_FLAG(bool, InstallMethods, true, JVMFlag::DEFAULT, + "Install methods at the end of successful compilations"); + +DEVELOP_FLAG(intx, NMethodSizeLimit, (64*K)*wordSize, JVMFlag::RANGE, + "Maximum size of a compiled method."); + FLAG_RANGE( NMethodSizeLimit, 0, max_jint); + +DEVELOP_FLAG(bool, TraceFPUStack, false, JVMFlag::DEFAULT, + "Trace emulation of the FPU stack (intel only)"); + +DEVELOP_FLAG(bool, TraceFPURegisterUsage, false, JVMFlag::DEFAULT, + "Trace usage of FPU registers at start of blocks (intel only)"); + +DEVELOP_FLAG(bool, OptimizeUnsafes, true, JVMFlag::DEFAULT, + "Optimize raw unsafe ops"); + +DEVELOP_FLAG(bool, PrintUnsafeOptimization, false, JVMFlag::DEFAULT, + "Print optimization of raw unsafe ops"); + +DEVELOP_FLAG(intx, InstructionCountCutoff, 37000, JVMFlag::RANGE, + "If GraphBuilder adds this many instructions, bails out"); + FLAG_RANGE( InstructionCountCutoff, 0, max_jint); + +DEVELOP_FLAG(bool, ComputeExactFPURegisterUsage, true, JVMFlag::DEFAULT, + "Compute additional live set for fpu registers to simplify fpu stack merge (Intel only)"); + +PRODUCT_FLAG(bool, C1ProfileCalls, true, JVMFlag::DEFAULT, + "Profile calls when generating code for updating MDOs"); + +PRODUCT_FLAG(bool, C1ProfileVirtualCalls, true, JVMFlag::DEFAULT, + "Profile virtual calls when generating code for updating MDOs"); + +PRODUCT_FLAG(bool, C1ProfileInlinedCalls, true, JVMFlag::DEFAULT, + "Profile inlined calls when generating code for updating MDOs"); + +PRODUCT_FLAG(bool, C1ProfileBranches, true, JVMFlag::DEFAULT, + "Profile branches when generating code for updating MDOs"); + +PRODUCT_FLAG(bool, C1ProfileCheckcasts, true, JVMFlag::DEFAULT, + "Profile checkcasts when generating code for updating MDOs"); + +PRODUCT_FLAG(bool, C1OptimizeVirtualCallProfiling, true, JVMFlag::DEFAULT, + "Use CHA and exact type results at call sites when updating MDOs"); + +PRODUCT_FLAG(bool, C1UpdateMethodData, trueInTiered, JVMFlag::DEFAULT, + "Update MethodData*s in Tier1-generated code"); + +DEVELOP_FLAG(bool, PrintCFGToFile, false, JVMFlag::DEFAULT, + "print control flow graph to a separate file during compilation"); +#endif // COMPILER1 #endif // SHARE_C1_C1_GLOBALS_HPP