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

Adjust bound for out-of-line call to StringUTF16.toBytes #20058

Merged

Conversation

hzongaro
Copy link
Member

@hzongaro hzongaro commented Aug 26, 2024

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.

Fixes: #20021

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
Copy link
Member Author

hzongaro commented Aug 26, 2024

@0xdaryl, may I ask you to review this change? It represents an adjustment to the bounds introduced in Pull Request #19953 that are used to decide whether to perform an out-of-line call to StringUTF16.toBytes. This is needed due to a difference in JDK level 23 versus earlier versions.

@hzongaro hzongaro requested a review from 0xdaryl August 26, 2024 12:54
@hzongaro
Copy link
Member Author

Jenkins test sanity,sanity.openjdk all jdk21,jdk23

@0xdaryl
Copy link
Contributor

0xdaryl commented Aug 27, 2024

The code changes look fine, but can you sort through all the test failures to see if there are any real ones in there pertaining to this PR?

@0xdaryl 0xdaryl self-assigned this Aug 27, 2024
@0xdaryl 0xdaryl merged commit 2dc5264 into eclipse-openj9:master Aug 27, 2024
31 of 41 checks passed
@pshipton
Copy link
Member

Pls create PRs for 0.47 and 0.48

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.

OpenJDK java/lang/String/CompactString/MaxSizeUTF16String -XX:-CompactStrings failing some platforms
3 participants