Path: blob/master/src/hotspot/share/compiler/compiler_globals.hpp
40930 views
/*1* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_COMPILER_COMPILER_GLOBALS_HPP25#define SHARE_COMPILER_COMPILER_GLOBALS_HPP2627#include "compiler/compiler_globals_pd.hpp"28#include "runtime/globals_shared.hpp"29#ifdef COMPILER130#include "c1/c1_globals.hpp"31#endif // COMPILER132#ifdef COMPILER233#include "opto/c2_globals.hpp"34#endif // COMPILER235#if INCLUDE_JVMCI36#include "jvmci/jvmci_globals.hpp"37#endif3839// TODO -- currently, even if all JIT compilers are disabled, the following flags40// are still available in HotSpot. This should eventually be fixed ...4142#define COMPILER_FLAGS(develop, \43develop_pd, \44product, \45product_pd, \46notproduct, \47range, \48constraint) \49\50/* compiler interface */ \51\52develop(bool, CIPrintCompilerName, false, \53"when CIPrint is active, print the name of the active compiler") \54\55product(bool, CIPrintCompileQueue, false, DIAGNOSTIC, \56"display the contents of the compile queue whenever a " \57"compilation is enqueued") \58\59develop(bool, CIPrintRequests, false, \60"display every request for compilation") \61\62product(bool, CITime, false, \63"collect timing information for compilation") \64\65develop(bool, CITimeVerbose, false, \66"be more verbose in compilation timings") \67\68develop(bool, CITimeEach, false, \69"display timing information after each successful compilation") \70\71develop(bool, CICountOSR, false, \72"use a separate counter when assigning ids to osr compilations") \73\74develop(bool, CICompileNatives, true, \75"compile native methods if supported by the compiler") \76\77develop_pd(bool, CICompileOSR, \78"compile on stack replacement methods if supported by the " \79"compiler") \80\81develop(bool, CIPrintMethodCodes, false, \82"print method bytecodes of the compiled code") \83\84develop(bool, CIPrintTypeFlow, false, \85"print the results of ciTypeFlow analysis") \86\87develop(bool, CITraceTypeFlow, false, \88"detailed per-bytecode tracing of ciTypeFlow analysis") \89\90product(bool, CICompilerCountPerCPU, false, \91"1 compiler thread for log(N CPUs)") \92\93notproduct(intx, CICrashAt, -1, \94"id of compilation to trigger assert in compiler thread for " \95"the purpose of testing, e.g. generation of replay data") \96\97notproduct(bool, CIObjectFactoryVerify, false, \98"enable potentially expensive verification in ciObjectFactory") \99\100develop(intx, CIStart, 0, \101"The id of the first compilation to permit") \102\103develop(intx, CIStop, max_jint, \104"The id of the last compilation to permit") \105\106develop(intx, CIStartOSR, 0, \107"The id of the first osr compilation to permit " \108"(CICountOSR must be on)") \109\110develop(intx, CIStopOSR, max_jint, \111"The id of the last osr compilation to permit " \112"(CICountOSR must be on)") \113\114develop(intx, CIBreakAtOSR, -1, \115"The id of osr compilation to break at") \116\117develop(intx, CIBreakAt, -1, \118"The id of compilation to break at") \119\120/* recompilation */ \121\122product(double, CompileThresholdScaling, 1.0, \123"Factor to control when first compilation happens " \124"(both with and without tiered compilation): " \125"values greater than 1.0 delay counter overflow, " \126"values between 0 and 1.0 rush counter overflow, " \127"value of 1.0 leaves compilation thresholds unchanged " \128"value of 0.0 is equivalent to -Xint. " \129"" \130"Flag can be set as per-method option. " \131"If a value is specified for a method, compilation thresholds " \132"for that method are scaled by both the value of the global flag "\133"and the value of the per-method flag.") \134range(0.0, DBL_MAX) \135\136product(intx, Tier0InvokeNotifyFreqLog, 7, \137"Interpreter (tier 0) invocation notification frequency") \138range(0, 30) \139\140product(intx, Tier2InvokeNotifyFreqLog, 11, \141"C1 without MDO (tier 2) invocation notification frequency") \142range(0, 30) \143\144product(intx, Tier3InvokeNotifyFreqLog, 10, \145"C1 with MDO profiling (tier 3) invocation notification " \146"frequency") \147range(0, 30) \148\149product(intx, Tier23InlineeNotifyFreqLog, 20, \150"Inlinee invocation (tiers 2 and 3) notification frequency") \151range(0, 30) \152\153product(intx, Tier0BackedgeNotifyFreqLog, 10, \154"Interpreter (tier 0) invocation notification frequency") \155range(0, 30) \156\157product(intx, Tier2BackedgeNotifyFreqLog, 14, \158"C1 without MDO (tier 2) invocation notification frequency") \159range(0, 30) \160\161product(intx, Tier3BackedgeNotifyFreqLog, 13, \162"C1 with MDO profiling (tier 3) invocation notification " \163"frequency") \164range(0, 30) \165\166product(intx, Tier2CompileThreshold, 0, \167"threshold at which tier 2 compilation is invoked") \168range(0, max_jint) \169\170product(intx, Tier2BackEdgeThreshold, 0, \171"Back edge threshold at which tier 2 compilation is invoked") \172range(0, max_jint) \173\174product(intx, Tier3InvocationThreshold, 200, \175"Compile if number of method invocations crosses this " \176"threshold") \177range(0, max_jint) \178\179product(intx, Tier3MinInvocationThreshold, 100, \180"Minimum invocation to compile at tier 3") \181range(0, max_jint) \182\183product(intx, Tier3CompileThreshold, 2000, \184"Threshold at which tier 3 compilation is invoked (invocation " \185"minimum must be satisfied)") \186range(0, max_jint) \187\188product(intx, Tier3BackEdgeThreshold, 60000, \189"Back edge threshold at which tier 3 OSR compilation is invoked") \190range(0, max_jint) \191\192product(intx, Tier4InvocationThreshold, 5000, \193"Compile if number of method invocations crosses this " \194"threshold") \195range(0, max_jint) \196\197product(intx, Tier4MinInvocationThreshold, 600, \198"Minimum invocation to compile at tier 4") \199range(0, max_jint) \200\201product(intx, Tier4CompileThreshold, 15000, \202"Threshold at which tier 4 compilation is invoked (invocation " \203"minimum must be satisfied)") \204range(0, max_jint) \205\206product(intx, Tier4BackEdgeThreshold, 40000, \207"Back edge threshold at which tier 4 OSR compilation is invoked") \208range(0, max_jint) \209\210product(intx, Tier0Delay, 20, DIAGNOSTIC, \211"If C2 queue size grows over this amount per compiler thread " \212"do not start profiling in the interpreter") \213range(0, max_jint) \214\215product(intx, Tier3DelayOn, 5, \216"If C2 queue size grows over this amount per compiler thread " \217"stop compiling at tier 3 and start compiling at tier 2") \218range(0, max_jint) \219\220product(intx, Tier3DelayOff, 2, \221"If C2 queue size is less than this amount per compiler thread " \222"allow methods compiled at tier 2 transition to tier 3") \223range(0, max_jint) \224\225product(intx, Tier3LoadFeedback, 5, \226"Tier 3 thresholds will increase twofold when C1 queue size " \227"reaches this amount per compiler thread") \228range(0, max_jint) \229\230product(intx, Tier4LoadFeedback, 3, \231"Tier 4 thresholds will increase twofold when C2 queue size " \232"reaches this amount per compiler thread") \233range(0, max_jint) \234\235product(intx, TieredCompileTaskTimeout, 50, \236"Kill compile task if method was not used within " \237"given timeout in milliseconds") \238range(0, max_intx) \239\240product(intx, TieredStopAtLevel, 4, \241"Stop at given compilation level") \242range(0, 4) \243\244product(intx, Tier0ProfilingStartPercentage, 200, \245"Start profiling in interpreter if the counters exceed the " \246"specified percentage of tier 3 thresholds (tier 4 thresholds " \247"with CompilationMode=high-only|high-only-quick-internal)") \248range(0, max_jint) \249\250product(uintx, IncreaseFirstTierCompileThresholdAt, 50, \251"Increase the compile threshold for C1 compilation if the code " \252"cache is filled by the specified percentage") \253range(0, 99) \254\255product(intx, TieredRateUpdateMinTime, 1, \256"Minimum rate sampling interval (in milliseconds)") \257range(0, max_intx) \258\259product(intx, TieredRateUpdateMaxTime, 25, \260"Maximum rate sampling interval (in milliseconds)") \261range(0, max_intx) \262\263product(ccstr, CompilationMode, "default", \264"Compilation modes: " \265"default: normal tiered compilation; " \266"quick-only: C1-only mode; " \267"high-only: C2/JVMCI-only mode; " \268"high-only-quick-internal: C2/JVMCI-only mode, " \269"with JVMCI compiler compiled with C1.") \270\271product(bool, PrintTieredEvents, false, \272"Print tiered events notifications") \273\274product_pd(intx, OnStackReplacePercentage, \275"NON_TIERED number of method invocations/branches (expressed as " \276"% of CompileThreshold) before (re-)compiling OSR code") \277constraint(OnStackReplacePercentageConstraintFunc, AfterErgo) \278\279product(intx, InterpreterProfilePercentage, 33, \280"NON_TIERED number of method invocations/branches (expressed as " \281"% of CompileThreshold) before profiling in the interpreter") \282range(0, 100) \283\284/* compiler directives */ \285\286product(ccstrlist, CompileOnly, "", \287"List of methods (pkg/class.name) to restrict compilation to") \288\289product(ccstr, CompileCommandFile, NULL, \290"Read compiler commands from this file [.hotspot_compiler]") \291\292product(ccstr, CompilerDirectivesFile, NULL, DIAGNOSTIC, \293"Read compiler directives from this file") \294\295product(ccstrlist, CompileCommand, "", \296"Prepend to .hotspot_compiler; e.g. log,java/lang/String.<init>") \297\298develop(bool, ReplayCompiles, false, \299"Enable replay of compilations from ReplayDataFile") \300\301product(ccstr, ReplayDataFile, NULL, \302"File containing compilation replay information" \303"[default: ./replay_pid%p.log] (%p replaced with pid)") \304\305product(ccstr, InlineDataFile, NULL, \306"File containing inlining replay information" \307"[default: ./inline_pid%p.log] (%p replaced with pid)") \308\309develop(intx, ReplaySuppressInitializers, 2, \310"Control handling of class initialization during replay: " \311"0 - don't do anything special; " \312"1 - treat all class initializers as empty; " \313"2 - treat class initializers for application classes as empty; " \314"3 - allow all class initializers to run during bootstrap but " \315" pretend they are empty after starting replay") \316range(0, 3) \317\318develop(bool, ReplayIgnoreInitErrors, false, \319"Ignore exceptions thrown during initialization for replay") \320\321product(bool, DumpReplayDataOnError, true, \322"Record replay data for crashing compiler threads") \323\324product(bool, CompilerDirectivesIgnoreCompileCommands, false, DIAGNOSTIC, \325"Disable backwards compatibility for compile commands.") \326\327product(bool, CompilerDirectivesPrint, false, DIAGNOSTIC, \328"Print compiler directives on installation.") \329\330product(int, CompilerDirectivesLimit, 50, DIAGNOSTIC, \331"Limit on number of compiler directives.") \332\333/* Bytecode escape analysis estimation. */ \334\335product(bool, EstimateArgEscape, true, \336"Analyze bytecodes to estimate escape state of arguments") \337\338product(intx, BCEATraceLevel, 0, \339"How much tracing to do of bytecode escape analysis estimates " \340"(0-3)") \341range(0, 3) \342\343product(intx, MaxBCEAEstimateLevel, 5, \344"Maximum number of nested calls that are analyzed by BC EA") \345range(0, max_jint) \346\347product(intx, MaxBCEAEstimateSize, 150, \348"Maximum bytecode size of a method to be analyzed by BC EA") \349range(0, max_jint) \350\351/* misc compiler flags */ \352\353product(bool, AbortVMOnCompilationFailure, false, DIAGNOSTIC, \354"Abort VM when method had failed to compile.") \355\356develop(intx, OSROnlyBCI, -1, \357"OSR only at this bci. Negative values mean exclude that bci") \358\359develop(intx, DesiredMethodLimit, 8000, \360"The desired maximum method size (in bytecodes) after inlining") \361\362product(bool, DontCompileHugeMethods, true, \363"Do not compile methods > HugeMethodLimit") \364\365develop(intx, HugeMethodLimit, 8000, \366"Don't compile methods larger than this if " \367"+DontCompileHugeMethods") \368\369370// end of COMPILER_FLAGS371372DECLARE_FLAGS(COMPILER_FLAGS)373374#endif // SHARE_COMPILER_COMPILER_GLOBALS_HPP375376377