On Tue, 17 Jan 2023 07:43:07 GMT, Per Minborg <pminb...@openjdk.org> wrote:
>>> >>> Do you see any concrete examples of classes in the JDK that could benefit >>> from a "VarHandlization"? >> >> `ImageOutputStreamImpl` and `ImageInputStreamImpl` in >> `javax.imageio.stream` have some very similar code that might benefit. Also >> `DataInputStream` and `DataOutpuStream`could possibly use `Bits` directly. > >> > Do you see any concrete examples of classes in the JDK that could benefit >> > from a "VarHandlization"? >> >> `ImageOutputStreamImpl` and `ImageInputStreamImpl` in `javax.imageio.stream` >> have some very similar code that might benefit. Also `DataInputStream` and >> `DataOutpuStream`could possibly use `Bits` directly. > > Thanks @j3graham @minborg I guess that the same can be done for `MethodHandles.readInt()`, `ByteBuffer.getInt()`, `AESCrypt.implEncryptBlock()`. Btw, I see that unlike original code `VarHandle.get()` returns Object, not primitive. Won't we have excessive allocation with this change? ------------- PR: https://git.openjdk.org/jdk/pull/11840