Skip to content

8379695: [lworld] Update GCBasher to use value classes#2215

Closed
lmesnik wants to merge 3 commits intoopenjdk:lworldfrom
lmesnik:8379695
Closed

8379695: [lworld] Update GCBasher to use value classes#2215
lmesnik wants to merge 3 commits intoopenjdk:lworldfrom
lmesnik:8379695

Conversation

@lmesnik
Copy link
Copy Markdown
Member

@lmesnik lmesnik commented Mar 11, 2026

The GCbasher si a GC stress test that create a lot of different objects and arrays.

It would be makes sense to update it to create a lot of different value classes and arrays of value types. It helps to ensure that GC works with different type of classes.

Please, note that after this fix GCbasher is going to enable preview always.
Do we want to keep original test while value classes are still preview feature?
I think that it is not needed, however if someone thinks it is good idea, I can add gcbasher-nopreview and keep until we start removing @enablePreview from our tests.

In the long term the problem might be that some structure are flattened, and test start generating less objects. However they are much more diverse now.

UPDATE. There are 3 possible approaches to maintain value/non-value classes

  1. keep old version of gcbahser
  2. keep value/non-value classes in different directories and have 2 tests with different @compile commands to choose different files
  3. add @ValueClass annotation and support javac plugin that change value class attribute during compilation. In this case we need to add 'PREVEW_MODE' when tests are compiles with --enable-preview and this pluign.

The 2) and 3) might work well to maintain value/non-value variants of tests. While it looks overcompilcated for gcbasher. So I prefer to either have 'gcbasher-novalue' or use only variant with --enable-preview.


Progress

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

Issue

  • JDK-8379695: [lworld] Update GCBasher to use value classes (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2215

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2215.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Mar 11, 2026

👋 Welcome back lmesnik! A progress list of the required criteria for merging this PR into lworld 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
Copy Markdown

openjdk bot commented Mar 11, 2026

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

8379695: [lworld] Update GCBasher to use value classes

Reviewed-by: phubner

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 118 new commits pushed to the lworld 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 lworld branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 11, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Mar 11, 2026

Webrevs

Copy link
Copy Markdown
Member

@Arraying Arraying 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 for working on this!

Please, note that after this fix GCbasher is going to enable preview always.
Do we want to keep original test while value classes are still preview feature?
I think that it is not needed, however if someone thinks it is good idea, I can add gcbasher-nopreview and keep until we start removing @enablePreview from our tests.

My opinion is that we would lose quite a bit of test coverage w/o preview if we get rid of GCBasher. I think I'd like to see both, at least over a transitionary period.

keep old version of gcbahser

I think this would be the pragmatic choice. However, we should probably introduce a comment in both source files indicating that they are mirrored.

@lmesnik
Copy link
Copy Markdown
Member Author

lmesnik commented Mar 27, 2026

I think this would be the pragmatic choice. However, we should probably introduce a comment in both source files indicating that they are mirrored.
Agree, let wait for https://bugs.openjdk.org/browse/JDK-8380084 is implemented and use annotation to mark value classes so gcbasher might works with and without --enable-preview.

Copy link
Copy Markdown
Member

@Arraying Arraying left a comment

Choose a reason for hiding this comment

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

Looks fine. My understanding is that javac will automatically run the required plugin when --enable-preview is provided so nothing changes on the test side of things.

import java.util.HashSet;
import java.util.Set;

@jdk.test.lib.valueclass.AsValueClass
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While it is good to have as many value classes as possible, I am not sure what we gain here. But I guess it could be worth testing nonetheless.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 7, 2026
@lmesnik
Copy link
Copy Markdown
Member Author

lmesnik commented Apr 7, 2026

/integrate

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 7, 2026

Going to push as commit 92c5e58.
Since your change was applied there have been 120 commits pushed to the lworld branch:

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 7, 2026

@lmesnik Pushed as commit 92c5e58.

💡 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

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants