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

[0.48.0] Adjust bound for out-of-line call to StringUTF16.toBytes #20078

Conversation

hzongaro
Copy link
Member

Recognized Call Transformer generates IL that implements an inline version of StringUTF16.toBytes for values in the range [0,0x3fffffff], and that falls back to calling the Java implementation otherwise. In JDK levels up to 22, the Java implementation throws an OutOfMemoryException if the length is greater than 0x3fffffff. JDK Level 23, however, was changed to throw an OutOfMemoryException if the length is greater than or equal to 0x3fffffff.

This change alters the IL that Recognized Call Transformer generates to fall back to the Java implementation if the length is greater than or equal to 0x3fffffff, so that it will work with all JDK levels.

Port of pull request #20058 to v0.48.0-release branch

Recognized Call Transformer generates IL that implements an inline
version of StringUTF16.toBytes for values in the range [0,0x3fffffff],
and that falls back to calling the Java implementation otherwise.  In
JDK levels up to 22, the Java implementation throws an
OutOfMemoryException if the length is greater than 0x3fffffff.  JDK
Level 23, however, was changed to throw an OutOfMemoryException if the
length is greater than or equal to 0x3fffffff.

This change alters the IL that Recognized Call Transformer generates to
fall back to the Java implementation if the length is greater than
or equal to 0x3fffffff, so that it will work with all JDK levels.

Signed-off-by:  Henry Zongaro <[email protected]>
@hzongaro hzongaro requested a review from 0xdaryl August 28, 2024 18:39
@hzongaro
Copy link
Member Author

@0xdaryl, may I ask you to merge this change to the v0.48.0-release branch?

@pshipton - FYI

@0xdaryl 0xdaryl merged commit 02469a0 into eclipse-openj9:v0.48.0-release Aug 28, 2024
2 checks passed
@hzongaro hzongaro deleted the string-constructor-exception-bound-v0.48.0 branch August 29, 2024 14:08
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.

2 participants