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

@ -948,7 +948,7 @@ class JumpTestCase(unittest.TestCase):
output.append(11)
output.append(12)
@jump_test(5, 11, [2, 4], (ValueError, 'unreachable'))
@jump_test(5, 11, [2, 4], (ValueError, 'after'))
def test_no_jump_over_return_try_finally_in_finally_block(output):
try:
output.append(2)
@ -1457,7 +1457,7 @@ class JumpTestCase(unittest.TestCase):
async with asynctracecontext(output, 4):
output.append(5)
@jump_test(5, 7, [2, 4], (ValueError, "unreachable"))
@jump_test(5, 7, [2, 4], (ValueError, "after"))
def test_no_jump_over_return_out_of_finally_block(output):
try:
output.append(2)