Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../proc/self/root/lib64/python3....
File: opcode.py
[0] Fix | Delete
"""
[1] Fix | Delete
opcode module - potentially shared between dis and other modules which
[2] Fix | Delete
operate on bytecodes (e.g. peephole optimizers).
[3] Fix | Delete
"""
[4] Fix | Delete
[5] Fix | Delete
__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
[6] Fix | Delete
"haslocal", "hascompare", "hasfree", "opname", "opmap",
[7] Fix | Delete
"HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"]
[8] Fix | Delete
[9] Fix | Delete
# It's a chicken-and-egg I'm afraid:
[10] Fix | Delete
# We're imported before _opcode's made.
[11] Fix | Delete
# With exception unheeded
[12] Fix | Delete
# (stack_effect is not needed)
[13] Fix | Delete
# Both our chickens and eggs are allayed.
[14] Fix | Delete
# --Larry Hastings, 2013/11/23
[15] Fix | Delete
[16] Fix | Delete
try:
[17] Fix | Delete
from _opcode import stack_effect
[18] Fix | Delete
__all__.append('stack_effect')
[19] Fix | Delete
except ImportError:
[20] Fix | Delete
pass
[21] Fix | Delete
[22] Fix | Delete
cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is',
[23] Fix | Delete
'is not', 'exception match', 'BAD')
[24] Fix | Delete
[25] Fix | Delete
hasconst = []
[26] Fix | Delete
hasname = []
[27] Fix | Delete
hasjrel = []
[28] Fix | Delete
hasjabs = []
[29] Fix | Delete
haslocal = []
[30] Fix | Delete
hascompare = []
[31] Fix | Delete
hasfree = []
[32] Fix | Delete
hasnargs = [] # unused
[33] Fix | Delete
[34] Fix | Delete
opmap = {}
[35] Fix | Delete
opname = ['<%r>' % (op,) for op in range(256)]
[36] Fix | Delete
[37] Fix | Delete
def def_op(name, op):
[38] Fix | Delete
opname[op] = name
[39] Fix | Delete
opmap[name] = op
[40] Fix | Delete
[41] Fix | Delete
def name_op(name, op):
[42] Fix | Delete
def_op(name, op)
[43] Fix | Delete
hasname.append(op)
[44] Fix | Delete
[45] Fix | Delete
def jrel_op(name, op):
[46] Fix | Delete
def_op(name, op)
[47] Fix | Delete
hasjrel.append(op)
[48] Fix | Delete
[49] Fix | Delete
def jabs_op(name, op):
[50] Fix | Delete
def_op(name, op)
[51] Fix | Delete
hasjabs.append(op)
[52] Fix | Delete
[53] Fix | Delete
# Instruction opcodes for compiled code
[54] Fix | Delete
# Blank lines correspond to available opcodes
[55] Fix | Delete
[56] Fix | Delete
def_op('POP_TOP', 1)
[57] Fix | Delete
def_op('ROT_TWO', 2)
[58] Fix | Delete
def_op('ROT_THREE', 3)
[59] Fix | Delete
def_op('DUP_TOP', 4)
[60] Fix | Delete
def_op('DUP_TOP_TWO', 5)
[61] Fix | Delete
[62] Fix | Delete
def_op('NOP', 9)
[63] Fix | Delete
def_op('UNARY_POSITIVE', 10)
[64] Fix | Delete
def_op('UNARY_NEGATIVE', 11)
[65] Fix | Delete
def_op('UNARY_NOT', 12)
[66] Fix | Delete
[67] Fix | Delete
def_op('UNARY_INVERT', 15)
[68] Fix | Delete
[69] Fix | Delete
def_op('BINARY_MATRIX_MULTIPLY', 16)
[70] Fix | Delete
def_op('INPLACE_MATRIX_MULTIPLY', 17)
[71] Fix | Delete
[72] Fix | Delete
def_op('BINARY_POWER', 19)
[73] Fix | Delete
def_op('BINARY_MULTIPLY', 20)
[74] Fix | Delete
[75] Fix | Delete
def_op('BINARY_MODULO', 22)
[76] Fix | Delete
def_op('BINARY_ADD', 23)
[77] Fix | Delete
def_op('BINARY_SUBTRACT', 24)
[78] Fix | Delete
def_op('BINARY_SUBSCR', 25)
[79] Fix | Delete
def_op('BINARY_FLOOR_DIVIDE', 26)
[80] Fix | Delete
def_op('BINARY_TRUE_DIVIDE', 27)
[81] Fix | Delete
def_op('INPLACE_FLOOR_DIVIDE', 28)
[82] Fix | Delete
def_op('INPLACE_TRUE_DIVIDE', 29)
[83] Fix | Delete
[84] Fix | Delete
def_op('GET_AITER', 50)
[85] Fix | Delete
def_op('GET_ANEXT', 51)
[86] Fix | Delete
def_op('BEFORE_ASYNC_WITH', 52)
[87] Fix | Delete
[88] Fix | Delete
def_op('INPLACE_ADD', 55)
[89] Fix | Delete
def_op('INPLACE_SUBTRACT', 56)
[90] Fix | Delete
def_op('INPLACE_MULTIPLY', 57)
[91] Fix | Delete
[92] Fix | Delete
def_op('INPLACE_MODULO', 59)
[93] Fix | Delete
def_op('STORE_SUBSCR', 60)
[94] Fix | Delete
def_op('DELETE_SUBSCR', 61)
[95] Fix | Delete
def_op('BINARY_LSHIFT', 62)
[96] Fix | Delete
def_op('BINARY_RSHIFT', 63)
[97] Fix | Delete
def_op('BINARY_AND', 64)
[98] Fix | Delete
def_op('BINARY_XOR', 65)
[99] Fix | Delete
def_op('BINARY_OR', 66)
[100] Fix | Delete
def_op('INPLACE_POWER', 67)
[101] Fix | Delete
def_op('GET_ITER', 68)
[102] Fix | Delete
def_op('GET_YIELD_FROM_ITER', 69)
[103] Fix | Delete
[104] Fix | Delete
def_op('PRINT_EXPR', 70)
[105] Fix | Delete
def_op('LOAD_BUILD_CLASS', 71)
[106] Fix | Delete
def_op('YIELD_FROM', 72)
[107] Fix | Delete
def_op('GET_AWAITABLE', 73)
[108] Fix | Delete
[109] Fix | Delete
def_op('INPLACE_LSHIFT', 75)
[110] Fix | Delete
def_op('INPLACE_RSHIFT', 76)
[111] Fix | Delete
def_op('INPLACE_AND', 77)
[112] Fix | Delete
def_op('INPLACE_XOR', 78)
[113] Fix | Delete
def_op('INPLACE_OR', 79)
[114] Fix | Delete
def_op('BREAK_LOOP', 80)
[115] Fix | Delete
def_op('WITH_CLEANUP_START', 81)
[116] Fix | Delete
def_op('WITH_CLEANUP_FINISH', 82)
[117] Fix | Delete
[118] Fix | Delete
def_op('RETURN_VALUE', 83)
[119] Fix | Delete
def_op('IMPORT_STAR', 84)
[120] Fix | Delete
def_op('SETUP_ANNOTATIONS', 85)
[121] Fix | Delete
def_op('YIELD_VALUE', 86)
[122] Fix | Delete
def_op('POP_BLOCK', 87)
[123] Fix | Delete
def_op('END_FINALLY', 88)
[124] Fix | Delete
def_op('POP_EXCEPT', 89)
[125] Fix | Delete
[126] Fix | Delete
HAVE_ARGUMENT = 90 # Opcodes from here have an argument:
[127] Fix | Delete
[128] Fix | Delete
name_op('STORE_NAME', 90) # Index in name list
[129] Fix | Delete
name_op('DELETE_NAME', 91) # ""
[130] Fix | Delete
def_op('UNPACK_SEQUENCE', 92) # Number of tuple items
[131] Fix | Delete
jrel_op('FOR_ITER', 93)
[132] Fix | Delete
def_op('UNPACK_EX', 94)
[133] Fix | Delete
name_op('STORE_ATTR', 95) # Index in name list
[134] Fix | Delete
name_op('DELETE_ATTR', 96) # ""
[135] Fix | Delete
name_op('STORE_GLOBAL', 97) # ""
[136] Fix | Delete
name_op('DELETE_GLOBAL', 98) # ""
[137] Fix | Delete
def_op('LOAD_CONST', 100) # Index in const list
[138] Fix | Delete
hasconst.append(100)
[139] Fix | Delete
name_op('LOAD_NAME', 101) # Index in name list
[140] Fix | Delete
def_op('BUILD_TUPLE', 102) # Number of tuple items
[141] Fix | Delete
def_op('BUILD_LIST', 103) # Number of list items
[142] Fix | Delete
def_op('BUILD_SET', 104) # Number of set items
[143] Fix | Delete
def_op('BUILD_MAP', 105) # Number of dict entries
[144] Fix | Delete
name_op('LOAD_ATTR', 106) # Index in name list
[145] Fix | Delete
def_op('COMPARE_OP', 107) # Comparison operator
[146] Fix | Delete
hascompare.append(107)
[147] Fix | Delete
name_op('IMPORT_NAME', 108) # Index in name list
[148] Fix | Delete
name_op('IMPORT_FROM', 109) # Index in name list
[149] Fix | Delete
[150] Fix | Delete
jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip
[151] Fix | Delete
jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code
[152] Fix | Delete
jabs_op('JUMP_IF_TRUE_OR_POP', 112) # ""
[153] Fix | Delete
jabs_op('JUMP_ABSOLUTE', 113) # ""
[154] Fix | Delete
jabs_op('POP_JUMP_IF_FALSE', 114) # ""
[155] Fix | Delete
jabs_op('POP_JUMP_IF_TRUE', 115) # ""
[156] Fix | Delete
[157] Fix | Delete
name_op('LOAD_GLOBAL', 116) # Index in name list
[158] Fix | Delete
[159] Fix | Delete
jabs_op('CONTINUE_LOOP', 119) # Target address
[160] Fix | Delete
jrel_op('SETUP_LOOP', 120) # Distance to target address
[161] Fix | Delete
jrel_op('SETUP_EXCEPT', 121) # ""
[162] Fix | Delete
jrel_op('SETUP_FINALLY', 122) # ""
[163] Fix | Delete
[164] Fix | Delete
def_op('LOAD_FAST', 124) # Local variable number
[165] Fix | Delete
haslocal.append(124)
[166] Fix | Delete
def_op('STORE_FAST', 125) # Local variable number
[167] Fix | Delete
haslocal.append(125)
[168] Fix | Delete
def_op('DELETE_FAST', 126) # Local variable number
[169] Fix | Delete
haslocal.append(126)
[170] Fix | Delete
name_op('STORE_ANNOTATION', 127) # Index in name list
[171] Fix | Delete
[172] Fix | Delete
def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
[173] Fix | Delete
def_op('CALL_FUNCTION', 131) # #args
[174] Fix | Delete
def_op('MAKE_FUNCTION', 132) # Flags
[175] Fix | Delete
def_op('BUILD_SLICE', 133) # Number of items
[176] Fix | Delete
def_op('LOAD_CLOSURE', 135)
[177] Fix | Delete
hasfree.append(135)
[178] Fix | Delete
def_op('LOAD_DEREF', 136)
[179] Fix | Delete
hasfree.append(136)
[180] Fix | Delete
def_op('STORE_DEREF', 137)
[181] Fix | Delete
hasfree.append(137)
[182] Fix | Delete
def_op('DELETE_DEREF', 138)
[183] Fix | Delete
hasfree.append(138)
[184] Fix | Delete
[185] Fix | Delete
def_op('CALL_FUNCTION_KW', 141) # #args + #kwargs
[186] Fix | Delete
def_op('CALL_FUNCTION_EX', 142) # Flags
[187] Fix | Delete
[188] Fix | Delete
jrel_op('SETUP_WITH', 143)
[189] Fix | Delete
[190] Fix | Delete
def_op('LIST_APPEND', 145)
[191] Fix | Delete
def_op('SET_ADD', 146)
[192] Fix | Delete
def_op('MAP_ADD', 147)
[193] Fix | Delete
[194] Fix | Delete
def_op('LOAD_CLASSDEREF', 148)
[195] Fix | Delete
hasfree.append(148)
[196] Fix | Delete
[197] Fix | Delete
def_op('EXTENDED_ARG', 144)
[198] Fix | Delete
EXTENDED_ARG = 144
[199] Fix | Delete
[200] Fix | Delete
def_op('BUILD_LIST_UNPACK', 149)
[201] Fix | Delete
def_op('BUILD_MAP_UNPACK', 150)
[202] Fix | Delete
def_op('BUILD_MAP_UNPACK_WITH_CALL', 151)
[203] Fix | Delete
def_op('BUILD_TUPLE_UNPACK', 152)
[204] Fix | Delete
def_op('BUILD_SET_UNPACK', 153)
[205] Fix | Delete
[206] Fix | Delete
jrel_op('SETUP_ASYNC_WITH', 154)
[207] Fix | Delete
[208] Fix | Delete
def_op('FORMAT_VALUE', 155)
[209] Fix | Delete
def_op('BUILD_CONST_KEY_MAP', 156)
[210] Fix | Delete
def_op('BUILD_STRING', 157)
[211] Fix | Delete
def_op('BUILD_TUPLE_UNPACK_WITH_CALL', 158)
[212] Fix | Delete
[213] Fix | Delete
del def_op, name_op, jrel_op, jabs_op
[214] Fix | Delete
[215] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function