GH-126599: Remove the `PyOptimizer` API by brandtbucher · Pull Request #129194 · python/cpython
-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Conversation
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) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (tstate->interp->jit) { | |
| this_instr->op.code = (tstate->interp->jit) ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT; |
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.
This was referenced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters