mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)
Break up COMPARE_OP into four logically distinct opcodes: * COMPARE_OP for rich comparisons * IS_OP for 'is' and 'is not' tests * CONTAINS_OP for 'in' and 'is not' tests * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
This commit is contained in:
parent
62e3973395
commit
9af0e47b17
17 changed files with 4909 additions and 4855 deletions
|
@ -21,8 +21,7 @@ try:
|
|||
except ImportError:
|
||||
pass
|
||||
|
||||
cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is',
|
||||
'is not', 'exception match', 'BAD')
|
||||
cmp_op = ('<', '<=', '==', '!=', '>', '>=')
|
||||
|
||||
hasconst = []
|
||||
hasname = []
|
||||
|
@ -159,6 +158,10 @@ jabs_op('POP_JUMP_IF_TRUE', 115) # ""
|
|||
|
||||
name_op('LOAD_GLOBAL', 116) # Index in name list
|
||||
|
||||
def_op('IS_OP', 117)
|
||||
def_op('CONTAINS_OP', 118)
|
||||
|
||||
jabs_op('JUMP_IF_NOT_EXC_MATCH', 121)
|
||||
jrel_op('SETUP_FINALLY', 122) # Distance to target address
|
||||
|
||||
def_op('LOAD_FAST', 124) # Local variable number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue