mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} with
POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing
a POP_TOP on each conditional and sometimes allows the peephole optimizer to
skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
This commit is contained in:
parent
de28d6841e
commit
68d6852006
11 changed files with 228 additions and 178 deletions
|
|
@ -122,6 +122,9 @@ def order_blocks(start_block, exit_block):
|
|||
for b in remaining:
|
||||
if __debug__ and b.next:
|
||||
assert b is b.next[0].prev[0], (b, b.next)
|
||||
# Make sure every block appears in dominators, even if no
|
||||
# other block must precede it.
|
||||
dominators.setdefault(b, set())
|
||||
# preceeding blocks dominate following blocks
|
||||
for c in b.get_followers():
|
||||
while 1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue