gh-106603: Make uop struct a triple (opcode, oparg, operand) (#106794)

This commit is contained in:
Guido van Rossum 2023-07-17 12:12:33 -07:00 committed by GitHub
parent 7e96370a94
commit 8e9a1a0322
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 191 additions and 110 deletions

View file

@ -2747,17 +2747,18 @@ _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject
_Py_CODEUNIT *ip_offset = (_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive;
int pc = 0;
int opcode;
uint64_t operand;
int oparg;
uint64_t operand;
for (;;) {
opcode = self->trace[pc].opcode;
oparg = self->trace[pc].oparg;
operand = self->trace[pc].operand;
oparg = (int)operand;
DPRINTF(3,
"%4d: uop %s, operand %" PRIu64 ", stack_level %d\n",
"%4d: uop %s, oparg %d, operand %" PRIu64 ", stack_level %d\n",
pc,
opcode < 256 ? _PyOpcode_OpName[opcode] : _PyOpcode_uop_name[opcode],
oparg,
operand,
(int)(stack_pointer - _PyFrame_Stackbase(frame)));
pc++;