| OLD | NEW |
| 1 | 1 |
| 2 """ | 2 """ |
| 3 opcode module - potentially shared between dis and other modules which | 3 opcode module - potentially shared between dis and other modules which |
| 4 operate on bytecodes (e.g. peephole optimizers). | 4 operate on bytecodes (e.g. peephole optimizers). |
| 5 """ | 5 """ |
| 6 | 6 |
| 7 __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", | 7 __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", |
| 8 "haslocal", "hascompare", "hasfree", "opname", "opmap", | 8 "haslocal", "hascompare", "hasfree", "opname", "opmap", |
| 9 "HAVE_ARGUMENT", "EXTENDED_ARG"] | 9 "HAVE_ARGUMENT", "EXTENDED_ARG"] |
| 10 | 10 |
| (...skipping 132 matching lines...) | | Loading... |
| 143 | 143 |
| 144 def_op('LOAD_CONST', 100) # Index in const list | 144 def_op('LOAD_CONST', 100) # Index in const list |
| 145 hasconst.append(100) | 145 hasconst.append(100) |
| 146 name_op('LOAD_NAME', 101) # Index in name list | 146 name_op('LOAD_NAME', 101) # Index in name list |
| 147 def_op('BUILD_TUPLE', 102) # Number of tuple items | 147 def_op('BUILD_TUPLE', 102) # Number of tuple items |
| 148 def_op('BUILD_LIST', 103) # Number of list items | 148 def_op('BUILD_LIST', 103) # Number of list items |
| 149 def_op('BUILD_MAP', 104) # Number of dict entries (upto 255) | 149 def_op('BUILD_MAP', 104) # Number of dict entries (upto 255) |
| 150 name_op('LOAD_ATTR', 105) # Index in name list | 150 name_op('LOAD_ATTR', 105) # Index in name list |
| 151 def_op('COMPARE_OP', 106) # Comparison operator | 151 def_op('COMPARE_OP', 106) # Comparison operator |
| 152 hascompare.append(106) | 152 hascompare.append(106) |
| 153 |
| 153 # name_op('IMPORT_FROM', 108) # Replaced by #@import_from. | 154 # name_op('IMPORT_FROM', 108) # Replaced by #@import_from. |
| 154 | 155 name_op('LOAD_METHOD', 109) # Index in name list |
| 155 jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip | 156 jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip |
| 156 jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code | 157 jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code |
| 157 jabs_op('JUMP_IF_TRUE_OR_POP', 112) # "" | 158 jabs_op('JUMP_IF_TRUE_OR_POP', 112) # "" |
| 158 jabs_op('JUMP_ABSOLUTE', 113) # "" | 159 jabs_op('JUMP_ABSOLUTE', 113) # "" |
| 159 jabs_op('POP_JUMP_IF_FALSE', 114) # "" | 160 jabs_op('POP_JUMP_IF_FALSE', 114) # "" |
| 160 jabs_op('POP_JUMP_IF_TRUE', 115) # "" | 161 jabs_op('POP_JUMP_IF_TRUE', 115) # "" |
| 161 | 162 |
| 162 name_op('LOAD_GLOBAL', 116) # Index in name list | 163 name_op('LOAD_GLOBAL', 116) # Index in name list |
| 163 | 164 |
| 164 jabs_op('CONTINUE_LOOP', 119) # Target address | 165 jabs_op('CONTINUE_LOOP', 119) # Target address |
| 165 jrel_op('SETUP_LOOP', 120) # Distance to target address | 166 jrel_op('SETUP_LOOP', 120) # Distance to target address |
| 166 jrel_op('SETUP_EXCEPT', 121) # "" | 167 jrel_op('SETUP_EXCEPT', 121) # "" |
| 167 jrel_op('SETUP_FINALLY', 122) # "" | 168 jrel_op('SETUP_FINALLY', 122) # "" |
| 168 | 169 |
| 169 def_op('LOAD_FAST', 124) # Local variable number | 170 def_op('LOAD_FAST', 124) # Local variable number |
| 170 haslocal.append(124) | 171 haslocal.append(124) |
| 171 def_op('STORE_FAST', 125) # Local variable number | 172 def_op('STORE_FAST', 125) # Local variable number |
| 172 haslocal.append(125) | 173 haslocal.append(125) |
| 173 def_op('DELETE_FAST', 126) # Local variable number | 174 def_op('DELETE_FAST', 126) # Local variable number |
| 174 haslocal.append(126) | 175 haslocal.append(126) |
| 175 | 176 |
| 176 def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8) | 177 def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8) |
| 177 # def_op('MAKE_FUNCTION', 132) Replaced by #@make_function calls. | 178 # def_op('MAKE_FUNCTION', 132) Replaced by #@make_function calls. |
| 179 def_op('CALL_METHOD', 133) # #args + (#kwargs << 8) |
| 178 | 180 |
| 179 def_op('MAKE_CLOSURE', 134) | 181 def_op('MAKE_CLOSURE', 134) |
| 180 def_op('LOAD_CLOSURE', 135) | 182 def_op('LOAD_CLOSURE', 135) |
| 181 hasfree.append(135) | 183 hasfree.append(135) |
| 182 def_op('LOAD_DEREF', 136) | 184 def_op('LOAD_DEREF', 136) |
| 183 hasfree.append(136) | 185 hasfree.append(136) |
| 184 def_op('STORE_DEREF', 137) | 186 def_op('STORE_DEREF', 137) |
| 185 hasfree.append(137) | 187 hasfree.append(137) |
| 186 | 188 |
| 187 def_op('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8) | 189 def_op('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8) |
| 188 def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8) | 190 def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8) |
| 189 def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8) | 191 def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8) |
| 190 def_op('EXTENDED_ARG', 143) | 192 def_op('EXTENDED_ARG', 143) |
| 191 EXTENDED_ARG = 143 | 193 EXTENDED_ARG = 143 |
| 192 | 194 |
| 193 del def_op, name_op, jrel_op, jabs_op | 195 del def_op, name_op, jrel_op, jabs_op |
| OLD | NEW |