Skip to content

Call JIT code from the interpreter via a trampoline function, instead of inserting shim code in the jitted code #137959

@markshannon

Description

@markshannon

Currently, we insert shim code into every piece of jitted code to handle the change in calling conventions from the interpreter and the jitted code.

We should, instead use a trampoline function. A trampoline function would perform the same job as the shim code,
but has many advantages:

  1. we would only need one for the entire process, instead of one per executor.
  2. we wouldn't need extra refcounting code to keep the shim alive as the trampoline function would always be live.
  3. we can simplify the tier1 -> tier2 code in ENTER_EXECUTOR by having the trampoline manage much of the details
  4. we can use the same interface for the tier 2 interpreter, further simplifying the code
  5. we only need one entry into the JIT code. No need for jit_side_entry

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetopic-JIT

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions