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

Jorn Vernee jbvernee at xs4all.nl
Thu May 16 13:18:30 UTC 2019


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.

---

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.

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