[foreign-jextract] Integrated: 8252563: Field VarHandle generation in --source mode is missing the PathElement.groupElement argument
Jorn Vernee
jvernee at openjdk.java.net
Tue Sep 1 13:00:46 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
This pull request has now been integrated.
Changeset: afdbc657
Author: Jorn Vernee <jvernee at openjdk.org>
URL: https://git.openjdk.java.net/panama-foreign/commit/afdbc657
Stats: 160 lines in 8 files changed: 1 ins; 116 del; 43 mod
8252563: Field VarHandle generation in --source mode is missing the PathElement.groupElement argument
Reviewed-by: sundar
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/297
More information about the panama-dev
mailing list