Uh oh!
There was an error while loading. Please reload this page.
GH-104584: Allow optimizers to opt out of optimizing. - #105244
Conversation
| _PyFrame_SetStackPointer(frame, stack_pointer); | ||
| return frame; |
There was a problem hiding this comment.
We could also complicate the signature of _PyOptimizer_BackEdge to signal this case back to the caller so we could avoid the stack pointer write, and the caller could just continue regular interpretation instead of needing to goto resume_frame and update interpreter state from the frame again. But probably not worth it I guess, if optimizers declining to optimize should be rare?
There was a problem hiding this comment.
Most calls to _PyOptimizer_BackEdge will return the same frame. We could add a check for it in JUMP_BACKWARD, but I think we would still need to save the stack pointer.
Even if we could avoid it, I suspect a single unconditional write is faster than the additional logic to avoid it.
Uh oh!
There was an error while loading. Please reload this page.