[foreign-abi] RFR: JDK-8248809: Consider supporting address dereference/allocation for platforms where pointers are not 64 bits [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Sep 7 10:34:16 UTC 2020


> This patch makes support for addresses more uniform, in a way that scales to platforms whose pointer size might be !=
> 64 bits. After considering a number of alternatives, we settled on something which, I think is pleasing for a number of
> rteasons.  First, we added a new layout, namely `MemoryLayouts.ADDRESS`. This is the layout of a machine pointer, in
> the platform in which the JVM runs. This is a useful piece of information to have regardless.
> This new layout is then used in two places:
> 
> * In MemoryAccess, to decide whether we need a 32 or a 64 dereference handle to get/set addresses
> 
> * In NativeScope, again, to decide to which NativeScope factory we should delegate (the long vs. the int one)
> 
> This should slightly generalize what we have and also adds some extra helper methods to NativeScope which were dropped
> in an earlier iteration, waiting for this issue to be addressed.
> I've tweaked the NativeScope test in order to stress the new address-accepting factories.

Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:

  Update src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/NativeScope.java
  
  Co-authored-by: Jorn Vernee <JornVernee at users.noreply.github.com>

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

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/308/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/308/files/4ac3aa43..80b500ca

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=308&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=308&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/308.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/308/head:pull/308

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


More information about the panama-dev mailing list