[foreign-preview] RFR: 8281595: ASM-ify scope acquire/release for down call parameters [v2]
Jorn Vernee
jvernee at openjdk.java.net
Tue Feb 15 15:01:18 UTC 2022
> Hi,
>
> This patch rewrites the scope acquire/release logic that we do for downcalls inside ASM, in the generated specialized binding class. This also drops the fallback path we had for more than 5 scopes. The new code now always checks to see if every scope is unique. (I think that should be okay, but please let me know if otherwise).
>
> I've also added a benchmark by Maurizio to this patch, which was showing a failure to scalar replace some scoped arguments with the old MH logic (reason discussed in [JDK-8281387](https://bugs.openjdk.java.net/browse/JDK-8281387)). With the new ASM-based logic, there is no sign of allocations (other than some noise):
>
>
> Benchmark Mode Cnt Score Error Units
> PointerInvoke.panama_call_as_address avgt 30 13.181 ± 0.320 ns/op
> PointerInvoke.panama_call_as_address:·gc.alloc.rate avgt 30 0.043 ± 0.049 MB/sec
> PointerInvoke.panama_call_as_address:·gc.alloc.rate.norm avgt 30 0.001 ± 0.001 B/op
> PointerInvoke.panama_call_as_address:·gc.count avgt 30 ≈ 0 counts
> PointerInvoke.panama_call_as_long avgt 30 12.943 ± 0.287 ns/op
> PointerInvoke.panama_call_as_long:·gc.alloc.rate avgt 30 0.065 ± 0.054 MB/sec
> PointerInvoke.panama_call_as_long:·gc.alloc.rate.norm avgt 30 0.002 ± 0.001 B/op
> PointerInvoke.panama_call_as_long:·gc.count avgt 30 ≈ 0 counts
> PointerInvoke.panama_call_as_new_segment avgt 30 14.309 ± 0.177 ns/op
> PointerInvoke.panama_call_as_new_segment:·gc.alloc.rate avgt 30 0.173 ± 0.144 MB/sec
> PointerInvoke.panama_call_as_new_segment:·gc.alloc.rate.norm avgt 30 0.005 ± 0.004 B/op
> PointerInvoke.panama_call_as_new_segment:·gc.count avgt 30 ≈ 0 counts
> PointerInvoke.panama_call_as_segment avgt 30 13.273 ± 0.191 ns/op
> PointerInvoke.panama_call_as_segment:·gc.alloc.rate avgt 30 ≈ 10?? MB/sec
> PointerInvoke.panama_call_as_segment:·gc.alloc.rate.norm avgt 30 ≈ 10?? B/op
> PointerInvoke.panama_call_as_segment:·gc.count avgt 30 ≈ 0 counts
>
>
> Thanks,
> Jorn
Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
Use local variable for inital scope slots array (instead of storing it in the scopeSlots field)
-------------
Changes:
- all: https://git.openjdk.java.net/panama-foreign/pull/640/files
- new: https://git.openjdk.java.net/panama-foreign/pull/640/files/1ec239ea..078e77e9
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=640&range=01
- incr: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=640&range=00-01
Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
Patch: https://git.openjdk.java.net/panama-foreign/pull/640.diff
Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/640/head:pull/640
PR: https://git.openjdk.java.net/panama-foreign/pull/640
More information about the panama-dev
mailing list