[foreign-jextract] RFR: 8252563: Field VarHandle generation in --source mode is missing the PathElement.groupElement argument
Athijegannathan Sundararajan
sundar at openjdk.java.net
Tue Sep 1 12:43:38 UTC 2020
On Tue, 1 Sep 2020 12:20:46 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> Hi,
>
> This PR fixes an issue where var handles in structs were not being created based on the layout of the parent struct,
> and were not using a PathElement.groupElement(...) argument to look up the right struct field, in --source mode,
> resulting in the created var handle not having the right offset. The core change is found in
> SourceConstantHelper#emitVarHandleField. To try and clear things up a bit, I've also split the addVarHandle method in
> ConstantHelper into addGlobalVarHandle, and addFieldVarHandle with only the applicable parameter types, at least at the
> ConstantHelper level, so that calling code doesn't have to pass a bunch of nulls when calling addVarHandle for a global
> variable (the nulls being for the parent layout and field name). To test this change, I've re-used the existing
> LibStructTest by running the test twice; once under the existing jtreg jextract driver that uses the binary constant
> helper, and once under a new jtreg jextract driver that first generates sources and then compiles them. Thanks, Jorn
__ may be avoided. Suggest "ignored" instead.
-------------
Marked as reviewed by sundar (Committer).
PR: https://git.openjdk.java.net/panama-foreign/pull/297
More information about the panama-dev
mailing list