@@ -823,25 +823,16 @@ _PyJit_translate_single_bytecode_to_trace(
823823 _tstate -> jit_tracer_state .initial_state .exit == NULL &&
824824 // These are coroutines, and we want to unroll those usually.
825825 opcode != JUMP_BACKWARD_NO_INTERRUPT ) {
826- // We encountered a second JUMP_BACKWARD but not to the top of our own loop.
826+ // We encountered a JUMP_BACKWARD but not to the top of our own loop.
827827 // We don't want to continue tracing as we might get stuck in the
828828 // inner loop. Instead, end the trace where the executor of the
829829 // inner loop might start and let the traces rejoin.
830- if (_tstate -> jit_tracer_state .translator_state .jump_backward_seen >= 1 ||
831- // Also end the trace early if we probably have no more space left, as it's better
832- // to link to another backwards jump trace.
833- trace_length >= (_tstate -> jit_tracer_state .prev_state .code_max_size / 3 )) {
834- OPT_STAT_INC (inner_loop );
835- ADD_TO_TRACE (_EXIT_TRACE , 0 , 0 , target );
836- trace [trace_length - 1 ].operand1 = true; // is_control_flow
837- DPRINTF (2 , "JUMP_BACKWARD not to top ends trace %p %p %p\n" , next_instr ,
838- _tstate -> jit_tracer_state .initial_state .close_loop_instr , _tstate -> jit_tracer_state .initial_state .start_instr );
839- goto done ;
840- }
841- else {
842- assert (_tstate -> jit_tracer_state .translator_state .jump_backward_seen == 0 );
843- _tstate -> jit_tracer_state .translator_state .jump_backward_seen ++ ;
844- }
830+ OPT_STAT_INC (inner_loop );
831+ ADD_TO_TRACE (_EXIT_TRACE , 0 , 0 , target );
832+ trace [trace_length - 1 ].operand1 = true; // is_control_flow
833+ DPRINTF (2 , "JUMP_BACKWARD not to top ends trace %p %p %p\n" , next_instr ,
834+ _tstate -> jit_tracer_state .initial_state .close_loop_instr , _tstate -> jit_tracer_state .initial_state .start_instr );
835+ goto done ;
845836 }
846837 break ;
847838 }
@@ -1073,7 +1064,6 @@ _PyJit_TryInitializeTracing(
10731064 _tstate -> jit_tracer_state .initial_state .exit = exit ;
10741065 _tstate -> jit_tracer_state .initial_state .stack_depth = curr_stackdepth ;
10751066 _tstate -> jit_tracer_state .initial_state .chain_depth = chain_depth ;
1076- _tstate -> jit_tracer_state .translator_state .jump_backward_seen = 0 ;
10771067 _tstate -> jit_tracer_state .prev_state .instr_frame = frame ;
10781068 _tstate -> jit_tracer_state .prev_state .dependencies_still_valid = true;
10791069 _tstate -> jit_tracer_state .prev_state .instr_code = (PyCodeObject * )Py_NewRef (_PyFrame_GetCode (frame ));
0 commit comments