Skip to content

8387552: [lworld] Add new capability to enable value objects support for JVMTI VMObjectAlloc and SampledObjectAlloc#2607

Closed
sspitsyn wants to merge 3 commits into
openjdk:lworldfrom
sspitsyn:8387552
Closed

8387552: [lworld] Add new capability to enable value objects support for JVMTI VMObjectAlloc and SampledObjectAlloc#2607
sspitsyn wants to merge 3 commits into
openjdk:lworldfrom
sspitsyn:8387552

Conversation

@sspitsyn

@sspitsyn sspitsyn commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

This update is for Valhalla pre-integration. It introduces new JVMTI capability can_support_value_objects.
The variable _can_support_value_objects_count is introduced for optimization. It follows the pattern of the can_support_virtual_threads capability.

Additionally, this update includes test fixes:

  • test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.cpp:

    • Removed the if (!jni->HasIdentity(object)) check because it is not needed anymore as the JVMTI capability can_support_value_objects is no acquired by the test
  • These two tests are updated to provide both positive and negative coverage for new capability:
    test/hotspot/jtreg/serviceability/jvmti/valhalla/VMObjectAllocValue
    test/hotspot/jtreg/serviceability/jvmti/valhalla/SampledObjectAllocValue

Testing:

  • Ran updated tests locally
  • Submitted mach5 tiers 1-6


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-8387552: [lworld] Add new capability to enable value objects support for JVMTI VMObjectAlloc and SampledObjectAlloc (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2607

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

Using diff file

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

Using Webrev

Link to Webrev Comment

…for JVMTI VMObjectAlloc and SampledObjectAlloc
@bridgekeeper

bridgekeeper Bot commented Jun 30, 2026

Copy link
Copy Markdown

👋 Welcome back sspitsyn! 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

openjdk Bot commented Jun 30, 2026

Copy link
Copy Markdown

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

8387552: [lworld] Add new capability to enable value objects support for JVMTI VMObjectAlloc and SampledObjectAlloc

Reviewed-by: lmesnik, cjplummer

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 16 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 Jun 30, 2026
@mlbridge

mlbridge Bot commented Jun 30, 2026

Copy link
Copy Markdown

Webrevs

@lmesnik lmesnik left a comment

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.

I reviewed the implementation and tests only, assuming that CSR will be approved.

The only general comment is that implementation doesn't check the '--enable-preview' so agent with enabled 'can_support_value_objects' is not going to fail.

Do we need a separate test for this?

Also, there is a general lack of coverage of this behaviour for multi environments/agents.

Might be needed to to file RFE to review './vmTestbase/nsk/jvmti/scenarios/multienv' and see if they should be updated or write new tests.

There are few comments inline.

Comment thread src/hotspot/share/prims/jvmtiExport.cpp
Comment thread src/hotspot/share/prims/jvmtiExport.cpp
@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jul 1, 2026
@sspitsyn

sspitsyn commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

The only general comment is that implementation doesn't check the '--enable-preview' so agent with enabled 'can_support_value_objects' is not going to fail. Do we need a separate test for this?

Thank you for looking at this change! This does not look as a real problem.
The runtime event paths already make the relevant behavioral decision from the actually allocated object:
const bool is_inline = object->is_inline();

Also, there is a general lack of coverage of this behaviour for multi environments/agents.
Might be needed to to file RFE to review './vmTestbase/nsk/jvmti/scenarios/multienv' and see if they should be updated or write new tests.

Yes. We have a lack of coverage in this area. I hope, it is not a stopper for this PR. :)

Comment thread src/hotspot/share/prims/jvmti.xml
Comment thread src/hotspot/share/prims/jvmti.xml

@plummercj plummercj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a little unclear to me how this all works when not in preview mode. Does the jvmti client still get to enable can_support_value_objects, but it has no affect.

Comment thread src/hotspot/share/prims/jvmti.xml Outdated
Comment thread src/hotspot/share/prims/jvmti.xml Outdated
@AlanBateman

AlanBateman commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

It's a little unclear to me how this all works when not in preview mode. Does the jvmti client still get to enable can_support_value_objects, but it has no affect.

I think this came up with can_support_virtual_threads capability when virtual threads were in preview. I think we concluded that it's benign as it needs both the capability and preview features be enabled.

@sspitsyn

sspitsyn commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Chris and Leonid, thank you for review!

@sspitsyn

sspitsyn commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/integrate

@openjdk

openjdk Bot commented Jul 2, 2026

Copy link
Copy Markdown

Going to push as commit 3a7e2e0.
Since your change was applied there have been 16 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 Jul 2, 2026
@openjdk openjdk Bot closed this Jul 2, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 2, 2026
@openjdk

openjdk Bot commented Jul 2, 2026

Copy link
Copy Markdown

@sspitsyn Pushed as commit 3a7e2e0.

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

@sspitsyn sspitsyn deleted the 8387552 branch July 2, 2026 06:27
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.

4 participants