gh-106529: Implement POP_JUMP_IF_XXX uops by gvanrossum · Pull Request #106551 · python/cpython
This adds:
- Hand-written uops JUMP_IF_{TRUE,FALSE,NONE,NOT_NONE}.
These peek at the top of the stack.
The jump target (in superblock space) is absolute.
- Hand-written translation for POP_JUMP_IF_TRUE,
assuming the jump is unlikely.
This can serve as an example for the rest.
(Probably adding the others will cause a little refactoring.)
Once we implement jump-likelihood profiling,
we can implement the jump-unlikely case.
Note that the stubs are placed at the end of the trace array.
There is a gap between the main superblock and the stubs.
We could close the gap, we'd just have to patch up the JUMP uops.
11 tasks
This required improving len(ex) and ex[i] a bit. There is now a sentinel opcode (0) at the end, *unless* the trace array is full.
gvanrossum added a commit that referenced this pull request
(gh-106551 caused a compiler warning about on Windows.)
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