[foreign-jextract] RFR: 8261906: Improve jextract support for virtual functions [v3]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Feb 23 18:11:46 UTC 2021

On Mon, 22 Feb 2021 15:54:46 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with three additional commits since the last revision:
>>  - Consolidate code in OutputFactory to reuse FunctionInfo factory
>>  - Add records to pass multiple information and simplify signatures of builders
>>  - Remove Constant.MethodHandle from ConstantBuilder
> Marked as reviewed by jvernee (Committer).

I've addressed the various comments; I ended up simplifying the code a bit and remove the Constant.MethodHandle abstraction which was, I think, a bit too convoluted. Now virtual function invokers are generated as part of JavaSourceBuilder::addVar, which I think makes the most sense from the perspective of OutputFactory. To facilitate passing multiple arguments from OutputFactory to the various builders, I've added a couple of records (VarInfo and FunctionInfo) which store various info about variables and functions (e.g. carrier, method types, layouts, descriptors). This also allowed me to reuse most of the code in OutputFactory between visitVariable/visitFunction and generateFunctionalInteraface. Now all the three methods call a factory which returns an optional FunctionInfo (if missing, it means that the function/variable/func interface cannot be generated).


PR: https://git.openjdk.java.net/panama-foreign/pull/456

More information about the panama-dev mailing list