8241495: Make more compiler related flags available on a per method level

add more method-level options  for -XX:CompileCommand
eg. -XX:CompileCommand=option,java.lang.String::startsWith,BreakAtCompile directs JIT compilers to hit BREAKPOINT when they compile the method java.lang.String::startsWith.

Reviewed-by: neliasso, azeemj, phh
This commit is contained in:
Xin Liu 2020-10-29 17:41:57 +00:00 committed by Paul Hohensee
parent 5c520c3fdd
commit 2a50c3f810
2 changed files with 3 additions and 3 deletions

View File

@ -322,7 +322,6 @@ class DirectiveSetPtr {
// - if some option is changed we need to copy directiveset since it no longer can be shared
// - Need to free copy after use
// - Requires a modified bit so we don't overwrite options that is set by directives
DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle& method) {
// Early bail out - checking all options is expensive - we rely on them not being used
// Only set a flag if it has not been modified and value changes.
@ -360,6 +359,7 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(const methodHandle
}
// inline and dontinline (including exclude) are implemented in the directiveset accessors
// ignore flags whose cc_flags are X
#define init_default_cc(name, type, dvalue, cc_flag) { type v; if (!_modified[name##Index] && CompilerOracle::has_option_value(method, #cc_flag, v) && v != this->name##Option) { set.cloned()->name##Option = v; } }
compilerdirectives_common_flags(init_default_cc)
compilerdirectives_c2_flags(init_default_cc)

View File

@ -36,8 +36,8 @@
#define compilerdirectives_common_flags(cflags) \
cflags(Enable, bool, false, X) \
cflags(Exclude, bool, false, X) \
cflags(BreakAtExecute, bool, false, X) \
cflags(BreakAtCompile, bool, false, X) \
cflags(BreakAtExecute, bool, false, BreakAtExecute) \
cflags(BreakAtCompile, bool, false, BreakAtCompile) \
cflags(Log, bool, LogCompilation, X) \
cflags(PrintAssembly, bool, PrintAssembly, PrintAssembly) \
cflags(PrintInlining, bool, PrintInlining, PrintInlining) \