Skip to content

8359920: Use names for frame types in stackmaps#25870

Closed
coleenp wants to merge 7 commits intoopenjdk:masterfrom
coleenp:tags
Closed

8359920: Use names for frame types in stackmaps#25870
coleenp wants to merge 7 commits intoopenjdk:masterfrom
coleenp:tags

Conversation

@coleenp
Copy link
Contributor

@coleenp coleenp commented Jun 18, 2025

This uses names for frame types for stackmaps in the verifier and redefinition.
Tested with tier1-7.


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-8359920: Use names for frame types in stackmaps (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25870

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 18, 2025

👋 Welcome back coleenp! 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 Jun 18, 2025

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

8359920: Use names for frame types in stackmaps

Reviewed-by: dholmes, jsjolen, matsaave, sspitsyn

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 80 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 openjdk bot added the rfr Pull request is ready for review label Jun 18, 2025
@openjdk
Copy link

openjdk bot commented Jun 18, 2025

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

  • hotspot
  • serviceability

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 serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Jun 18, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 18, 2025

Webrevs

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

@matias9927 matias9927 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Comment on lines 152 to 154
SAME_FRAME = 64,
SAME_LOCALS_1_STACK_ITEM_FRAME = 128,
SAME_LOCALS_1_STACK_ITEM_EXTENDED = 247,
Copy link
Member

Choose a reason for hiding this comment

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

I find these definitions a little confusing. SAME_FRAME is actually 0-63, with SAME_LOCALS_1_STACK_ITEM_FRAME being 64-127. Given many of these frame types imply tag ranges it may be clearer to define enum's for the start and end of ranges as applicable eg.

enum {
  SAME_FRAME_START = 0,
  SAME_FRAME_END = 63,
  SAME_LOCALS_1_STACK_ITEM_FRAME_START = 64,
  SAME_LOCALS_1_STACK_ITEM_FRAME_END = 127,
  RESERVED_START = 128,
  RESERVED_END = 246,
  SAME_LOCALS_1_STACK_ITEM_EXTENDED = 247,
  CHOP_FRAME_START = 248,
  CHOP_FRAME_END = 250,
  SAME_FRAME_EXTENDED = 251,
  APPEND_FRAME_START = 252,
  APPEND_FRAME_END = 254,
  FULL_FRAME = 255
}

and then adjust the code usage as appropriate e.g.

if (frame_type <= SAME_FRAME_END) {
...
if (frame_type <= SAME_LOCALS_1_STACK_ITEM_FRAME_END) {
  if (_first) {
    offset = frame_type - SAME_LOCALS_1_STACK_ITEM_FRAME_START;
...

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't really up for a big rewrite but having the complete set of names would be really good.

Copy link
Contributor

@sspitsyn sspitsyn left a comment

Choose a reason for hiding this comment

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

This looks good.
I was also thinking about frame_type ranges but no ideas on any improvements.

Co-authored-by: David Holmes <62092539+dholmes-ora@users.noreply.github.com>
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jun 20, 2025
@coleenp
Copy link
Contributor Author

coleenp commented Jun 20, 2025

tiers 1-4 passed with changes suggested by @dholmes-ora

Copy link
Contributor

@matias9927 matias9927 left a comment

Choose a reason for hiding this comment

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

Updated change looks good!

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

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Thanks for applying this @coleenp !

I have a couple of suggested changes that to me make it more obvious what case(s) we are dealing with, but up to you whether to apply them or not. The more I look at this code the more it cries out to be restructured, to me.

Thanks

coleenp and others added 3 commits June 23, 2025 08:00
Co-authored-by: David Holmes <62092539+dholmes-ora@users.noreply.github.com>
Co-authored-by: David Holmes <62092539+dholmes-ora@users.noreply.github.com>
Co-authored-by: David Holmes <62092539+dholmes-ora@users.noreply.github.com>
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jun 23, 2025
Copy link
Contributor Author

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

Yes, I like all of these changes. One would have prevented me from a transient bug I had. @matias9927 and I chatted about restructuring this code in the future which seems like a good idea. All in all, these tags and your suggestions are really helpful.

Also verified and am testing your suggested changes.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Thanks Coleen!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 24, 2025
@coleenp
Copy link
Contributor Author

coleenp commented Jun 24, 2025

I think this came out really well. Thanks for your suggestions, David. Thanks for reviewing Matias, Serguei and Johan.
/integrate

@openjdk
Copy link

openjdk bot commented Jun 24, 2025

Going to push as commit 28e96e3.
Since your change was applied there have been 82 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 Jun 24, 2025
@openjdk openjdk bot closed this Jun 24, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 24, 2025
@openjdk
Copy link

openjdk bot commented Jun 24, 2025

@coleenp Pushed as commit 28e96e3.

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

@coleenp coleenp deleted the tags branch June 24, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Development

Successfully merging this pull request may close these issues.

5 participants