[foreign-abi] RFR 8235258: Add support for empty segments and rebased addresses
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Tue Dec 3 14:51:36 UTC 2019
This patch implements the approach discussed in [1, 2] - which aims at
increasing the range of 'safe' operations provided by the memory access API.
Webrev:
http://cr.openjdk.java.net/~mcimadamore/panama/8235258_v2/
Changes compared to the patch in [2]:
* added support for all ABIs (please double check :-))
* refactored some instance methods in MemoryAddressImpl as static
methods in Utils (as per Jorn suggestion)
* removed bound check from MemoryAddress::rebase (as per Jorn suggestion)
* added a combinatorial test which checks several cases of rebase(),
more specifically:
- for overlapping segments, it tests that accessing elements in the
smaller segment works ok, regardless of whether the address used is
rebased or not
- for non-overlapping segments, if the segments have different kinds
(e.g. heap vs. off-heap) check that an exception is thrown when rebase
is called
- for non-overlapping segments of the same kind check that an
exception is thrown when the segment is accessed using the rebased
address (as that should be OOB)
Maurizio
[1] -
https://mail.openjdk.java.net/pipermail/panama-dev/2019-November/006746.html
[2] -
https://mail.openjdk.java.net/pipermail/panama-dev/2019-December/006780.html
More information about the panama-dev
mailing list