Ejemplo n.º 1
0
# Below are opcode changes since Python 2.6
rm_op(l, "BUILD_MAP", 104)
rm_op(l, "LOAD_ATTR", 105)
rm_op(l, "COMPARE_OP", 106)
rm_op(l, "IMPORT_NAME", 107)
rm_op(l, "IMPORT_FROM", 108)
rm_op(l, "JUMP_IF_FALSE", 111)
rm_op(l, "EXTENDED_ARG", 143)
rm_op(l, "JUMP_IF_TRUE", 112)

def_op(l, "LIST_APPEND", 94, 2, 1)  # Calls list.append(TOS[-i], TOS).
# Used to implement list comprehensions.
def_op(l, "BUILD_SET", 104)  # Number of set items
def_op(l, "BUILD_MAP", 105)
name_op(l, "LOAD_ATTR", 106)
compare_op(l, "COMPARE_OP", 107)

name_op(l, "IMPORT_NAME", 108, 2, 1)  # Index in name list
name_op(l, "IMPORT_FROM", 109, 0, 1)

jabs_op(l, "JUMP_IF_FALSE_OR_POP", 111)  # Target byte offset from beginning of code
jabs_op(l, "JUMP_IF_TRUE_OR_POP", 112)  # ""
jabs_op(l, "POP_JUMP_IF_FALSE", 114)  # ""
jabs_op(l, "POP_JUMP_IF_TRUE", 115)  # ""
jrel_op(l, "SETUP_WITH", 143, 0, 2)

def_op(l, "EXTENDED_ARG", 145)
def_op(l, "SET_ADD", 146, 1, 0)  # Calls set.add(TOS1[-i], TOS).
# Used to implement set comprehensions.
def_op(l, "MAP_ADD", 147, 2, 1)  # Calls dict.setitem(TOS1[-i], TOS, TOS1)
# Used to implement dict comprehensions.
Ejemplo n.º 2
0
name_op(l, "DELETE_NAME",          91,  0,  0)  # ""
varargs_op(l, "UNPACK_SEQUENCE",   92, -1,  1)  # TOS is number of tuple items
jrel_op(l, "FOR_ITER",             93,  0,  1)  # TOS is read

store_op(l, "STORE_ATTR",          95,  2,  0, is_type="name")  # Operand is in name list
name_op(l, "DELETE_ATTR",          96,  1,  0)  # ""
store_op(l, "STORE_GLOBAL",        97,  1,  0, is_type="name")  # ""
name_op(l, "DELETE_GLOBAL",        98,  0,  0)  # ""
nargs_op(l, "DUP_TOPX",            99, -1,  2)  # number of items to duplicate
const_op(l, "LOAD_CONST",         100,  0,  1)  # Operand is in const list
name_op(l, "LOAD_NAME",           101,  0,  1)  # Operand is in name list
varargs_op(l, "BUILD_TUPLE",      102, -1,  1)  # TOS is number of tuple items
varargs_op(l, "BUILD_LIST",       103, -1,  1)  # TOS is number of list items
varargs_op(l, "BUILD_MAP",        104,  0,  1)  # TOS is number of kwarg items. Always zero for now
name_op(l, "LOAD_ATTR",           105,  1,  1)  # Operand is in name list
compare_op(l, "COMPARE_OP",       106,  2,  1)  # Comparison operator

name_op(l, "IMPORT_NAME",         107,  2,  2)  # Imports TOS and TOS1; module pushed
name_op(l, "IMPORT_FROM",         108,  0,  1)  # Operand is in name list

jrel_op(l, "JUMP_FORWARD",        110,  0,  0, fallthrough=False)
                                                # Number of bytes to skip
jrel_op(l, "JUMP_IF_FALSE",       111,  1,  1, True)  # ""

jrel_op(l, "JUMP_IF_TRUE",        112,  1,  1, True)  # ""
jabs_op(l, "JUMP_ABSOLUTE",       113,  0,  0, fallthrough=False)
                                                # Target byte offset from beginning of code

name_op(l, "LOAD_GLOBAL",         116,  0,  1)  # Operand is in name list

