@@ -6190,9 +6190,9 @@ dummy_func(
61906190 }
61916191
61926192 tier2 op (_DYNAMIC_EXIT , (exit_p /4 -- )) {
6193+ _Py_CODEUNIT * target = frame -> instr_ptr ;
61936194 #if defined(Py_DEBUG ) && !defined(_Py_JIT )
61946195 _PyExitData * exit = (_PyExitData * )exit_p ;
6195- _Py_CODEUNIT * target = frame -> instr_ptr ;
61966196 OPT_HIST (trace_uop_execution_counter , trace_run_length_hist );
61976197 if (frame -> lltrace >= 3 ) {
61986198 printf ("DYNAMIC EXIT: [UOp " );
@@ -6203,9 +6203,13 @@ dummy_func(
62036203 _PyOpcode_OpName [target -> op .code ]);
62046204 }
62056205 #endif
6206- // Disabled for now (gh-139109) as it slows down dynamic code tremendously.
6207- // Compile and jump to the cold dynamic executors in the future.
6208- GOTO_TIER_ONE (frame -> instr_ptr );
6206+ // gh-149564: Propagate call-site hotness to callees.
6207+ // If we're landing on a callee's RESUME, boost its counter so it
6208+ // gets traced sooner (it was called from a hot trace).
6209+ if (target -> op .code == RESUME_CHECK_JIT ) {
6210+ target [1 ].counter = trigger_backoff_counter ();
6211+ }
6212+ GOTO_TIER_ONE (target );
62096213 }
62106214
62116215 tier2 op (_CHECK_VALIDITY , (-- )) {
@@ -6330,6 +6334,10 @@ dummy_func(
63306334 SYNC_SP ();
63316335 // TODO (gh-139109): This should be similar to _COLD_EXIT in the future.
63326336 _Py_CODEUNIT * target = frame -> instr_ptr ;
6337+ // gh-149564: Propagate call-site hotness to callees.
6338+ if (target -> op .code == RESUME_CHECK_JIT ) {
6339+ target [1 ].counter = trigger_backoff_counter ();
6340+ }
63336341 GOTO_TIER_ONE (target );
63346342 Py_UNREACHABLE ();
63356343 }
0 commit comments