Skip to content

Conversation

@chhagedorn
Copy link
Member

@chhagedorn chhagedorn commented Mar 13, 2025

We currently only print a compilation bailout with -XX:+PrintCompilation:

7782 90 b 4 Test::main (19 bytes)
7792 90 b 4 Test::main (19 bytes) COMPILE SKIPPED: StressBailout

But not when using -XX:CompileCommand=printcompilation,*::*. This patch enables this.

Thanks,
Christian


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8351938: C2: Print compilation bailouts with PrintCompilation compile command (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24031/head:pull/24031
$ git checkout pull/24031

Update a local copy of the PR:
$ git checkout pull/24031
$ git pull https://git.openjdk.org/jdk.git pull/24031/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24031

View PR using the GUI difftool:
$ git pr show -t 24031

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24031.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 13, 2025

👋 Welcome back chagedorn! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Mar 13, 2025

@chhagedorn This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8351938: C2: Print compilation bailouts with PrintCompilation compile command

Reviewed-by: epeter, thartmann, kvn, galder

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 71 new commits pushed to the master branch:

  • e3c29c9: 8351556: Optimize Location.locationFor/isModuleOrientedLocation
  • a7a09f6: 8349632: RISC-V: Add Zfa fminm/fmaxm
  • 0454406: 8351987: ProblemList the failing JFR streaming tests on macOS
  • be36b23: 8351778: JIT compiler fails when running -XX:AOTMode=create
  • 7fc776e: 8270265: LineBreakMeasurer calculates incorrect line breaks with zero-width characters
  • 3da5e3f: 8349350: Unable to print using InputSlot and OutputBin print attributes at the same time
  • aa047ee: 8319192: Remove javax.swing.plaf.synth.SynthLookAndFeel.load(URL url)
  • cd1be91: 8319055: JCMD should not buffer the whole output of commands
  • 248c373: 8351266: JFR: -XX:StartFlightRecording:report-on-exit
  • 03ef79c: 8346470: Improve WriteBarrier JMH to have old-to-young refs
  • ... and 61 more: https://git.openjdk.org/jdk/compare/d90b79a2bd2f8bb6e50aa32aafe47748ef6ebeff...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 13, 2025
@openjdk
Copy link

openjdk bot commented Mar 13, 2025

@chhagedorn The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Mar 13, 2025
Copy link
Contributor

@eme64 eme64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, this has been bothering me for a while too!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 13, 2025
Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'll close JDK-8318890 as dup then ;)

@mlbridge
Copy link

mlbridge bot commented Mar 13, 2025

Webrevs

@chhagedorn
Copy link
Member Author

Thanks for your reviews!

I'll close JDK-8318890 as dup then ;)

Sounds good, thanks!

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

CompilationLog::log()->log_failure(thread, task, failure_reason, retry_message);
}
if (PrintCompilation) {
if (PrintCompilation || task->directive()->PrintCompilationOption) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good idea, but is this the only place where we want to do something when either -XX:+PrintCompilation or -XX:CompileCommand=printcompilation,*::* is set? IOW, shouldn't other checks for PrintCompilation also take -XX:CompileCommand=printcompilation,*::* into account?

E.g. line 2182 above does:

  if (directive->PrintCompilationOption) {
    ResourceMark rm;
    task->print_tty();
  }

Shouldn't that be:

if (PrintCompilation || directive->PrintCompilationOption) {
   ...
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally agree that there are other places where we have this mismatch - there are actually quite a few. This might require some more effort. I suggest to move forward with this small patch and file a separate RFE for revisiting other uses. What you do you think?

Copy link
Member Author

@chhagedorn chhagedorn Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there are also flags where we have this mismatch between global flag and compile command local flag. Maybe we should do a general pass over all the compile commands and check how we can align them better with their global flag.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sounds good

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed JDK-8352047.

@chhagedorn
Copy link
Member Author

Thank you all for your reviews!

/integrate

@openjdk
Copy link

openjdk bot commented Mar 14, 2025

Going to push as commit 65c5282.
Since your change was applied there have been 71 commits pushed to the master branch:

  • e3c29c9: 8351556: Optimize Location.locationFor/isModuleOrientedLocation
  • a7a09f6: 8349632: RISC-V: Add Zfa fminm/fmaxm
  • 0454406: 8351987: ProblemList the failing JFR streaming tests on macOS
  • be36b23: 8351778: JIT compiler fails when running -XX:AOTMode=create
  • 7fc776e: 8270265: LineBreakMeasurer calculates incorrect line breaks with zero-width characters
  • 3da5e3f: 8349350: Unable to print using InputSlot and OutputBin print attributes at the same time
  • aa047ee: 8319192: Remove javax.swing.plaf.synth.SynthLookAndFeel.load(URL url)
  • cd1be91: 8319055: JCMD should not buffer the whole output of commands
  • 248c373: 8351266: JFR: -XX:StartFlightRecording:report-on-exit
  • 03ef79c: 8346470: Improve WriteBarrier JMH to have old-to-young refs
  • ... and 61 more: https://git.openjdk.org/jdk/compare/d90b79a2bd2f8bb6e50aa32aafe47748ef6ebeff...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 14, 2025
@openjdk openjdk bot closed this Mar 14, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 14, 2025
@openjdk
Copy link

openjdk bot commented Mar 14, 2025

@chhagedorn Pushed as commit 65c5282.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@sendaoYan
Copy link
Member

Hi, this PR seems make same tests intermittent fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

6 participants