Skip to content

8362968: [JVMCI] support modifying locals in StackIntrospection on virtual threads #26422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tkrodriguez
Copy link
Contributor

@tkrodriguez tkrodriguez commented Jul 22, 2025

This a draft of adding support for JVMTI deferred locals on virtual threads. The JDK issue has a more full description but basically I'd like some feedback on whether the strategy seems ok and whether full JVMTI support for deferred locals would be a desired outcome. If it's not then I might be able to recast this in a way that is more JVMCI specific so it requires fewer changes to the core JVMTI deferred locals support which is probably the scariest looking part. Maybe @AlanBateman and @kevinjwalls could offer some opinions here?

For the deopt/loom interactions I tried to make the use of the chunk for heap frames fairly explicit as the absolutized heap frames make me nervous. But maybe I'm just making it too complicated?


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-8362968: [JVMCI] support modifying locals in StackIntrospection on virtual threads (Enhancement - P3)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26422

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 22, 2025

👋 Welcome back never! 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 Jul 22, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Jul 22, 2025

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

  • graal
  • 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.

@sspitsyn
Copy link
Contributor

sspitsyn commented Jul 24, 2025

@tkrodriguez Thank you for working on this! I'll look at the JVMTI and related changes but it is going to take some time.

@AlanBateman
Copy link
Contributor

For the traditional usage, in the debugger, then it's not clear to me if it's worth having JVMTI deferred locals work with virtual threads. In the debugger it should be rare to want to change a local that is not in the top frame. So I think this is more about the Truffle usage.

@eregon
Copy link
Contributor

eregon commented Jul 28, 2025

In the debugger it should be rare to want to change a local that is not in the top frame.

I think it would be as likely as wanting to change a local that is not in the top frame for a platform thread.
Given that that is supported and is useful, I think it is worthwhile to support it for virtual threads too.

@tkrodriguez
Copy link
Contributor Author

That doesn't necessarily have to be addressed in this PR. If this change lands then in the future it would be possible to support it in JVMTI with some minor additional changes. If there was stronger interest in supporting JVMTI with this change then it would be additional motivation for the changes.

@tkrodriguez
Copy link
Contributor Author

@AlanBateman I don't know all the details of stackChunkOop management and one of my assumptions is that JavaThread::exit would have the chance to clean up any live frames that have jvmtiDeferredLocals. Otherwise we would leak this storage. Is that a reasonable assumption or is it possible for a virtual JavaThread to just be reclaimed by GC?

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

Successfully merging this pull request may close these issues.

4 participants