RFR: 8305093: Linker cache should not take layout names into account
ExE Boss
duke at openjdk.org
Fri Apr 21 00:45:58 UTC 2023
On Thu, 20 Apr 2023 17:23:08 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> Strip names from the function descriptors used in linkage requests. The names are not important for classification, and this will allow the cached MethodHandle/UpcallStubFactory to be shared across linkage request with the same structure, but with layouts that have different names.
>
> I also have another implementation that avoids copying all the layouts, and instead re-implemented equals and hashCode in the LinkRequest wrapper: https://github.com/openjdk/jdk/compare/pr/13079...JornVernee:jdk:NoNameCache But, this seems too complex. Linking code is not very performance sensitive, so I instead went with a simpler approach in this patch.
src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java line 120:
> 118: descriptor.argumentLayouts().forEach(AbstractLinker::checkHasNaturalAlignmentRecursive);
> 119: }
> 120: private static void checkHasNaturalAlignmentRecursive(MemoryLayout layout) {
**Nit:** restore deleted line between methods:
Suggestion:
}
private static void checkHasNaturalAlignmentRecursive(MemoryLayout layout) {
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13562#discussion_r1173005869
More information about the core-libs-dev
mailing list