Skip to content

Conversation

@dougxc
Copy link
Member

@dougxc dougxc commented Apr 18, 2025

After JDK-8343789, the size of a JVMCINMethodData object is limited to uint16_t. This object embeds the value of InstalledCode.name so effectively imposes a limit on the name length. This PR establishes an upper limit on the name value as this name should only be for informative purposes when inspecting compiled code.

While debugging the problem that exposed the limit, it was confusing that -XX:+PrintCompilation did not show the name so this PR builds on JDK-8336760 to add the name in PrintCompilation output for JVMCI "hosted" methods.


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-8355034: [JVMCI] assert(static_cast<int>(_jvmci_data_size) == align_up(compiler->is_jvmci() ? jvmci_data->size() : 0, oopSize)) failed: failed: 104 != 16777320 (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24753

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 18, 2025

👋 Welcome back dnsimon! 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 Apr 18, 2025

@dougxc 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:

8355034: [JVMCI] assert(static_cast<int>(_jvmci_data_size) == align_up(compiler->is_jvmci() ? jvmci_data->size() : 0, oopSize)) failed: failed: 104 != 16777320

Reviewed-by: never, yzheng, cslucas

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 176 new commits pushed to the master branch:

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
Copy link

openjdk bot commented Apr 18, 2025

@dougxc The following labels will be automatically applied to this pull request:

  • graal
  • hotspot-compiler

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

@openjdk openjdk bot added graal graal-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org labels Apr 18, 2025
#define CHECKED_CAST(result, T, thing) \
result = static_cast<T>(thing); \
assert(static_cast<int>(result) == thing, "failed: %d != %d", static_cast<int>(result), thing);
guarantee(static_cast<int>(result) == thing, "failed: %d != %d", static_cast<int>(result), thing);
Copy link
Member Author

@dougxc dougxc Apr 18, 2025

Choose a reason for hiding this comment

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

This check is not on a hot path and so can afford to be a guarantee. That said, I've no strong objection to leaving it as an assert.

if (name != nullptr) {
stringStream st;
st.print_cr("(hosted JVMCI compilation: %s)", name);
CompileTask::print(tty, nm, st.as_string());
Copy link
Member Author

Choose a reason for hiding this comment

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

@JohnTortugo this may be of interest to you.

@dougxc dougxc marked this pull request as ready for review April 18, 2025 15:22
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 18, 2025
@mlbridge
Copy link

mlbridge bot commented Apr 18, 2025

Webrevs

@openjdk
Copy link

openjdk bot commented Apr 18, 2025

@dougxc Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

Copy link
Contributor

@tkrodriguez tkrodriguez 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 to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 18, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Apr 19, 2025
Copy link
Contributor

@mur47x111 mur47x111 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@JohnTortugo JohnTortugo left a comment

Choose a reason for hiding this comment

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

Thank you . LGTM

*/

/**
* @test
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: missing JBS entry ID.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not clear to me how useful that is as a single test file can be for numerous bugs over time and git log will show you all of them.

That said, I've added the id as you request.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 21, 2025
@dougxc
Copy link
Member Author

dougxc commented Apr 22, 2025

Thanks for the reviews.

/integrate

@openjdk
Copy link

openjdk bot commented Apr 22, 2025

Going to push as commit 2f7806f.
Since your change was applied there have been 179 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 22, 2025

@dougxc Pushed as commit 2f7806f.

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

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

Labels

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

Development

Successfully merging this pull request may close these issues.

4 participants