[foreign-abi] RFR 8236004: Memory access var handles should support MemoryAddress carrier
Paul Sandoz
paul.sandoz at oracle.com
Tue Dec 17 19:01:23 UTC 2019
> On Dec 17, 2019, at 10:47 AM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
>>
>> Yes, it works fine, until you pass an instance of something that is not of MemoryAddressProxy e.g. pass in an instance of String, which will get spoofed as an instance of MemoryAddressProxy. The guards will only check if the object is a reference type.
> Ok, I see what you mean, the problem is not that linking occurs abnormally, the problem is that the underlying linkage is not sound (in the absence of Java casts)
>
Yes, the linkage + invocation runtime checks are not sound.
> I guess this means that same treatment should also be applied to the MemoryAddressProxy parameter (e.g. of a VarHandle::set operation) right?
>
Yes, for all access modes where the arg of $type$ is of MemoryAddressProxy a cast check is required (which should optimize away).
I think that can be performed by the addr2long method?
Paul.
More information about the panama-dev
mailing list