[foreign-jextract] RFR: 8250518: Jextract should process macros in bulk

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Jul 24 14:58:46 UTC 2020


This patch adds bulk processing of macros; that is, instead of having a reparsing step for every macro constant, this
patch tweaks jextract so that all unparsed macros are processed in one go.

The logic is quite convoluted and this work led to a major refactoring of MacroParserImpl; there is now a *table* where
unparsed macros are kept - elements in this table are reparsed, and, based on the contents of the reparsed cursors, the
table state is updated accordingly (the code has quite a bit of doc documenting the possible state transitions).

This results in some 2x performance boost in some of the heaviest extraction runs.

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

Commit messages:
 - Refactor code in a more sensible way
 - Move everything into MacroParserImpl
 - Initial push

Changes: https://git.openjdk.java.net/panama-foreign/pull/264/files
 Webrev: https://webrevs.openjdk.java.net/panama-foreign/264/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8250518
  Stats: 403 lines in 4 files changed: 228 ins; 144 del; 31 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/264.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/264/head:pull/264

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


More information about the panama-dev mailing list