On Mon, 1 Nov 2021 12:05:32 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> wrote:
>> This PR contains the API and implementation changes for JEP-419 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjdk.java.net/jeps/419 > > Maurizio Cimadamore has updated the pull request with a new target base due > to a merge or a rebase. The pull request now contains 17 commits: > > - Add cache for memory address var handles > - Merge branch 'master' into JEP-419 > - Fix regression in VaList treatment on AArch64 (contributed by @nick-arm) > - Merge branch 'master' into JEP-419 > - Fix copyright header in TestArrayCopy > - Fix failing microbenchmarks. Contributed by @FrauBoes (thanks!) > - * use `invokeWithArguments` to simplify new test > - Add test for liveness check with high-aririty downcalls > (make sure that if an exception occurs in a downcall because of liveness, > ref count of other resources are left intact). > - * Fix javadoc issue in VaList > * Fix bug in concurrent logic for shared scope acquire > - Address review comments > - ... and 7 more: > https://git.openjdk.java.net/jdk/compare/5bb1992b...9b519343 src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Utils.java line 111: > 109: class VarHandleCache { > 110: private static final Map<ValueLayout, VarHandle> handleMap = > new ConcurrentHashMap<>(); > 111: private static final Map<ValueLayout, VarHandle> > handleMapNoAlignCheck = new ConcurrentHashMap<>(); Something to consider later if this is an issue. Since the number of `ValueLayout` instances is fixed, carrier x order = 18, we can use stable arrays with ordinals on the instances. ------------- PR: https://git.openjdk.java.net/jdk/pull/5907