-
Notifications
You must be signed in to change notification settings - Fork 734
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
State based hashcode for value types #15529
Comments
This is related to #15497. JCL has a private helper in class |
@ehrenjulzert will be look at this. |
Doing call-in inside existing native method |
As we discussed in #15880, implementing hashcodes for value types natively will be difficult and require changes to the GC. It also may not be worth it to sink too too much time into the native implementation since the spec may change in the future to remove the need to hash value types at all. For this reason I've decided to instead make a temporary implementation purely in Java which just calls the |
- Add valueHashCode function to J9VMInternals.java and call it from Object.java - Create new native helper function positiveOnlyHashcodes to check if hashcodes are all positive - Change DDR's hashcode command to display an error when trying to get the hashcode of a valuetype for eclipse-openj9#15529 Signed-off-by: Ehren Julien-Neitzert <[email protected]>
- Add valueHashCode function to J9VMInternals.java and call it from Object.java - Create new native helper function positiveOnlyHashcodes to check if hashcodes are all positive - Change DDR's hashcode command to display an error when trying to get the hashcode of a valuetype - Update java_lang_invoke_MethodHandleNatives.cpp to ensure that the MN_FLATTENED flag is set correctly for eclipse-openj9#15529 Signed-off-by: Ehren Julien-Neitzert <[email protected]>
Tests code added in PR eclipse-openj9#15922 Part of solution of issue eclipse-openj9#15529 Signed-off-by: Ehren Julien-Neitzert <[email protected]>
This can be closed. |
Issue Number: 15529 |
The hash code of a value type should be based on its state rather than the identity (address).
Currently OpenJ9 still calculates the hash code of value types using its address rather than its value.
The text was updated successfully, but these errors were encountered: