mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
GH-121131: Clean up and fix some instrumented instructions. (GH-121132)
* Add support for 'prev_instr' to code generator and refactor some INSTRUMENTED instructions
This commit is contained in:
parent
d9efa45d74
commit
afb0aa6ed2
15 changed files with 277 additions and 215 deletions
|
@ -151,7 +151,6 @@ def generate_deopt_table(analysis: Analysis, out: CWriter) -> None:
|
|||
if inst.family is not None:
|
||||
deopt = inst.family.name
|
||||
deopts.append((inst.name, deopt))
|
||||
deopts.append(("INSTRUMENTED_LINE", "INSTRUMENTED_LINE"))
|
||||
for name, deopt in sorted(deopts):
|
||||
out.emit(f"[{name}] = {deopt},\n")
|
||||
out.emit("};\n\n")
|
||||
|
@ -179,7 +178,6 @@ def generate_name_table(analysis: Analysis, out: CWriter) -> None:
|
|||
out.emit("#ifdef NEED_OPCODE_METADATA\n")
|
||||
out.emit(f"const char *_PyOpcode_OpName[{table_size}] = {{\n")
|
||||
names = list(analysis.instructions) + list(analysis.pseudos)
|
||||
names.append("INSTRUMENTED_LINE")
|
||||
for name in sorted(names):
|
||||
out.emit(f'[{name}] = "{name}",\n')
|
||||
out.emit("};\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue