4343#undef GOTO_TIER_TWO
4444#define GOTO_TIER_TWO (EXECUTOR ) \
4545do { \
46+ OPT_STAT_INC(traces_executed); \
4647 __attribute__((musttail)) \
4748 return ((jit_func)((EXECUTOR)->jit_code))(frame, stack_pointer, tstate); \
4849} while (0)
@@ -88,6 +89,10 @@ _JIT_ENTRY(_PyInterpreterFrame *frame, PyObject **stack_pointer, PyThreadState *
8889 PATCH_VALUE (uint64_t , _operand , _JIT_OPERAND )
8990 PATCH_VALUE (uint32_t , _target , _JIT_TARGET )
9091 PATCH_VALUE (uint16_t , _exit_index , _JIT_EXIT_INDEX )
92+
93+ OPT_STAT_INC (uops_executed );
94+ UOP_STAT_INC (opcode , execution_count );
95+
9196 // The actual instruction definitions (only one will be used):
9297 if (opcode == _JUMP_TO_TOP ) {
9398 CHECK_EVAL_BREAKER ();
@@ -106,9 +111,11 @@ _JIT_ENTRY(_PyInterpreterFrame *frame, PyObject **stack_pointer, PyThreadState *
106111 GOTO_TIER_ONE (NULL );
107112exit_to_tier1 :
108113 tstate -> previous_executor = (PyObject * )current_executor ;
114+ UOP_STAT_INC (opcode , miss );
109115 GOTO_TIER_ONE (_PyCode_CODE (_PyFrame_GetCode (frame )) + _target );
110116exit_to_trace :
111117 {
118+ UOP_STAT_INC (opcode , miss );
112119 _PyExitData * exit = & current_executor -> exits [_exit_index ];
113120 Py_INCREF (exit -> executor );
114121 tstate -> previous_executor = (PyObject * )current_executor ;
0 commit comments