> Simplify the layout access var handles to be direct in some common cases. > Also made `VarHandle::isAccessModeSupported` report if an access mode is > supported for a VH. > > Reduces the instructions to execute this code in a simple main by 47%: > > long[] arr = new long[8]; > var ms = MemorySegment.ofArray(arr); > ms.setAtIndex(ValueLayout.JAVA_BYTE, 12, (byte) 3); > > > Main overheads in FFM are identified to be: > 1. Eager initialization of direct MethodHandle; can be CDS archived > 2. MH combinator forms via LambdaFormEditor, not cached right now and always > have large overhead > > Still need other measures to deal with common user patterns of > `MethodHandles.insertCoordinates(vh, 1, 0L)` which currently is still very > slow. > > Tests: 2 unrelated failures on tier 1-3
Chen Liang has updated the pull request incrementally with one additional commit since the last revision: noStride -> constantOffset, optimize VH classes to have only 2 instead of 3 classes for each type ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23720/files - new: https://git.openjdk.org/jdk/pull/23720/files/d59ff23a..e5839fb8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23720&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23720&range=03-04 Stats: 606 lines in 6 files changed: 28 ins; 30 del; 548 mod Patch: https://git.openjdk.org/jdk/pull/23720.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23720/head:pull/23720 PR: https://git.openjdk.org/jdk/pull/23720