[foreign-memaccess] RFR 8225172: Add way to create deref VarHandles without using the Layout API
Jorn Vernee
jbvernee at xs4all.nl
Mon Jun 3 16:38:34 UTC 2019
Hi,
I've implemented an alternative way of creating memory access
VarHandles, which bypasses the Layout API. One reason for having such an
alternative API is that it offers users the opportunity to use their own
(pre-existing) layout APIs when creating VarHandles. This mainly
consists of a builder API called MemoryAccessVarHandleBuilder, which can
be used similarly to LayoutPath to construct a VarHandle.
As a side effect I've removed the dependency on Layout/LayoutPath from
VarHandles::makeMemoryAddressViewHandle. I think this decoupling makes
this API point more suited to what's possible to do with memory access
VarHandles.
Bug: https://bugs.openjdk.java.net/browse/JDK-8225172
Webrev:
http://cr.openjdk.java.net/~jvernee/panama/webrevs/8225172/webrev.01/
Added tests are pretty minimal since the resulting VarHandle is already
tested by the existing tests using the Layout API.
This also opens up the possibility of removing the Layout API altogether
if we wanted. Another TODO is adding a way to disable alignment checking
upon access (which would need changes to the VarHandle impl classes I
think).
Thanks,
Jorn
More information about the panama-dev
mailing list