Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/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
def_op('ROT_FOUR', 6)
[62] Fix | Delete
[63] Fix | Delete
def_op('NOP', 9)
[64] Fix | Delete
def_op('UNARY_POSITIVE', 10)
[65] Fix | Delete
def_op('UNARY_NEGATIVE', 11)
[66] Fix | Delete
def_op('UNARY_NOT', 12)
[67] Fix | Delete
[68] Fix | Delete
def_op('UNARY_INVERT', 15)
[69] Fix | Delete
[70] Fix | Delete
def_op('BINARY_MATRIX_MULTIPLY', 16)
[71] Fix | Delete
def_op('INPLACE_MATRIX_MULTIPLY', 17)
[72] Fix | Delete
[73] Fix | Delete
def_op('BINARY_POWER', 19)
[74] Fix | Delete
def_op('BINARY_MULTIPLY', 20)
[75] Fix | Delete
[76] Fix | Delete
def_op('BINARY_MODULO', 22)
[77] Fix | Delete
def_op('BINARY_ADD', 23)
[78] Fix | Delete
def_op('BINARY_SUBTRACT', 24)
[79] Fix | Delete
def_op('BINARY_SUBSCR', 25)
[80] Fix | Delete
def_op('BINARY_FLOOR_DIVIDE', 26)
[81] Fix | Delete
def_op('BINARY_TRUE_DIVIDE', 27)
[82] Fix | Delete
def_op('INPLACE_FLOOR_DIVIDE', 28)
[83] Fix | Delete
def_op('INPLACE_TRUE_DIVIDE', 29)
[84] Fix | Delete
[85] Fix | Delete
def_op('GET_AITER', 50)
[86] Fix | Delete
def_op('GET_ANEXT', 51)
[87] Fix | Delete
def_op('BEFORE_ASYNC_WITH', 52)
[88] Fix | Delete
def_op('BEGIN_FINALLY', 53)
[89] Fix | Delete
def_op('END_ASYNC_FOR', 54)
[90] Fix | Delete
def_op('INPLACE_ADD', 55)
[91] Fix | Delete
def_op('INPLACE_SUBTRACT', 56)
[92] Fix | Delete
def_op('INPLACE_MULTIPLY', 57)
[93] Fix | Delete
[94] Fix | Delete
def_op('INPLACE_MODULO', 59)
[95] Fix | Delete
def_op('STORE_SUBSCR', 60)
[96] Fix | Delete
def_op('DELETE_SUBSCR', 61)
[97] Fix | Delete
def_op('BINARY_LSHIFT', 62)
[98] Fix | Delete
def_op('BINARY_RSHIFT', 63)
[99] Fix | Delete
def_op('BINARY_AND', 64)
[100] Fix | Delete
def_op('BINARY_XOR', 65)
[101] Fix | Delete
def_op('BINARY_OR', 66)
[102] Fix | Delete
def_op('INPLACE_POWER', 67)
[103] Fix | Delete
def_op('GET_ITER', 68)
[104] Fix | Delete
def_op('GET_YIELD_FROM_ITER', 69)
[105] Fix | Delete
[106] Fix | Delete
def_op('PRINT_EXPR', 70)
[107] Fix | Delete
def_op('LOAD_BUILD_CLASS', 71)
[108] Fix | Delete
def_op('YIELD_FROM', 72)
[109] Fix | Delete
def_op('GET_AWAITABLE', 73)
[110] Fix | Delete
[111] Fix | Delete
def_op('INPLACE_LSHIFT', 75)
[112] Fix | Delete
def_op('INPLACE_RSHIFT', 76)
[113] Fix | Delete
def_op('INPLACE_AND', 77)
[114] Fix | Delete
def_op('INPLACE_XOR', 78)
[115] Fix | Delete
def_op('INPLACE_OR', 79)
[116] Fix | Delete
def_op('WITH_CLEANUP_START', 81)
[117] Fix | Delete
def_op('WITH_CLEANUP_FINISH', 82)
[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
jrel_op('SETUP_FINALLY', 122) # Distance to target address
[160] Fix | Delete
[161] Fix | Delete
def_op('LOAD_FAST', 124) # Local variable number
[162] Fix | Delete
haslocal.append(124)
[163] Fix | Delete
def_op('STORE_FAST', 125) # Local variable number
[164] Fix | Delete
haslocal.append(125)
[165] Fix | Delete
def_op('DELETE_FAST', 126) # Local variable number
[166] Fix | Delete
haslocal.append(126)
[167] Fix | Delete
[168] Fix | Delete
def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
[169] Fix | Delete
def_op('CALL_FUNCTION', 131) # #args
[170] Fix | Delete
def_op('MAKE_FUNCTION', 132) # Flags
[171] Fix | Delete
def_op('BUILD_SLICE', 133) # Number of items
[172] Fix | Delete
def_op('LOAD_CLOSURE', 135)
[173] Fix | Delete
hasfree.append(135)
[174] Fix | Delete
def_op('LOAD_DEREF', 136)
[175] Fix | Delete
hasfree.append(136)
[176] Fix | Delete
def_op('STORE_DEREF', 137)
[177] Fix | Delete
hasfree.append(137)
[178] Fix | Delete
def_op('DELETE_DEREF', 138)
[179] Fix | Delete
hasfree.append(138)
[180] Fix | Delete
[181] Fix | Delete
def_op('CALL_FUNCTION_KW', 141) # #args + #kwargs
[182] Fix | Delete
def_op('CALL_FUNCTION_EX', 142) # Flags
[183] Fix | Delete
[184] Fix | Delete
jrel_op('SETUP_WITH', 143)
[185] Fix | Delete
[186] Fix | Delete
def_op('LIST_APPEND', 145)
[187] Fix | Delete
def_op('SET_ADD', 146)
[188] Fix | Delete
def_op('MAP_ADD', 147)
[189] Fix | Delete
[190] Fix | Delete
def_op('LOAD_CLASSDEREF', 148)
[191] Fix | Delete
hasfree.append(148)
[192] Fix | Delete
[193] Fix | Delete
def_op('EXTENDED_ARG', 144)
[194] Fix | Delete
EXTENDED_ARG = 144
[195] Fix | Delete
[196] Fix | Delete
def_op('BUILD_LIST_UNPACK', 149)
[197] Fix | Delete
def_op('BUILD_MAP_UNPACK', 150)
[198] Fix | Delete
def_op('BUILD_MAP_UNPACK_WITH_CALL', 151)
[199] Fix | Delete
def_op('BUILD_TUPLE_UNPACK', 152)
[200] Fix | Delete
def_op('BUILD_SET_UNPACK', 153)
[201] Fix | Delete
[202] Fix | Delete
jrel_op('SETUP_ASYNC_WITH', 154)
[203] Fix | Delete
[204] Fix | Delete
def_op('FORMAT_VALUE', 155)
[205] Fix | Delete
def_op('BUILD_CONST_KEY_MAP', 156)
[206] Fix | Delete
def_op('BUILD_STRING', 157)
[207] Fix | Delete
def_op('BUILD_TUPLE_UNPACK_WITH_CALL', 158)
[208] Fix | Delete
[209] Fix | Delete
name_op('LOAD_METHOD', 160)
[210] Fix | Delete
def_op('CALL_METHOD', 161)
[211] Fix | Delete
jrel_op('CALL_FINALLY', 162)
[212] Fix | Delete
def_op('POP_FINALLY', 163)
[213] Fix | Delete
[214] Fix | Delete
del def_op, name_op, jrel_op, jabs_op
[215] Fix | Delete
[216] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function