> Allow `captureCallState` and `critical(true)` linker options to be combined. 
> This allows passing a Java array to capture call state.
> 
> One caveat is that the linker expects the memory to be aligned, which means 
> that at least an `int[]` has to be used (i.e. `byte[]` will no work).
> 
> This patch contains two implementations: one for the linkers that use 
> `CallingSequenceBuilder`. That one is quite straight-forward, as we can just 
> mimic what we already do for other memory segment arguments, but also for the 
> capture state segment. i.e. split it into base and offset, and pass that down 
> to our downcall stub. The stub will then add the offset and oop together, and 
> pass use the resulting address to write to.
> 
> The other implementation is for the fallback linker. This handles the capture 
> state a little differently, but essentially currently just passes the native 
> address to the back end for the native code to write the captured state into. 
> I've just added another heap base parameter for that capture state segment to 
> the back end, which is then turned into a native address using JNI's 
> `GetPrimitiveArrayCritical`, similarly to what we do for other heap segments.
> 
> Testing: `jdk_foreign` test suite.

Jorn Vernee has updated the pull request incrementally with two additional 
commits since the last revision:

 - review comments
 - Add test for capture state alignment

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/22327/files
  - new: https://git.openjdk.org/jdk/pull/22327/files/f42f9515..2b332c33

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22327&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22327&range=00-01

  Stats: 37 lines in 3 files changed: 17 ins; 3 del; 17 mod
  Patch: https://git.openjdk.org/jdk/pull/22327.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22327/head:pull/22327

PR: https://git.openjdk.org/jdk/pull/22327

Reply via email to