()
| 52 | |
| 53 | |
| 54 | def _load_metadata_from_source(): |
| 55 | def get_defines(filepath: Path, prefix: str = "SPEC_FAIL"): |
| 56 | with open(SOURCE_DIR / filepath) as spec_src: |
| 57 | defines = collections.defaultdict(list) |
| 58 | start = "#define " + prefix + "_" |
| 59 | for line in spec_src: |
| 60 | line = line.strip() |
| 61 | if not line.startswith(start): |
| 62 | continue |
| 63 | line = line[len(start) :] |
| 64 | name, val = line.split() |
| 65 | defines[int(val.strip())].append(name.strip()) |
| 66 | return defines |
| 67 | |
| 68 | import opcode |
| 69 | |
| 70 | return { |
| 71 | "_specialized_instructions": [ |
| 72 | op for op in opcode._specialized_opmap.keys() if "__" not in op # type: ignore |
| 73 | ], |
| 74 | "_stats_defines": get_defines( |
| 75 | Path("Include") / "cpython" / "pystats.h", "EVAL_CALL" |
| 76 | ), |
| 77 | "_defines": get_defines(Path("Python") / "specialize.c"), |
| 78 | } |
| 79 | |
| 80 | |
| 81 | def load_raw_data(input: Path) -> RawData: |
no test coverage detected
searching dependent graphs…