RFR: 8278518: String(byte[], int, int, Charset) constructor and String.translateEscapes() miss bounds check elimination

Сергей Цыпанов duke at openjdk.java.net
Wed Dec 15 08:31:58 UTC 2021


On Tue, 14 Dec 2021 13:20:46 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>>> Originally this was spotted by by Amir Hadadi in https://stackoverflow.com/questions/70272651/missing-bounds-checking-elimination-in-string-constructor
>> 
>> Before anyone looks at this, can you confirm that the patch does not include any code or tests/benchmarks that were taken from SO?
>
>> @AlanBateman the benchmark is mine along with the changes for `translateEscapes` and `newStringUTF8NoRepl`, the change for constructor is from SO.
> 
> I don't know how we can progress this PR if the patch includes code copied from SO. Maybe the PR should be closed, the JBS issue unassigned, and leave it to someone else to start again? Maybe you could get Amit to sign the OCA and you co-contribute/author the PR? I can't look at the patch so I don't know how significant the changes, maybe there are other options.

@AlanBateman I suggest to decide first whether this should be fixed on HotSpot level (which is the best option to me) or on Java level.

If we choose HotSpot then the issue should be reassigned, because I cannot do the fix myself.

If we choose Java then I would revert the change for String constructor and Amir would commit it into this branch having OCA signed.

What do you think?

-------------

PR: https://git.openjdk.java.net/jdk/pull/6812


More information about the core-libs-dev mailing list