python / python/cpython

JIT does not emit trampolines for jumps to addresses encoded as operands

Open
#149,316 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interpreter-core topic-JIT type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

We need to declare variables volatile here and in https://github.com/python/cpython/pull/148745 otherwise the code generator emits normal jumps without the necessary patching to add trampolines.

For more details see https://github.com/python/cpython/pull/148745#discussion_r3177522254

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Python/bytecodes.c around line 5053 and read the discussion in pull request 148745. Trace how the JIT code generator handles jumps whose addresses are operands, then verify that the affected variables preserve the trampoline-patching behavior. Done means such jumps emit the required trampolines on the CPython main branch.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.