[foreign-memaccess] RFR 8224039: Remove unnecessary layout classes

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu May 16 13:20:15 UTC 2019


On 16/05/2019 14:18, Jorn Vernee wrote:
> Very nice!
>
> You can also remove this check in VarHandles.java:
>
>     LayoutPath path2 = path;
>     while (path2 != null) {
>         if (path2.enclosing() != null &&
>             path2.enclosing().layout() instanceof Value) {
>             throw new IllegalArgumentException("Cannot dereference 
> path into Value container");
>         }
>         path2 = path2.enclosing();
>     }
>
> Otherwise looks good.
Thanks - good point - I'll fix and push
>
> ---
>
> Also, this is unrelated, but noticed it now: the Layout class javadoc 
> mentions: "A layout is always associated with a size (in bits)."
>
> But, since we have unbounded sequences this is no longer true, and 
> Layout::bitSize() can throw an UnsupportedOperationException if it's a 
> Sequence.

True - good catch, I will address in followup misc improvements to 
Layout API.

Maurizio

>
> Cheers,
> Jorn
>
> Maurizio Cimadamore schreef op 2019-05-16 15:04:
>> Hi,
>> this patch removes layout subclasses which were deemed unnecessary for
>> this memory access API:
>>
>> * Address (this API is about contiguous memory access)
>> * Unresolved (by name references is especially useful in combination
>> with pointers)
>>
>> This patch also removes the Value::contents method, on the basis that
>> for now there's nothing sensible the API can do with it (this will
>> change once we can rely upon the Vector API).
>>
>> Note: the removed layouts are not gone forever, and will likely be
>> re-added by higher level layers.
>>
>> Webrev:
>>
>> http://cr.openjdk.java.net/~mcimadamore/panama/8224039/
>>
>> Cheers
>> Maurizio


More information about the panama-dev mailing list