8000 Eliminate 'operand' local variable · python/cpython@a96ac7f · GitHub
[go: up one dir, main page]

Skip to content

Commit a96ac7f

Browse files
committed
Eliminate 'operand' local variable
1 parent a1d0108 commit a96ac7f

File tree

3 files changed

+29
-25
lines changed

3 files changed

+29
-25
lines changed

Python/ceval.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,15 +983,19 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
983983

984984
OPT_STAT_INC(traces_executed);
985985
_PyUOpInstruction *next_uop = self->trace;
986-
uint64_t operand;
986+
#ifdef Py_DEBUG
987+
uint64_t operand; // Used by several DPRINTF() calls
988+
#endif
987989
#ifdef Py_STATS
988990
uint64_t trace_uop_execution_counter = 0;
989991
#endif
990992

991993
for (;;) {
992994
opcode = next_uop->opcode;
993995
oparg = next_uop->oparg;
996+
#ifdef Py_DEBUG
994997
operand = next_uop->operand;
998+
#endif
995999
DPRINTF(3,
9961000
"%4d: uop %s, oparg %d, operand %" PRIu64 ", stack_level %d\n",
9971001
(int)(next_uop - self->trace),

Python/executor_cases.c.h

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/cases_generator/instructions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def write_body(
162162
f"{func}(&this_instr[{active.offset + 1}].cache);"
163163
)
164164
else:
165-
out.emit(f"{typ}{ceffect.name} = ({typ.strip()})operand;")
165+
out.emit(f"{typ}{ceffect.name} = ({typ.strip()})next_uop[-1].operand;")
166166

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

0 commit comments

Comments
 (0)
0