GH-122294: Burn in the addresses of side exits (GH-122295)

This commit is contained in:
Brandt Bucher 2024-07-26 09:40:15 -07:00 committed by GitHub
parent db2d8b6db1
commit 64857d849f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 24 additions and 19 deletions

View file

@ -5044,8 +5044,8 @@
}
case _EXIT_TRACE: {
oparg = CURRENT_OPARG();
_PyExitData *exit = &current_executor->exits[oparg];
PyObject *exit_p = (PyObject *)CURRENT_OPERAND();
_PyExitData *exit = (_PyExitData *)exit_p;
PyCodeObject *code = _PyFrame_GetCode(frame);
_Py_CODEUNIT *target = _PyCode_CODE(code) + exit->target;
#if defined(Py_DEBUG) && !defined(_Py_JIT)
@ -5054,7 +5054,7 @@
printf("SIDE EXIT: [UOp ");
_PyUOpPrint(&next_uop[-1]);
printf(", exit %u, temp %d, target %d -> %s]\n",
oparg, exit->temperature.as_counter,
exit - current_executor->exits, exit->temperature.as_counter,
(int)(target - _PyCode_CODE(code)),
_PyOpcode_OpName[target->op.code]);
}
@ -5182,9 +5182,9 @@
}
case _DYNAMIC_EXIT: {
oparg = CURRENT_OPARG();
PyObject *exit_p = (PyObject *)CURRENT_OPERAND();
tstate->previous_executor = (PyObject *)current_executor;
_PyExitData *exit = (_PyExitData *)&current_executor->exits[oparg];
_PyExitData *exit = (_PyExitData *)exit_p;
_Py_CODEUNIT *target = frame->instr_ptr;
#if defined(Py_DEBUG) && !defined(_Py_JIT)
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
@ -5192,7 +5192,7 @@
printf("DYNAMIC EXIT: [UOp ");
_PyUOpPrint(&next_uop[-1]);
printf(", exit %u, temp %d, target %d -> %s]\n",
oparg, exit->temperature.as_counter,
exit - current_executor->exits, exit->temperature.as_counter,
(int)(target - _PyCode_CODE(_PyFrame_GetCode(frame))),
_PyOpcode_OpName[target->op.code]);
}