GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Call JIT code from the interpreter via a trampoline function, instead of inserting shim code in the jitted code · Issue #137959 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
Call JIT code from the interpreter via a trampoline function, instead of inserting shim code in the jitted code#137959
Copy link
Labels
3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-JIT

Description

@markshannon
markshannon
opened on Aug 19, 2025
Issue body actions

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

  • GH-137959: Replace shim code in jitted code with a single trampoline function. #137961
  • GH-137959: fix warning 'visibility' attribute ignored in jit/trampoline.c #140286
  • gh-137959: Fix TIER1_TO_TIER2 macro name in JIT InternalDocs #141496

Activity

  1. markshannon
    added
    performancePerformance or resource usagePerformance or resource usage
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    topic-JIT
    3.15bugs and security fixesbugs and security fixes
    on Aug 19, 2025
  2. markshannon
    added a commit that references this issue on Aug 21, 2025

    GH-137959: Replace shim code in jitted code with a single trampoline …

    a8d9d94
  3. markshannon
    closed this as completedon Sep 2, 2025
  4. Fidget-Spinner
    added a commit that references this issue on Nov 13, 2025

    gh-137959: Fix `TIER1_TO_TIER2` macro name in JIT InternalDocs (GH-14…

    c2470b3
  5. CuriousLearner
    added 3 commits that reference this issue on Nov 13, 2025

    Merge branch 'main' into fix-issue21914

    b9f473c

    Merge branch 'main' of github.com:python/cpython into fix-Issue18387

    c46ecc5

    Merge branch 'main' of github.com:python/cpython into fix-issue24255

    c240289
  6. StanFromIreland
    added a commit that references this issue on Dec 6, 2025

    pythongh-137959: Fix `TIER1_TO_TIER2` macro name in JIT InternalDocs (p…

    4d00b7a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.