Cleanup tier2 debug output (#116920)

Various tweaks, including a slight refactor of the special cases for `_PUSH_FRAME`/`_POP_FRAME` to show the actual operand emitted.
This commit is contained in:
Guido van Rossum 2024-03-18 11:08:43 -07:00 committed by GitHub
parent 849e0716d3
commit 76d0868907
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 50 additions and 22 deletions

View file

@ -1017,7 +1017,12 @@ enter_tier_two:
uopcode = next_uop->opcode;
#ifdef Py_DEBUG
if (lltrace >= 3) {
printf("%4d uop: ", (int)(next_uop - (current_executor == NULL ? next_uop : current_executor->trace)));
if (next_uop->opcode == _START_EXECUTOR || next_uop->opcode == _COLD_EXIT) {
printf("%4d uop: ", 0);
}
else {
printf("%4d uop: ", (int)(next_uop - current_executor->trace));
}
_PyUOpPrint(next_uop);
printf(" stack_level=%d\n",
(int)(stack_pointer - _PyFrame_Stackbase(frame)));
@ -1113,7 +1118,7 @@ side_exit:
_PyUOpPrint(&next_uop[-1]);
printf(", exit %u, temp %d, target %d -> %s]\n",
exit_index, exit->temperature, exit->target,
_PyOpcode_OpName[frame->instr_ptr->op.code]);
_PyOpcode_OpName[_PyCode_CODE(_PyFrame_GetCode(frame))[exit->target].op.code]);
}
#endif
Py_INCREF(exit->executor);