Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-46740] Support JEP 424 ("Panama") foreign down calls in Native Image. #7152

Closed
wants to merge 15 commits into from

Commits on Jul 10, 2023

  1. Implement foreign downcalls

    Breaks compatibility with JDKs < 19; this will be subsequently fixed.
    Add configuration parser for foreign  downcalls.
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    9e21b60 View commit details
    Browse the repository at this point in the history
  2. Restore compatibility with older JDKs and revamp dispatch

    Slight changes to API.
    Prevent foreign functions feature from being used on JDK <= 20.
    Improve code quality.
    Add copyright headers.
    Remove references to JDK19 (replaced by 20).
    Change panama configuration file layout
    Move classes out of PanamaAliases
    Fix symbol lookups behavior
    Replace dispatch function with a function-pointers-based solution
    Make downcall stubs name shorter
    Move all panama/foreign code in a separate module; the module is conditionally enabled if the requirements are met.
    Remove (almost) all references to the word "panama".
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    f82bf47 View commit details
    Browse the repository at this point in the history
  3. Implement call state capture

    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    b5771e0 View commit details
    Browse the repository at this point in the history
  4. Cleanup foreign functions code

    Add public API for foreign functions.
    Handle unsupported features more gracefully.
    Revert changes to python imports.
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    54309df View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a335a85 View commit details
    Browse the repository at this point in the history
  6. Move call state capture to CFunctionEpilogue

    Add comment about support of shared arena.
    Add options to downcalls parser.
    Move call state capture to CFunctionEpilogue.
    Change exception on unregistered downcall.
    Change MemoryAssignment design.
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    d32866d View commit details
    Browse the repository at this point in the history
  7. Add basic support for Win64 ABI

    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    7e5c240 View commit details
    Browse the repository at this point in the history
  8. Fix uninterruptible annotations

    Compliance.
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    387602b View commit details
    Browse the repository at this point in the history
  9. Tweak and refactor foreign downcalls code

    Change (and rename) MemoryAssignment to use register objects.
    Change comment format, rename some things, fix code style, ...
    Add cost estimate to CFunctionEpilogue (when applicable).
    Update to JDK21.
    Tweak error message.
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    c42db07 View commit details
    Browse the repository at this point in the history
  10. Add support for "trivial" downcalls

    Remove the "functions" in "foreign functions".
    Simplify "linkToNative" substitution.
    Improve error message.
    Report unsupported features at runtime.
    Change 'bitAlignment' to 'byteAlignment (change from JDK 20->21).
    Fix alignment specifier being a postfix modifier (as opposed to a prefix modifier, as in the JDK).
    Simplify VMStorage resolution to register.
    Add runtime check for generated register allocation.
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    1a51a71 View commit details
    Browse the repository at this point in the history
  11. Setup native access protections

    Add "--enable-native-access" to native image options
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    1423dce View commit details
    Browse the repository at this point in the history
  12. Implement ABI-dependent arguments adaptation

    Fix partial call state capture
    Change call state capture infrastructure
    Make ABIUtils an image singleton.
    Fix typos.
    Remove occurences of the word "panama".
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    0fec672 View commit details
    Browse the repository at this point in the history
  13. Abstract and refactor call state capture

    Stubs are now only interested in whether capture occurs or not (as opposed to interested in the precise capture set).
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    f311b16 View commit details
    Browse the repository at this point in the history
  14. Make unsupported ABI a runtime error

    Disable Foreign Functions by default.
    Update documentation.
    Fix comment punctuation.
    Fix constant pool used for downcall stubs.
    Make captureCallState a boolean flag in config.
    Remove usage of duringAnalysis.
    Make assignment/type check dependent on ABI (at it should always have been).
    Apply miscellaneous fixes (method name, typos, ...).
    Fix expected call count when a pseudo C-epilogue/prologue pair is emitted.
    Move safety checks about capturable states to compile-time.
    Make descriptor parser more platform-agnostic.
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    0137fee View commit details
    Browse the repository at this point in the history
  15. Prevent capture mask read from floating in between the prologue and e…

    …pilogue
    
    Rename dummy.
    Minize changes to signature files.
    Improve hashCode implementations.
    Implement linkToNative using an ImageSingleton.
    Ef55 committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    5c2a9ba View commit details
    Browse the repository at this point in the history