Skip to content

(0.44) JIT must narrow byte/short/char before storing #19108

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

Merged

Conversation

BradleyWood
Copy link
Member

@BradleyWood BradleyWood commented Mar 8, 2024

This commit ensures compliance with JVM spec regarding the handling of putstatic/putfield/withfield opcodes. This involves correctly narrowing integer values when storing them into fields of smaller types such as bool, byte, char, and short. For byte and short fields, narrowing involves conversion from integer to byte/short, then back to integer. For bool and char types, which are unsigned, narrowing entails ANDing the value with a mask matching the type width.

Issue: #16498

Port of #18904 for 0.44

This commit ensures compliance with JVM spec regarding the handling of
putstatic/putfield/withfield opcodes. This involves correctly narrowing
integer values when storing them into fields of smaller types such as
bool, byte, char, and short. For byte and short fields, narrowing
involves conversion from integer to byte/short, then back to integer.
For bool and char types, which are unsigned, narrowing entails ANDing
the value with a mask matching the type width.

Issue: eclipse-openj9#16498

Signed-off-by: Bradley Wood <[email protected]>
@hzongaro hzongaro merged commit e6840cd into eclipse-openj9:v0.44.0-release Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants