I have one concern with byte conversion - now the arguments to 
StringUTF16.putChar is sign extended instead of zero extended. We need to 
ensure sign extension does not affect the intrinsics, maybe need static asserts 
to ensure all elements of the digit byte arrays are positive so we won't run 
into trouble with signed vs zero extension.

Once we can address this UTF16 risk, I think we are fine with the latin1 
usages, and storing the digits as a byte array is indeed more memory efficient 
and is a good cleanup.

Regards,
Chen Liang
________________________________
From: core-libs-dev <core-libs-dev-r...@openjdk.org> on behalf of wenshao 
<shaojin.we...@alibaba-inc.com>
Sent: Friday, May 23, 2025 10:47 PM
To: core-libs-dev <core-libs-dev@openjdk.org>
Subject: Integer::digits should be defined as byte[]

Now Integer/Long uses Integer::digits to convert to byte, so we should define 
Integer::digits as byte[], which can avoid the conversion.

-
Shaojin Wen

Reply via email to