[foreign-jextract] RFR: 8252931: Extend multiple constant classes support to ClassConstantHelper

Athijegannathan Sundararajan sundar at openjdk.java.net
Wed Sep 9 10:13:45 UTC 2020


On Wed, 9 Sep 2020 09:25:34 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Hi,
> 
> This PR extracts the multiple source file functionality from SourceConstantHelper into a decorator class, and then uses
> it for ClassConstantHelper as well.
> (I've also done a minor cleanup where I simplified the way booleans are turned into constants, since we can now just
> call describeConstable() on a Boolean)
> Thanks,
> Jorn

src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/MultiFileConstantHelper.java line 38:

> 36: public class MultiFileConstantHelper implements ConstantHelper {
> 37:
> 38:     private static final int CONSTANTS_PER_CLASS = Integer.getInteger("jextract.constants.per.class", 1000);

This limit was empirically found by running source constant helper on samples (like lapack, python, libgit2). I'd
recommend doing similar experiment with binary constant helper and arrive at suitable threshold.

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

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


More information about the panama-dev mailing list