8000 Fix opcode name printing in debug mode (#113870) · python/cpython@65f8eb7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 65f8eb7

Browse files
authored
Fix opcode name printing in debug mode (#113870)
Fix a few places where the lltrace debug output printed ``(null)`` instead of an opcode name, because it was calling ``_PyUOpName()`` on a Tier-1 opcode.
1 parent ad849b4 commit 65f8eb7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/optimizer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "opcode.h"
33
#include "pycore_interp.h"
44
#include "pycore_bitutils.h" // _Py_popcount32()
5-
#include "pycore_opcode_metadata.h" // _PyOpcode_OpName()
5+
#include "pycore_opcode_metadata.h" // _PyOpcode_OpName[]
66
#include "pycore_opcode_utils.h" // MAX_REAL_OPCODE
77
#include "pycore_optimizer.h" // _Py_uop_analyze_and_optimize()
88
#include "pycore_pystate.h" // _PyInterpreterState_GET()
@@ -563,7 +563,7 @@ translate_bytecode_to_trace(
563563
uint32_t uopcode = BRANCH_TO_GUARD[opcode - POP_JUMP_IF_FALSE][jump_likely];
564564
_Py_CODEUNIT *next_instr = instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[opcode]];
565565
DPRINTF(2, "%s(%d): counter=%x, bitcount=%d, likely=%d, confidence=%d, uopcode=%s\n",
566-
_PyUOpName(opcode), oparg,
566+
_PyOpcode_OpName[opcode], oparg,
567567
counter, bitcount, jump_likely, confidence, _PyUOpName(uopcode));
568568
ADD_TO_TRACE(uopcode, max_length, 0, target);
569569
if (jump_likely) {
@@ -722,7 +722,7 @@ translate_bytecode_to_trace(
722722
}
723723
break;
724724
}
725-
DPRINTF(2, "Unsupported opcode %s\n", _PyUOpName(opcode));
725+
DPRINTF(2, "Unsupported opcode %s\n", _PyOpcode_OpName[opcode]);
726726
OPT_UNSUPPORTED_OPCODE(opcode);
727727
goto done; // Break out of loop
728728
} // End default

0 commit comments

Comments
 (0)
0