Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/imh-pyth.../lib/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 = ('<', '<=', '==', '!=', '>', '>=')
[23] Fix | Delete
[24] Fix | Delete
hasconst = []
[25] Fix | Delete
hasname = []
[26] Fix | Delete
hasjrel = []
[27] Fix | Delete
hasjabs = []
[28] Fix | Delete
haslocal = []
[29] Fix | Delete
hascompare = []
[30] Fix | Delete
hasfree = []
[31] Fix | Delete
hasnargs = [] # unused
[32] Fix | Delete
[33] Fix | Delete
opmap = {}
[34] Fix | Delete
opname = ['<%r>' % (op,) for op in range(256)]
[35] Fix | Delete
[36] Fix | Delete
def def_op(name, op):
[37] Fix | Delete
opname[op] = name
[38] Fix | Delete
opmap[name] = op
[39] Fix | Delete
[40] Fix | Delete
def name_op(name, op):
[41] Fix | Delete
def_op(name, op)
[42] Fix | Delete
hasname.append(op)
[43] Fix | Delete
[44] Fix | Delete
def jrel_op(name, op):
[45] Fix | Delete
def_op(name, op)
[46] Fix | Delete
hasjrel.append(op)
[47] Fix | Delete
[48] Fix | Delete
def jabs_op(name, op):
[49] Fix | Delete
def_op(name, op)
[50] Fix | Delete
hasjabs.append(op)
[51] Fix | Delete
[52] Fix | Delete
# Instruction opcodes for compiled code
[53] Fix | Delete
# Blank lines correspond to available opcodes
[54] Fix | Delete
[55] Fix | Delete
def_op('POP_TOP', 1)
[56] Fix | Delete
def_op('ROT_TWO', 2)
[57] Fix | Delete
def_op('ROT_THREE', 3)
[58] Fix | Delete
def_op('DUP_TOP', 4)
[59] Fix | Delete
def_op('DUP_TOP_TWO', 5)
[60] Fix | Delete
def_op('ROT_FOUR', 6)
[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('RERAISE', 48)
[85] Fix | Delete
def_op('WITH_EXCEPT_START', 49)
[86] Fix | Delete
def_op('GET_AITER', 50)
[87] Fix | Delete
def_op('GET_ANEXT', 51)
[88] Fix | Delete
def_op('BEFORE_ASYNC_WITH', 52)
[89] Fix | Delete
[90] Fix | Delete
def_op('END_ASYNC_FOR', 54)
[91] Fix | Delete
def_op('INPLACE_ADD', 55)
[92] Fix | Delete
def_op('INPLACE_SUBTRACT', 56)
[93] Fix | Delete
def_op('INPLACE_MULTIPLY', 57)
[94] Fix | Delete
[95] Fix | Delete
def_op('INPLACE_MODULO', 59)
[96] Fix | Delete
def_op('STORE_SUBSCR', 60)
[97] Fix | Delete
def_op('DELETE_SUBSCR', 61)
[98] Fix | Delete
def_op('BINARY_LSHIFT', 62)
[99] Fix | Delete
def_op('BINARY_RSHIFT', 63)
[100] Fix | Delete
def_op('BINARY_AND', 64)
[101] Fix | Delete
def_op('BINARY_XOR', 65)
[102] Fix | Delete
def_op('BINARY_OR', 66)
[103] Fix | Delete
def_op('INPLACE_POWER', 67)
[104] Fix | Delete
def_op('GET_ITER', 68)
[105] Fix | Delete
def_op('GET_YIELD_FROM_ITER', 69)
[106] Fix | Delete
[107] Fix | Delete
def_op('PRINT_EXPR', 70)
[108] Fix | Delete
def_op('LOAD_BUILD_CLASS', 71)
[109] Fix | Delete
def_op('YIELD_FROM', 72)
[110] Fix | Delete
def_op('GET_AWAITABLE', 73)
[111] Fix | Delete
def_op('LOAD_ASSERTION_ERROR', 74)
[112] Fix | Delete
def_op('INPLACE_LSHIFT', 75)
[113] Fix | Delete
def_op('INPLACE_RSHIFT', 76)
[114] Fix | Delete
def_op('INPLACE_AND', 77)
[115] Fix | Delete
def_op('INPLACE_XOR', 78)
[116] Fix | Delete
def_op('INPLACE_OR', 79)
[117] Fix | Delete
[118] Fix | Delete
def_op('LIST_TO_TUPLE', 82)
[119] Fix | Delete
def_op('RETURN_VALUE', 83)
[120] Fix | Delete
def_op('IMPORT_STAR', 84)
[121] Fix | Delete
def_op('SETUP_ANNOTATIONS', 85)
[122] Fix | Delete
def_op('YIELD_VALUE', 86)
[123] Fix | Delete
def_op('POP_BLOCK', 87)
[124] Fix | Delete
[125] Fix | Delete
def_op('POP_EXCEPT', 89)
[126] Fix | Delete
[127] Fix | Delete
HAVE_ARGUMENT = 90 # Opcodes from here have an argument:
[128] Fix | Delete
[129] Fix | Delete
name_op('STORE_NAME', 90) # Index in name list
[130] Fix | Delete
name_op('DELETE_NAME', 91) # ""
[131] Fix | Delete
def_op('UNPACK_SEQUENCE', 92) # Number of tuple items
[132] Fix | Delete
jrel_op('FOR_ITER', 93)
[133] Fix | Delete
def_op('UNPACK_EX', 94)
[134] Fix | Delete
name_op('STORE_ATTR', 95) # Index in name list
[135] Fix | Delete
name_op('DELETE_ATTR', 96) # ""
[136] Fix | Delete
name_op('STORE_GLOBAL', 97) # ""
[137] Fix | Delete
name_op('DELETE_GLOBAL', 98) # ""
[138] Fix | Delete
def_op('LOAD_CONST', 100) # Index in const list
[139] Fix | Delete
hasconst.append(100)
[140] Fix | Delete
name_op('LOAD_NAME', 101) # Index in name list
[141] Fix | Delete
def_op('BUILD_TUPLE', 102) # Number of tuple items
[142] Fix | Delete
def_op('BUILD_LIST', 103) # Number of list items
[143] Fix | Delete
def_op('BUILD_SET', 104) # Number of set items
[144] Fix | Delete
def_op('BUILD_MAP', 105) # Number of dict entries
[145] Fix | Delete
name_op('LOAD_ATTR', 106) # Index in name list
[146] Fix | Delete
def_op('COMPARE_OP', 107) # Comparison operator
[147] Fix | Delete
hascompare.append(107)
[148] Fix | Delete
name_op('IMPORT_NAME', 108) # Index in name list
[149] Fix | Delete
name_op('IMPORT_FROM', 109) # Index in name list
[150] Fix | Delete
[151] Fix | Delete
jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip
[152] Fix | Delete
jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code
[153] Fix | Delete
jabs_op('JUMP_IF_TRUE_OR_POP', 112) # ""
[154] Fix | Delete
jabs_op('JUMP_ABSOLUTE', 113) # ""
[155] Fix | Delete
jabs_op('POP_JUMP_IF_FALSE', 114) # ""
[156] Fix | Delete
jabs_op('POP_JUMP_IF_TRUE', 115) # ""
[157] Fix | Delete
[158] Fix | Delete
name_op('LOAD_GLOBAL', 116) # Index in name list
[159] Fix | Delete
[160] Fix | Delete
def_op('IS_OP', 117)
[161] Fix | Delete
def_op('CONTAINS_OP', 118)
[162] Fix | Delete
[163] Fix | Delete
jabs_op('JUMP_IF_NOT_EXC_MATCH', 121)
[164] Fix | Delete
jrel_op('SETUP_FINALLY', 122) # Distance to target address
[165] Fix | Delete
[166] Fix | Delete
def_op('LOAD_FAST', 124) # Local variable number
[167] Fix | Delete
haslocal.append(124)
[168] Fix | Delete
def_op('STORE_FAST', 125) # Local variable number
[169] Fix | Delete
haslocal.append(125)
[170] Fix | Delete
def_op('DELETE_FAST', 126) # Local variable number
[171] Fix | Delete
haslocal.append(126)
[172] Fix | Delete
[173] Fix | Delete
def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
[174] Fix | Delete
def_op('CALL_FUNCTION', 131) # #args
[175] Fix | Delete
def_op('MAKE_FUNCTION', 132) # Flags
[176] Fix | Delete
def_op('BUILD_SLICE', 133) # Number of items
[177] Fix | Delete
def_op('LOAD_CLOSURE', 135)
[178] Fix | Delete
hasfree.append(135)
[179] Fix | Delete
def_op('LOAD_DEREF', 136)
[180] Fix | Delete
hasfree.append(136)
[181] Fix | Delete
def_op('STORE_DEREF', 137)
[182] Fix | Delete
hasfree.append(137)
[183] Fix | Delete
def_op('DELETE_DEREF', 138)
[184] Fix | Delete
hasfree.append(138)
[185] Fix | Delete
[186] Fix | Delete
def_op('CALL_FUNCTION_KW', 141) # #args + #kwargs
[187] Fix | Delete
def_op('CALL_FUNCTION_EX', 142) # Flags
[188] Fix | Delete
[189] Fix | Delete
jrel_op('SETUP_WITH', 143)
[190] Fix | Delete
[191] Fix | Delete
def_op('LIST_APPEND', 145)
[192] Fix | Delete
def_op('SET_ADD', 146)
[193] Fix | Delete
def_op('MAP_ADD', 147)
[194] Fix | Delete
[195] Fix | Delete
def_op('LOAD_CLASSDEREF', 148)
[196] Fix | Delete
hasfree.append(148)
[197] Fix | Delete
[198] Fix | Delete
def_op('EXTENDED_ARG', 144)
[199] Fix | Delete
EXTENDED_ARG = 144
[200] Fix | Delete
[201] Fix | Delete
jrel_op('SETUP_ASYNC_WITH', 154)
[202] Fix | Delete
[203] Fix | Delete
def_op('FORMAT_VALUE', 155)
[204] Fix | Delete
def_op('BUILD_CONST_KEY_MAP', 156)
[205] Fix | Delete
def_op('BUILD_STRING', 157)
[206] Fix | Delete
[207] Fix | Delete
name_op('LOAD_METHOD', 160)
[208] Fix | Delete
def_op('CALL_METHOD', 161)
[209] Fix | Delete
[210] Fix | Delete
def_op('LIST_EXTEND', 162)
[211] Fix | Delete
def_op('SET_UPDATE', 163)
[212] Fix | Delete
def_op('DICT_MERGE', 164)
[213] Fix | Delete
def_op('DICT_UPDATE', 165)
[214] Fix | Delete
[215] Fix | Delete
del def_op, name_op, jrel_op, jabs_op
[216] Fix | Delete
[217] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function