[foreign-memaccess+abi] RFR: 8294970: Add linker option for saving thread-locals that the VM can overwrite

Jorn Vernee jvernee at openjdk.org
Tue Oct 25 19:20:33 UTC 2022


On Tue, 25 Oct 2022 19:17:12 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java line 57:
>> 
>>> 55:         checkHasNaturalAlignment(function);
>>> 56:         LinkerOptions optionSet = LinkerOptions.of(options);
>>> 57:         optionSet.validateForDowncall(function);
>> 
>> Does it make sense to have a validation step that is disjoint from the creation of the LinkerOptions? E.g. should LinkerOptions factory just take the descriptor and perform all the required validation in one go?
>
> I don't really like that idea, because it requires the descriptor to be specified twice, which opens up the possibility of them going out of sync.

I think we should have 2 validation steps, one when creating the option, where we can check if the option itself is valid, and then another when linking, where we check whether the option makes sense for a particular linkage request.

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

PR: https://git.openjdk.org/panama-foreign/pull/742


More information about the panama-dev mailing list