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

Fall back to out-of-line call to StringUTF16.toBytes #19953

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

hzongaro
Copy link
Member

@hzongaro hzongaro commented Jul 31, 2024

The implementation of StringUTF16.toBytes will throw a NegativeArraySizeException if the specified array length is negative or an OutOfMemoryError if the length is 2^30 or greater. The IL for the inline implementation that the JIT compiler generates for that recognized method could throw a NegativeArraySizeException in situations where the actual implementation would throw an OutOfMemoryError.

This change calls the actual implementation if the array length is outside the range [0,0x3fffffff] to ensure that the behaviour is always as expected in exceptional situations.

Fixes #19309

The implementation of StringUTF16.toBytes will throw a
NegativeArraySizeException if the specified array length is negative or
an OutOfMemoryError if the length is 2^30 or greater.  The IL for the
inline implementation that the JIT compiler generates for that
recognized method could throw a NegativeArraySizeException in situations
where the actual implementation would throw an OutOfMemoryError.

This change calls the actual implementation if the array length is
outside the range [0,0x3fffffff] to ensure that the expected behaviour
always results in exceptional situations.

Signed-off-by:  Henry Zongaro <zongaro@ca.ibm.com>
@hzongaro hzongaro marked this pull request as ready for review August 1, 2024 15:43
@hzongaro
Copy link
Member Author

hzongaro commented Aug 1, 2024

@knn-k, may I ask you to review this change?

@hzongaro hzongaro requested a review from knn-k August 1, 2024 15:45
@knn-k
Copy link
Contributor

knn-k commented Aug 2, 2024

I looked through the commit. It looked OK to me, but I am not familiar with manipulation of IL trees. I would like someone else to review.

This change corrects some typographical errors in the use of "fallback"
and "fall back."  When used as a noun, the correct word is fallback.
When used as a verb, it should be written "fall back"; when used as a
noun, the word is "fallback."

Signed-off-by:  Henry Zongaro <zongaro@ca.ibm.com>
@hzongaro
Copy link
Member Author

hzongaro commented Aug 2, 2024

@0xdaryl, may I ask you to review this change as well? Once changes have been approved, I will squash the commit that corrects the typos.

@hzongaro hzongaro requested a review from 0xdaryl August 2, 2024 13:17
@hzongaro
Copy link
Member Author

@0xdaryl, may I ask you to review this change?

@0xdaryl
Copy link
Contributor

0xdaryl commented Aug 19, 2024

Jenkins test sanity all jdk21

@0xdaryl 0xdaryl self-assigned this Aug 19, 2024
@0xdaryl
Copy link
Contributor

0xdaryl commented Aug 19, 2024

The Z JitServer failure has been seen before, and I don't think has anything to do with this PR.

No nodes are available for the Windows build.

@0xdaryl 0xdaryl merged commit 0bf7ed2 into eclipse-openj9:master Aug 19, 2024
13 of 16 checks passed
@hzongaro hzongaro deleted the string-constructor-exception branch August 27, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants