Skip to content
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

GH-126599: Remove the PyOptimizer API #129194

Merged
merged 5 commits into from
Jan 29, 2025

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Jan 22, 2025

The first commit removes the PyOptimizer API, which also nicely removes the ability to toggle the JIT on or off at runtime. The second commit "specializes" JUMP_BACKWARD so that we don't constantly check whether the JIT is enabled on backedges.

This should be covered by the NEWS entry from GH-126853.

tier1 op(_SPECIALIZE_JUMP_BACKWARD, (--)) {
#if ENABLE_SPECIALIZATION
if (this_instr->op.code == JUMP_BACKWARD) {
if (tstate->interp->jit) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (tstate->interp->jit) {
this_instr->op.code = (tstate->interp->jit) ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;

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.
_SPECIALIZE_JUMP_BACKWARD looks oddly asymmetric, though.

@brandtbucher brandtbucher merged commit 828b276 into python:main Jan 29, 2025
64 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) skip news topic-JIT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants