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

Propagate known key info to ConcurrentHashMap.get #21439

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

nbhuiyan
Copy link
Member

@nbhuiyan nbhuiyan commented Mar 20, 2025

ConcurrentHashMap.get is similar in nature to HashMap.get operations, and we can benefit from compile-time folding of various queries such as Object.hashCode() if the object being passed as arg is known and fixed. For that to be possible, we need to ensure that the caller method of ConcurrentHashMap.get() undergoes peeking IL-gen so that the object information can be passed down and used.

In Draft state until further testing is done.

ConcurrentHashMap.get is similar in nature to HashMap.get operations,
and we can benefit from compile-time folding of various queries such
as Object.hashCode() if the object being passed as arg is known and
fixed. For that to be possible, we need to ensure that the caller
method of ConcurrentHashMap.get() undergoes peeking IL-gen so that
the object information can be passed down and used.

Signed-off-by: Nazim Bhuiyan <[email protected]>
@nbhuiyan nbhuiyan marked this pull request as ready for review March 24, 2025 15:02
@nbhuiyan nbhuiyan requested a review from dsouzai as a code owner March 24, 2025 15:02
@nbhuiyan
Copy link
Member Author

@vijaysun-omr requesting review

@vijaysun-omr
Copy link
Contributor

jenkins test sanity all jdk21

@vijaysun-omr
Copy link
Contributor

I think you felt that put methods (in HashMap ConcurrentHashMap etc.) are bigger and so it is better to limit this kind of change to the get paths. I am fine with this view for now. I think we might also have the put paths be called less often than get following logic that is similar to expecting loads of any variable to be more frequent than stores.

@nbhuiyan
Copy link
Member Author

All the tests have passed.

@vijaysun-omr vijaysun-omr merged commit 2a3f826 into eclipse-openj9:master Mar 25, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants