mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +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
|
@ -148,6 +148,8 @@ def generate_tier1(
|
|||
out.emit("\n")
|
||||
out.emit(f"TARGET({name}) {{\n")
|
||||
unused_guard = "(void)this_instr;\n" if inst.family is None else ""
|
||||
if inst.properties.needs_prev:
|
||||
out.emit(f"_Py_CODEUNIT *prev_instr = frame->instr_ptr;\n")
|
||||
if needs_this and not inst.is_target:
|
||||
out.emit(f"_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;\n")
|
||||
out.emit(unused_guard)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue