RFR: 8336258: Document the behavior of 'exclude' and 'compileonly' with respect to inlining

Tobias Hartmann thartmann at openjdk.org
Thu Jul 18 11:41:32 UTC 2024


On Thu, 11 Jul 2024 16:40:46 GMT, Volker Simonis <simonis at openjdk.org> wrote:

> The long-standing behavior of the `exclude` CompileCommand is to also apply to inlined versions of a method. On the other hand, the `compileonly` CompileCommand only affects top-level compilations of a method and not its inlining behavior.
> 
> The rational behind this decision is that `exclude` is intended to be used in production to workaround compiler crashes or bad compilations for certain methods and in these scenarios it usually doesn't matter if a "bad" method is getting compiled on the top level or if it gets inlined into another compilation unit.
> 
> The "inconsistent inlining behavior with CompileOnly" thread on hotspot-compiler-dev discusses this behavior (see [1]). The answer [2] specifically describes this long-standing behavior.
> 
> I think it would be good to document this behavior in the output of `-XX:CompileCommand=help`
> 
> [1] https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2016-June/thread.html#23575
> [2] https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2016-June/023583.html

I think "still" needs to come after "can". I'm not a native speaker though.

src/hotspot/share/compiler/compilerOracle.cpp line 642:

> 640:   tty->print_cr("The 'exclude' command excludes methods from top-level compilations as well as");
> 641:   tty->print_cr("from inlining whereas the 'compileonly' command only excludes methods from");
> 642:   tty->print_cr("top-level compilations (i.e. they still can be inlined into other compilation units).");

Suggestion:

  tty->print_cr("top-level compilations (i.e. they can still be inlined into other compilation units).");

-------------

Changes requested by thartmann (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20142#pullrequestreview-2185571020
PR Review Comment: https://git.openjdk.org/jdk/pull/20142#discussion_r1682690679


More information about the hotspot-compiler-dev mailing list