jabs_op(l, "CONTINUE_LOOP",       119,  0,  0, fallthrough=False)  # Target address
Ejemplo n.º 3
0
name_op(l, 'DELETE_NAME', 91, 0, 0)  # ""
varargs_op(l, 'UNPACK_SEQUENCE', 92, -1, 1)  # Number of tuple items
jrel_op(l, 'FOR_ITER', 93, -1, -1)

name_op(l, 'STORE_ATTR', 95, 2, 0)  # Operand is in name list
name_op(l, 'DELETE_ATTR', 96, 1, 0)  # ""
name_op(l, 'STORE_GLOBAL', 97, 1, 0)  # ""
name_op(l, 'DELETE_GLOBAL', 98, 0, 0)  # ""
def_op(l, 'DUP_TOPX', 99, 1, -1)  # number of items to duplicate
const_op(l, 'LOAD_CONST', 100, 0, 1)  # Operand is in const list
name_op(l, 'LOAD_NAME', 101, 0, 1)  # Operand is in name list
varargs_op(l, 'BUILD_TUPLE', 102, -1, 1)  # Number of tuple items
varargs_op(l, 'BUILD_LIST', 103, -1, 1)  # Number of list items
varargs_op(l, 'BUILD_MAP', 104, -1, 1)  # Always zero for now
name_op(l, 'LOAD_ATTR', 105, 1, 1)  # Operand is in name list
compare_op(l, 'COMPARE_OP', 106, 2, 1)  # Comparison operator

name_op(l, 'IMPORT_NAME', 107, 2, 1)  # Operand is in name list
name_op(l, 'IMPORT_FROM', 108, 0, 1)  # Operand is in name list

jrel_op(l, 'JUMP_FORWARD', 110, 0, 0)  # Number of bytes to skip
jrel_op(l, 'JUMP_IF_FALSE', 111, 1, 1)  # ""
jrel_op(l, 'JUMP_IF_TRUE', 112, 1, 1)  # ""
jabs_op(l, 'JUMP_ABSOLUTE', 113, 0,
        0)  # Target byte offset from beginning of code

name_op(l, 'LOAD_GLOBAL', 116, 0, 1)  # Operand is in name list

jabs_op(l, 'CONTINUE_LOOP', 119, 0, 0)  # Target address
jrel_op(l, 'SETUP_LOOP', 120, 0, 0)  # Distance to target address
jrel_op(l, 'SETUP_EXCEPT', 121, 0, 0)  # ""
Ejemplo n.º 4
0
name_op(l, 'DELETE_NAME',          91,  0,  0)  # ""
varargs_op(l, 'UNPACK_SEQUENCE',   92,  9,  1)  # TOS is number of tuple items
jrel_op(l, 'FOR_ITER',             93,  9,  1)  # TOS is read

name_op(l, 'STORE_ATTR',           95,  2,  0)  # Operand is in name list
name_op(l, 'DELETE_ATTR',          96,  1,  0)  # ""
name_op(l, 'STORE_GLOBAL',         97,  1,  0)  # ""
name_op(l, 'DELETE_GLOBAL',        98,  0,  0)  # ""
def_op(l, 'DUP_TOPX',              99,  1, -1)  # number of items to duplicate
const_op(l, 'LOAD_CONST',         100,  0,  1)  # Operand is in const list
name_op(l, 'LOAD_NAME',           101,  0,  1)  # Operand is in name list
varargs_op(l, 'BUILD_TUPLE',      102,  9,  1)  # TOS is number of tuple items
varargs_op(l, 'BUILD_LIST',       103,  9,  1)  # TOS is number of list items
varargs_op(l, 'BUILD_MAP',        104,  0,  1)  # TOS is number of kwark items. Always zero for now
name_op(l, 'LOAD_ATTR',           105,  1,  1)  # Operand is in name list
compare_op(l, 'COMPARE_OP',       106,  2,  1)  # Comparison operator

name_op(l, 'IMPORT_NAME',         107,  2,  1)  # Operand is in name list
name_op(l, 'IMPORT_FROM',         108,  0,  1)  # Operand is in name list

jrel_op(l, 'JUMP_FORWARD',        110,  0,  0, fallthrough=False)
                                                # Number of bytes to skip
jrel_op(l, 'JUMP_IF_FALSE',       111,  1,  1, True)  # ""

