[foreign-memaccess] RFR 8235259: Java layout constants should use native endianness

John Rose john.r.rose at oracle.com
Wed Dec 4 20:00:34 UTC 2019


On Dec 4, 2019, at 7:50 AM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> 
> All this evidence seems to point to the fact that,perhaps having layout(Class) return a layout for array classes is not such a great idea - since this layout can easily be constructed using the layout API. 

Yep, it’s a puzzle, which seems to require the ability to reach out
from the main layout descriptor to a nearby stored value, which
supplies the length/count of the layout.  It reminds me of dependent
types, which is kind of scary but powerful.

If this were possible, then maybe a VH could be generated from such
an augmented layout, which would grab the length from the array
rather than from some other source (or no source, for an unsafe access).

In the old “minimal” LDL proposal, there was a way to express
the dependency, by making a ninja-like jump backwards from the
base address (&a[0]) to the length field, and then using the loaded
value to fill the length hole on the array’s element-group layout.
These moves (8a "lookbehind layout” and 14c “count hole” with
17 “path expression”) are all well beyond “minimal”.  I suppose
by “minimal” I meant “as minimal as you like, depending on
which step you stop at.”

http://cr.openjdk.java.net/~jrose/panama/minimal-ldl.html

— John


More information about the panama-dev mailing list