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

2021-12-21 Thread amirhadadi
nt length) { >> if (offset < 0 || count < 0 || offset > length - count) { >> throw new StringIndexOutOfBoundsException( >> "offset " + offset + ", count " + count + ", length " + length); >> } >> } >

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

2021-12-18 Thread amirhadadi
- java.lang.String::<init>@196 (line 548) >> 0.17%│ 0x7f6b88eb6092: mov%r10d,%edx >> 0.39%│ 0x7f6b88eb6095: inc%edx >>;*iinc {reexecute=0 rethrow=0 return_oop=0} >>│

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

2021-12-14 Thread amirhadadi
On Tue, 14 Dec 2021 13:20:46 GMT, Alan Bateman 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 includ