Back to index

python3.2  3.2.2
Functions | Variables
opcode Namespace Reference

Functions

def def_op
def name_op
def jrel_op
def jabs_op

Variables

list __all__
tuple cmp_op
list hasconst = []
list hasname = []
list hasjrel = []
list hasjabs = []
list haslocal = []
list hascompare = []
list hasfree = []
dictionary opmap = {}
list opname = ['']
int HAVE_ARGUMENT = 90
int EXTENDED_ARG = 144

Detailed Description

opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).

Function Documentation

def opcode.def_op (   name,
  op 
)

Definition at line 27 of file opcode.py.

00027 
00028 def def_op(name, op):
00029     opname[op] = name
00030     opmap[name] = op

Here is the caller graph for this function:

def opcode.jabs_op (   name,
  op 
)

Definition at line 39 of file opcode.py.

00039 
00040 def jabs_op(name, op):
00041     def_op(name, op)
00042     hasjabs.append(op)
00043 
00044 # Instruction opcodes for compiled code
00045 # Blank lines correspond to available opcodes
00046 
00047 def_op('STOP_CODE', 0)
00048 def_op('POP_TOP', 1)
00049 def_op('ROT_TWO', 2)
00050 def_op('ROT_THREE', 3)
00051 def_op('DUP_TOP', 4)
00052 def_op('DUP_TOP_TWO', 5)
00053 
00054 def_op('NOP', 9)
00055 def_op('UNARY_POSITIVE', 10)
00056 def_op('UNARY_NEGATIVE', 11)
00057 def_op('UNARY_NOT', 12)
00058 
00059 def_op('UNARY_INVERT', 15)
00060 
00061 def_op('BINARY_POWER', 19)
00062 def_op('BINARY_MULTIPLY', 20)
00063 
00064 def_op('BINARY_MODULO', 22)
00065 def_op('BINARY_ADD', 23)
00066 def_op('BINARY_SUBTRACT', 24)
00067 def_op('BINARY_SUBSCR', 25)
00068 def_op('BINARY_FLOOR_DIVIDE', 26)
00069 def_op('BINARY_TRUE_DIVIDE', 27)
00070 def_op('INPLACE_FLOOR_DIVIDE', 28)
00071 def_op('INPLACE_TRUE_DIVIDE', 29)
00072 
00073 def_op('STORE_MAP', 54)
00074 def_op('INPLACE_ADD', 55)
00075 def_op('INPLACE_SUBTRACT', 56)
00076 def_op('INPLACE_MULTIPLY', 57)
00077 
00078 def_op('INPLACE_MODULO', 59)
00079 def_op('STORE_SUBSCR', 60)
00080 def_op('DELETE_SUBSCR', 61)
00081 def_op('BINARY_LSHIFT', 62)
00082 def_op('BINARY_RSHIFT', 63)
00083 def_op('BINARY_AND', 64)
00084 def_op('BINARY_XOR', 65)
00085 def_op('BINARY_OR', 66)
00086 def_op('INPLACE_POWER', 67)
00087 def_op('GET_ITER', 68)
00088 def_op('STORE_LOCALS', 69)
00089 
00090 def_op('PRINT_EXPR', 70)
00091 def_op('LOAD_BUILD_CLASS', 71)
00092 
00093 def_op('INPLACE_LSHIFT', 75)
00094 def_op('INPLACE_RSHIFT', 76)
00095 def_op('INPLACE_AND', 77)
00096 def_op('INPLACE_XOR', 78)
00097 def_op('INPLACE_OR', 79)
00098 def_op('BREAK_LOOP', 80)
00099 def_op('WITH_CLEANUP', 81)
00100 
00101 def_op('RETURN_VALUE', 83)
00102 def_op('IMPORT_STAR', 84)
00103 
00104 def_op('YIELD_VALUE', 86)
00105 def_op('POP_BLOCK', 87)
00106 def_op('END_FINALLY', 88)
00107 def_op('POP_EXCEPT', 89)

Here is the call graph for this function:

def opcode.jrel_op (   name,
  op 
)

Definition at line 35 of file opcode.py.

00035 
00036 def jrel_op(name, op):
00037     def_op(name, op)
00038     hasjrel.append(op)

Here is the call graph for this function:

def opcode.name_op (   name,
  op 
)

Definition at line 31 of file opcode.py.

00031 
00032 def name_op(name, op):
00033     def_op(name, op)
00034     hasname.append(op)

Here is the call graph for this function:


Variable Documentation

Initial value:
00001 ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
00002            "haslocal", "hascompare", "hasfree", "opname", "opmap",
00003            "HAVE_ARGUMENT", "EXTENDED_ARG"]

Definition at line 7 of file opcode.py.

Initial value:
00001 ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is',
00002         'is not', 'exception match', 'BAD')

Definition at line 11 of file opcode.py.

Definition at line 178 of file opcode.py.

list opcode.hascompare = []

Definition at line 19 of file opcode.py.

list opcode.hasconst = []

Definition at line 14 of file opcode.py.

list opcode.hasfree = []

Definition at line 20 of file opcode.py.

list opcode.hasjabs = []

Definition at line 17 of file opcode.py.

list opcode.hasjrel = []

Definition at line 16 of file opcode.py.

list opcode.haslocal = []

Definition at line 18 of file opcode.py.

list opcode.hasname = []

Definition at line 15 of file opcode.py.

Definition at line 108 of file opcode.py.

Definition at line 22 of file opcode.py.

list opcode.opname = ['']

Definition at line 23 of file opcode.py.