Skip to content

GH-133231: Add JIT utilities in sys._jit #133233

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

Merged
merged 17 commits into from
May 5, 2025
Merged

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented May 1, 2025

@brandtbucher brandtbucher added type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-JIT labels May 1, 2025
@brandtbucher brandtbucher self-assigned this May 1, 2025
Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick doc-only review:

Comment on lines +1284 to +1290
.. envvar:: PYTHON_JIT

On builds where experimental just-in-time compilation is available, this
variable can force the JIT to be disabled (``0``) or enabled (``1``) at
interpreter startup.

.. versionadded:: 3.13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should backport this, should it be split out into a different PR for ease?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just backport it separately, since I need the ref for this PR's changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth using miss-islington for the backport here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just do it manually in a bit.

@brandtbucher
Copy link
Member Author

I just realized that my approach for sys._jit.is_active() will need reworking, since the tail-calling interpreter doesn't have entry_frame handy.

@brandtbucher
Copy link
Member Author

Okay, reworked to support tail-calling.

@brandtbucher
Copy link
Member Author

@markshannon, let me know what you think. The bots won't let us merge features without approving review, but I'd like to get something like this in before the freeze.

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
One small suggestion

@brandtbucher brandtbucher merged commit b1aa515 into python:main May 5, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-JIT type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants