mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8256508: Improve CompileCommand flag
Reviewed-by: redestad, kvn
This commit is contained in:
parent
7aed9b65d0
commit
cfb175dfdf
22 changed files with 796 additions and 482 deletions
|
@ -30,17 +30,91 @@
|
|||
|
||||
class methodHandle;
|
||||
|
||||
|
||||
// CompilerOracle is an interface for turning on and off compilation
|
||||
// for some methods
|
||||
|
||||
// OPTION_TYPES: type, name
|
||||
#define OPTION_TYPES(type) \
|
||||
type(Intx, "intx") \
|
||||
type(Uintx, "uintx") \
|
||||
type(Bool, "bool") \
|
||||
type(Ccstr, "ccstr") \
|
||||
type(Ccstrlist, "ccstrlist") \
|
||||
type(Double, "double")
|
||||
|
||||
// COMPILECOMMAND_OPTIONS: option, name, variant, type
|
||||
#define COMPILECOMMAND_OPTIONS(option) \
|
||||
option(Help, "help", Unknown) \
|
||||
option(Quiet, "quiet", Unknown) \
|
||||
option(Log, "log", Bool) \
|
||||
option(Print, "print", Bool) \
|
||||
option(Inline, "inline", Bool) \
|
||||
option(DontInline, "dontinline", Bool) \
|
||||
option(CompileOnly, "compileonly", Bool)\
|
||||
option(Exclude, "exclude", Bool) \
|
||||
option(Break, "break", Bool) \
|
||||
option(BreakAtExecute, "BreakAtExecute", Bool) \
|
||||
option(BreakAtCompile, "BreakAtCompile", Bool) \
|
||||
option(PrintAssembly, "PrintAssembly", Bool) \
|
||||
option(PrintInlining, "PrintInlining", Bool) \
|
||||
option(PrintIntrinsics, "PrintIntrinsics", Bool) \
|
||||
option(PrintNMethods, "PrintNMethods", Bool) \
|
||||
option(PrintOptoAssembly, "PrintOptoAssembly", Bool) \
|
||||
option(PrintDebugInfo, "PrintDebugInfo", Bool) \
|
||||
option(PrintRelocations, "PrintRelocations", Bool) \
|
||||
option(PrintDependencies, "PrintDependencies", Bool) \
|
||||
option(BackgroundCompilation, "BackgroundCompilation", Bool) \
|
||||
option(RepeatCompilation, "RepeatCompilation", Intx) \
|
||||
option(ReplayInline, "ReplayInline", Bool) \
|
||||
option(DumpReplay, "DumpReplay", Bool) \
|
||||
option(DumpInline, "DumpInline", Bool) \
|
||||
option(CompileThresholdScaling, "CompileThresholdScaling", Double) \
|
||||
option(ControlIntrinsic, "ControlIntrinsic", Ccstrlist) \
|
||||
option(DisableIntrinsic, "DisableIntrinsic", Ccstrlist) \
|
||||
option(NoRTMLockEliding, "NoRTMLockEliding", Bool) \
|
||||
option(UseRTMLockEliding, "UseRTMLockEliding", Bool) \
|
||||
option(BlockLayoutByFrequency, "BlockLayoutByFrequency", Bool) \
|
||||
option(TraceOptoPipelining, "TraceOptoPipelining", Bool) \
|
||||
option(TraceOptoOutput, "TraceOptoOutput", Bool) \
|
||||
option(TraceSpilling, "TraceSpilling", Bool) \
|
||||
option(PrintIdeal, "PrintIdeal", Bool) \
|
||||
option(IGVPrintLevel, "IGVPrintLevel", Intx) \
|
||||
option(Vectorize, "Vectorize", Bool) \
|
||||
option(VectorizeDebug, "VectorizeDebug", Uintx) \
|
||||
option(CloneMapDebug, "CloneMapDebug", Bool) \
|
||||
option(MaxNodeLimit, "MaxNodeLimit", Intx) \
|
||||
NOT_PRODUCT(option(TestOptionInt, "TestOptionInt", Intx)) \
|
||||
NOT_PRODUCT(option(TestOptionUint, "TestOptionUint", Uintx)) \
|
||||
NOT_PRODUCT(option(TestOptionBool, "TestOptionBool", Bool)) \
|
||||
NOT_PRODUCT(option(TestOptionBool2, "TestOptionBool2", Bool)) \
|
||||
NOT_PRODUCT(option(TestOptionStr, "TestOptionStr", Ccstr)) \
|
||||
NOT_PRODUCT(option(TestOptionList, "TestOptionList", Ccstrlist)) \
|
||||
NOT_PRODUCT(option(TestOptionDouble, "TestOptionDouble", Double)) \
|
||||
option(Option, "option", Unknown) \
|
||||
option(Unknown, "unknown", Unknown)
|
||||
|
||||
enum class CompileCommand {
|
||||
#define enum_of_options(option, name, ctype) option,
|
||||
COMPILECOMMAND_OPTIONS(enum_of_options)
|
||||
#undef enum_of_options
|
||||
Count
|
||||
};
|
||||
|
||||
enum class OptionType {
|
||||
#define enum_of_types(type, name) type,
|
||||
OPTION_TYPES(enum_of_types)
|
||||
#undef enum_of_types
|
||||
Unknown
|
||||
};
|
||||
|
||||
class CompilerOracle : AllStatic {
|
||||
private:
|
||||
static bool _quiet;
|
||||
static void print_tip();
|
||||
static void print_parse_error(const char*& error_msg, char* original_line);
|
||||
static void print_parse_error(char* error_msg, char* original_line);
|
||||
static void print_command(enum CompileCommand option, const char* name, enum OptionType type);
|
||||
|
||||
public:
|
||||
|
||||
// True if the command file has been specified or is implicit
|
||||
static bool has_command_file();
|
||||
|
||||
|
@ -49,7 +123,7 @@ class CompilerOracle : AllStatic {
|
|||
|
||||
// Tells whether we to exclude compilation of method
|
||||
static bool should_exclude(const methodHandle& method);
|
||||
static bool should_exclude_quietly() { return _quiet; }
|
||||
static bool be_quiet() { return _quiet; }
|
||||
|
||||
// Tells whether we want to inline this method
|
||||
static bool should_inline(const methodHandle& method);
|
||||
|
@ -66,25 +140,28 @@ class CompilerOracle : AllStatic {
|
|||
// Tells whether to break when compiling method
|
||||
static bool should_break_at(const methodHandle& method);
|
||||
|
||||
// Check to see if this method has option set for it
|
||||
static bool has_option_string(const methodHandle& method, const char * option);
|
||||
// Tells whether there are any methods to print for print_method_statistics()
|
||||
static bool should_print_methods();
|
||||
|
||||
// A wrapper for checking bool options
|
||||
static bool has_option(const methodHandle& method, enum CompileCommand option);
|
||||
|
||||
// Check if method has option and value set. If yes, overwrite value and return true,
|
||||
// otherwise leave value unchanged and return false.
|
||||
template<typename T>
|
||||
static bool has_option_value(const methodHandle& method, const char* option, T& value);
|
||||
|
||||
// Fast check if there is any option available that compile control needs to know about
|
||||
static bool has_any_option();
|
||||
static bool has_option_value(const methodHandle& method, enum CompileCommand option, T& value, bool verfiy_type = false);
|
||||
|
||||
// Reads from string instead of file
|
||||
static void parse_from_string(const char* command_string, void (*parser)(char*));
|
||||
|
||||
static void parse_from_string(const char* option_string, void (*parser)(char*));
|
||||
static void parse_from_line(char* line);
|
||||
static void parse_compile_only(char * line);
|
||||
static void parse_compile_only(char* line);
|
||||
|
||||
// Tells whether there are any methods to print for print_method_statistics()
|
||||
static bool should_print_methods();
|
||||
// Fast check if there is any option set that compile control needs to know about
|
||||
static bool has_any_command_set();
|
||||
|
||||
// convert a string to a proper compilecommand option - used from whitebox.
|
||||
// returns CompileCommand::Unknown on names not matching an option.
|
||||
static enum CompileCommand string_to_option(const char* name);
|
||||
};
|
||||
|
||||
#endif // SHARE_COMPILER_COMPILERORACLE_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue