diff options
| author | Jeffrey Yasskin <jyasskin@gmail.com> | 2009-02-28 19:03:21 (GMT) |
|---|---|---|
| committer | Jeffrey Yasskin <jyasskin@gmail.com> | 2009-02-28 19:03:21 (GMT) |
| commit | 68d68520061a5a4aa3437f8c74ba383b2da50280 (patch) | |
| tree | aaade0afac9b9369b58c5642e2635fa319f61c02 /Lib/compiler/pyassem.py | |
| parent | de28d6841e60d75ce7644ca527448f73376ec48e (diff) | |
| download | cpython-68d68520061a5a4aa3437f8c74ba383b2da50280.zip cpython-68d68520061a5a4aa3437f8c74ba383b2da50280.tar.gz cpython-68d68520061a5a4aa3437f8c74ba383b2da50280.tar.bz2 | |
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.
Diffstat (limited to 'Lib/compiler/pyassem.py')
| -rw-r--r-- | Lib/compiler/pyassem.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/compiler/pyassem.py b/Lib/compiler/pyassem.py index 5098f2c..be0255d 100644 --- a/Lib/compiler/pyassem.py +++ b/Lib/compiler/pyassem.py @@ -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: |
