[foreign-abi] RFR 8236004: Memory access var handles should support MemoryAddress carrier

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Dec 16 15:33:44 UTC 2019


Hi,
this patch adds support for MemoryAddress as a possible carrier for 
memory access var handles

http://cr.openjdk.java.net/~mcimadamore/panama/8236004_v2/

To allow for safe creation of memory addresses, the new var handles use 
the same trick we used for 'forged' addresses - that is, they return an 
address based on the Nothing segment.

The patch tweaks var handle generation a bit in order to generate 
slightly sharper (unerased) signatures; after some chats with Paul it 
was clear that the fact that Object was being used as the VarHandle 
'receiver' param was more of a leftover from normal VarHandle code (e.g. 
field access), where using Object allows us to share the var forms more 
easily. But memory access VarHandles always end up using MemoryAddress 
as a receiver - so there's no possible gain there, and the code becomes 
cleaner by using the sharper type, so it seems like a good deal.

Maurizio




More information about the panama-dev mailing list