MCPcopy
hub / github.com/rocky/python-uncompyle6 / build_instructions

Method build_instructions

uncompyle6/scanner.py:215–232  ·  view source on GitHub ↗

Create a list of instructions (a structured object rather than an array of bytes) and store that in self.insts

(self, co)

Source from the content-addressed store, hash-verified

213 return new_tokens
214
215 def build_instructions(self, co):
216 """
217 Create a list of instructions (a structured object rather than
218 an array of bytes) and store that in self.insts
219 """
220 # FIXME: remove this when all subsidiary functions have been removed.
221 # We should be able to get everything from the self.insts list.
222 self.code = array("B", co.co_code)
223
224 bytecode = Bytecode(co, self.opc)
225 self.build_prev_op()
226 self.insts = self.remove_extended_args(list(bytecode))
227 self.lines = self.build_lines_data(co)
228 self.offset2inst_index = {}
229 for i, inst in enumerate(self.insts):
230 self.offset2inst_index[inst.offset] = i
231
232 return bytecode
233
234 def build_lines_data(self, code_obj):
235 """

Callers 5

ingestMethod · 0.80
ingestMethod · 0.80
ingestMethod · 0.80
ingestMethod · 0.80
test_if_in_forFunction · 0.80

Calls 3

build_prev_opMethod · 0.95
remove_extended_argsMethod · 0.95
build_lines_dataMethod · 0.95

Tested by 1

test_if_in_forFunction · 0.64