-
Notifications
You must be signed in to change notification settings - Fork 737
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
Fall back to out-of-line call to StringUTF16.toBytes #19953
Conversation
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>
@knn-k, may I ask you to review this change? |
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>
@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. |
@0xdaryl, may I ask you to review this change? |
Jenkins test sanity all jdk21 |
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. |
The implementation of
StringUTF16.toBytes
will throw aNegativeArraySizeException
if the specified array length is negative or anOutOfMemoryError
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 aNegativeArraySizeException
in situations where the actual implementation would throw anOutOfMemoryError
.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