Skip to content

Commit

Permalink
pythonGH-111520: Add back the operand local (pythonGH-111813)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Nov 14, 2023
1 parent 36aab34 commit 31ad7e0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
6 changes: 1 addition & 5 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,19 +992,15 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int

OPT_STAT_INC(traces_executed);
_PyUOpInstruction *next_uop = current_executor->trace;
#ifdef Py_DEBUG
uint64_t operand; // Used by several DPRINTF() calls
#endif
uint64_t operand;
#ifdef Py_STATS
uint64_t trace_uop_execution_counter = 0;
#endif

for (;;) {
opcode = next_uop->opcode;
oparg = next_uop->oparg;
#ifdef Py_DEBUG
operand = next_uop->operand;
#endif
DPRINTF(3,
"%4d: uop %s, oparg %d, operand %" PRIu64 ", stack_level %d\n",
(int)(next_uop - current_executor->trace),
Expand Down
44 changes: 22 additions & 22 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Tools/cases_generator/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def write_body(
f"{func}(&this_instr[{active.offset + 1}].cache);"
)
else:
out.emit(f"{typ}{ceffect.name} = ({typ.strip()})next_uop[-1].operand;")
out.emit(f"{typ}{ceffect.name} = ({typ.strip()})operand;")

# Write the body, substituting a goto for ERROR_IF() and other stuff
assert dedent <= 0
Expand Down

0 comments on commit 31ad7e0

Please sign in to comment.