[foreign-memaccess] RFR: 8252504: Add a method to MemoryLayout which returns a offset-computing method handle

Jorn Vernee jvernee at openjdk.java.net
Fri Nov 20 14:12:09 UTC 2020


On Thu, 19 Nov 2020 20:48:03 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> We need to walk to inspect the element indices to see if we have a sequenceElement path element with an unspecified index. Could replace the `cur.layout.bitSize` with a lookup into the strides array maybe, but I think that would require keeping track of a separate index as well. (I'll take a look).
>
> My recollection of this code is that when you get to generating the handle, you already have the unspecified paths in the stride array. Look at the places for when a new stride is set - I think it should match the places where you need the info as well (that is `PathElement::sequenceElement()` and `PathElement::sequenceElement(long, long)`).

Ah, right. The strides array only contains elements for unspecified indexes, not all sequence layouts. I'm confusing myself

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/396


More information about the panama-dev mailing list