Skip to content
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

Reduce the number of VM_isStable messages #21067

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

Conversation

mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Feb 4, 2025

The frontend query isStable(J9Class *fieldClass, int32_t cpIndex) determines if the field at given J9Class and cpIndex has the @stable annotation.
Before this commit, the JITServer implementation had to send a VM_isStable message to the client for every such query. This commit implements caching of the isStable values at JITServer. Caching is done with a hashtable per J9Class, where the key is the cpIndex we are interested in.
To further reduce the number of the hashtables that serve as a cache, the isStable() will answer false for any non-bootstrap class. The reason is that at the moment only bootstrap classs have the @stable annotation. This behavior can be disabled by defining the following environment variable:
TR_DontIgnoreStableAnnotationForUserClasses.
Another optimization regards the implementation of isArrayWithStableElements(cpIndex, owningMethod, comp). In here, we first check to see if we are dealing with an array (which is simpler) and only then call the isStable() query.

Depends on eclipse-omr/omr#7642

@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Feb 4, 2025
@mpirvu mpirvu requested a review from dsouzai as a code owner February 4, 2025 20:58
The frontend query `isStable(J9Class *fieldClass, int32_t cpIndex)`
determines if the field at given J9Class and cpIndex has the
@stable annotation.
Before this commit, the JITServer implementation had to send a
VM_isStable message to the client for every such query.
This commit implements caching of the isStable values at JITServer.
Caching is done with a hashtable per J9Class, where the key is
the cpIndex we are interested in.
To further reduce the number of the hashtables that serve as a
cache, the `isStable()` will answer `false` for any non-bootstrap
class. The reason is that at the moment only bootstrap classs have
the @stable annotation. This behavior can be disabled by defining
the following environment variable:
`TR_DontIgnoreStableAnnotationForUserClasses`.
Another optimization regards the implementation of
`isArrayWithStableElements(cpIndex, owningMethod, comp)`. In here,
we first check to see if we are dealing with an array (which is
simpler) and only then call the isStable() query.

Signed-off-by: Marius Pirvu <[email protected]>
@mpirvu mpirvu force-pushed the jitserver_cpu_debug branch from 46411b1 to 28f6ed8 Compare February 4, 2025 21:35
@mpirvu mpirvu added the depends:omr Pull request is dependent on a corresponding change in OMR label Feb 4, 2025
@dsouzai
Copy link
Contributor

dsouzai commented Feb 5, 2025

jenkins test sanity.functional xlinux,xlinuxjit,plinuxjit,zlinuxjit jdk21 depends eclipse-omr/omr#7642

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jitserver Artifacts related to JIT-as-a-Service project depends:omr Pull request is dependent on a corresponding change in OMR
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants