gh-90997: bpo-46841: Disassembly of quickened code (GH-32099)

This commit is contained in:
penguin_wwy 2022-04-19 16:45:08 +08:00 committed by GitHub
parent aa5c0a9f8d
commit e590379197
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 206 additions and 39 deletions

View file

@ -18,7 +18,7 @@ class OpcodeTests(unittest.TestCase):
self.assertRaises(ValueError, stack_effect, dis.opmap['BUILD_SLICE'])
self.assertRaises(ValueError, stack_effect, dis.opmap['POP_TOP'], 0)
# All defined opcodes
for name, code in dis.opmap.items():
for name, code in filter(lambda item: item[0] not in dis.deoptmap, dis.opmap.items()):
with self.subTest(opname=name):
if code < dis.HAVE_ARGUMENT:
stack_effect(code)
@ -47,7 +47,7 @@ class OpcodeTests(unittest.TestCase):
self.assertEqual(stack_effect(JUMP_FORWARD, 0, jump=False), 0)
# All defined opcodes
has_jump = dis.hasjabs + dis.hasjrel
for name, code in dis.opmap.items():
for name, code in filter(lambda item: item[0] not in dis.deoptmap, dis.opmap.items()):
with self.subTest(opname=name):
if code < dis.HAVE_ARGUMENT:
common = stack_effect(code)