[code-reflection] Integrated: Make downcall method handles for ORT API functions static

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Feb 18 19:28:27 UTC 2025


On Tue, 18 Feb 2025 16:27:47 GMT, Hannes Greule <hgreule at openjdk.org> wrote:

> I don't know if there are downsides to those "virtual" downcall handles. Alternatively, would it make sense to use MutableCallSite? Afaik that should allow optimizations similar to static final fields but the actual targets could be resolved in the constructor still.

No downside -- in fact, regular downcall handles are just "virtual" downcall handle, where the first memory segment parameter is injected statically (e.g. using `insertArguments`). Internally, the downcall method handle machinery always model the target address as an input parameter, so there's no extra cost.

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

PR Comment: https://git.openjdk.org/babylon/pull/322#issuecomment-2666390523


More information about the babylon-dev mailing list