jrel_op(l, 'JUMP_IF_TRUE',        112,  1,  1, True)  # ""
jabs_op(l, 'JUMP_ABSOLUTE',       113,  0,  0, fallthrough=False)
                                                # Target byte offset from beginning of code

name_op(l, 'LOAD_GLOBAL',         116,  0,  1)  # Operand is in name list

jabs_op(l, 'CONTINUE_LOOP',       119,  0,  0, fallthrough=False)  # Target address
Ejemplo n.º 5
0
# Below are opcode changes since Python 2.6
rm_op(l, 'BUILD_MAP',     104)
rm_op(l, 'LOAD_ATTR',     105)
rm_op(l, 'COMPARE_OP',    106)
rm_op(l, 'IMPORT_NAME',   107)
rm_op(l, 'IMPORT_FROM',   108)
rm_op(l, 'JUMP_IF_FALSE', 111)
rm_op(l, 'EXTENDED_ARG',  143)
rm_op(l, 'JUMP_IF_TRUE',  112)

def_op(l, 'LIST_APPEND',            94, 2, 1) # Calls list.append(TOS[-i], TOS).
                                              # Used to implement list comprehensions.
def_op(l, 'BUILD_SET',             104)       # Number of set items
def_op(l, 'BUILD_MAP',             105)
name_op(l, 'LOAD_ATTR',            106)
compare_op(l, 'COMPARE_OP',        107)

name_op(l, 'IMPORT_NAME',          108,  2,  1)  # Index in name list
name_op(l, 'IMPORT_FROM',          109,  0,  1)

jabs_op(l, 'JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code
jabs_op(l, 'JUMP_IF_TRUE_OR_POP',  112)  # ""
jabs_op(l, 'POP_JUMP_IF_FALSE',    114)  # ""
jabs_op(l, 'POP_JUMP_IF_TRUE',     115)  # ""
jrel_op(l, 'SETUP_WITH',           143,  0,  2)

def_op(l, 'EXTENDED_ARG',          145)
def_op(l, 'SET_ADD',               146,  1,  0)  # Calls set.add(TOS1[-i], TOS).
                                                 # Used to implement set comprehensions.
def_op(l, 'MAP_ADD',               147,  2,  1)  # Calls dict.setitem(TOS1[-i], TOS, TOS1)
                                                 # Used to implement dict comprehensions.
Ejemplo n.º 6
0
# Below are opcode changes since Python 2.6
rm_op(l, 'BUILD_MAP', 104)
rm_op(l, 'LOAD_ATTR', 105)
rm_op(l, 'COMPARE_OP', 106)
rm_op(l, 'IMPORT_NAME', 107)
rm_op(l, 'IMPORT_FROM', 108)
rm_op(l, 'JUMP_IF_FALSE', 111)
rm_op(l, 'EXTENDED_ARG', 143)
rm_op(l, 'JUMP_IF_TRUE', 112)

def_op(l, 'LIST_APPEND', 94, 2, 1)  # Calls list.append(TOS[-i], TOS).
# Used to implement list comprehensions.
def_op(l, 'BUILD_SET', 104)  # Number of set items
def_op(l, 'BUILD_MAP', 105)
name_op(l, 'LOAD_ATTR', 106)
compare_op(l, 'COMPARE_OP', 107)

name_op(l, 'IMPORT_NAME', 108, 2, 1)  # Index in name list
name_op(l, 'IMPORT_FROM', 109, 0, 1)

jabs_op(l, 'JUMP_IF_FALSE_OR_POP',
        111)  # Target byte offset from beginning of code
jabs_op(l, 'JUMP_IF_TRUE_OR_POP', 112)  # ""
jabs_op(l, 'POP_JUMP_IF_FALSE', 114)  # ""
jabs_op(l, 'POP_JUMP_IF_TRUE', 115)  # ""
jrel_op(l, 'SETUP_WITH', 143, 0, 2)

def_op(l, 'EXTENDED_ARG', 145)
def_op(l, 'SET_ADD', 146, 1, 0)  # Calls set.add(TOS1[-i], TOS).
# Used to implement set comprehensions.
def_op(l, 'MAP_ADD', 147, 2, 1)  # Calls dict.setitem(TOS1[-i], TOS, TOS1)