bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-21517)

* Move 'peephole' optimizations into compile.c and perform them directly on the CFG.
This commit is contained in:
Mark Shannon 2020-07-30 10:03:00 +01:00 committed by GitHub
parent ba18c0b13b
commit 6e8128f02e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 4365 additions and 4584 deletions

View file

@ -360,8 +360,6 @@ dis_tryfinally = """\
16 CALL_FUNCTION 0
18 POP_TOP
20 RERAISE
22 LOAD_CONST 0 (None)
24 RETURN_VALUE
""" % (_tryfinally.__code__.co_firstlineno + 1,
_tryfinally.__code__.co_firstlineno + 2,
_tryfinally.__code__.co_firstlineno + 4,
@ -385,8 +383,6 @@ dis_tryfinallyconst = """\
16 CALL_FUNCTION 0
18 POP_TOP
20 RERAISE
22 LOAD_CONST 0 (None)
24 RETURN_VALUE
""" % (_tryfinallyconst.__code__.co_firstlineno + 1,
_tryfinallyconst.__code__.co_firstlineno + 2,
_tryfinallyconst.__code__.co_firstlineno + 4,