On Mon, 4 Dec 2023 14:58:34 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template >> line 594: >> >>> 592: @ForceInline >>> 593: static int indexRO(ByteBuffer bb, int index) { >>> 594: if (bb.isReadOnly()) >> >> I have to think that there was a reason for using unsafe access in the >> current code. So, I'm not sure if it's safe to switch this to a direct >> method/field reference. > > @PaulSandoz Do you remember the history here? I don't recall exactly but the unsafe usage is likely to avoid possible profile pollution due to the abstract method call. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15854#discussion_r1414197423