(instrs, co_positions)
| 12 | _UNSPECIFIED = object() |
| 13 | |
| 14 | def instructions_with_positions(instrs, co_positions): |
| 15 | # Return (instr, positions) pairs from the instrs list and co_positions |
| 16 | # iterator. The latter contains items for cache lines and the former |
| 17 | # doesn't, so those need to be skipped. |
| 18 | |
| 19 | co_positions = co_positions or iter(()) |
| 20 | for instr in instrs: |
| 21 | yield instr, next(co_positions, ()) |
| 22 | for _, size, _ in (instr.cache_info or ()): |
| 23 | for i in range(size): |
| 24 | next(co_positions, ()) |
| 25 | |
| 26 | class BytecodeTestCase(unittest.TestCase): |
| 27 | """Custom assertion methods for inspecting bytecode.""" |
no outgoing calls
searching dependent graphs…