@@ -131,7 +131,7 @@ _PyOptimizer_Optimize(
131131 chain_depth %= MAX_CHAIN_DEPTH ;
132132 bool progress_needed = chain_depth == 0 ;
133133 PyCodeObject * code = (PyCodeObject * )tstate -> interp -> jit_state .jit_tracer_initial_code ;
134- _Py_CODEUNIT * start = tstate -> interp -> jit_state .jit_tracer_initial_instr ;
134+ _Py_CODEUNIT * start = tstate -> interp -> jit_state .jit_tracer_insert_exec_instr ;
135135 // A recursive trace might've cleared the values. In that case, bail.
136136 if (code == NULL ) {
137137 interp -> compiling = false;
@@ -570,7 +570,7 @@ _PyJIT_translate_single_bytecode_to_trace(
570570 int jump_taken )
571571{
572572
573- int is_first_instr = tstate -> interp -> jit_state .jit_tracer_initial_instr == this_instr ;
573+ int is_first_instr = tstate -> interp -> jit_state .jit_tracer_close_loop_instr == this_instr ;
574574 bool progress_needed = (tstate -> interp -> jit_state .jit_tracer_initial_chain_depth % MAX_CHAIN_DEPTH ) == 0 ;;
575575 _PyBloomFilter * dependencies = & tstate -> interp -> jit_state .jit_tracer_dependencies ;
576576 _Py_BloomFilter_Add (dependencies , old_code );
@@ -686,7 +686,7 @@ _PyJIT_translate_single_bytecode_to_trace(
686686 }
687687
688688 // Loop back to the start
689- if (is_first_instr && tstate -> interp -> jit_state .jit_tracer_code_curr_size > 2 ) {
689+ if (is_first_instr && tstate -> interp -> jit_state .jit_tracer_code_curr_size > 5 ) {
690690 ADD_TO_TRACE (_JUMP_TO_TOP , 0 , 0 , 0 );
691691 goto done ;
692692 }
@@ -876,7 +876,7 @@ _PyJIT_translate_single_bytecode_to_trace(
876876}
877877
878878void
879- _PyJIT_InitializeTracing (PyThreadState * tstate , _PyInterpreterFrame * frame , _Py_CODEUNIT * next_instr , int curr_stackdepth , int chain_depth , _PyExitData * exit )
879+ _PyJIT_InitializeTracing (PyThreadState * tstate , _PyInterpreterFrame * frame , _Py_CODEUNIT * insert_exec_instr , _Py_CODEUNIT * close_loop_instr , int curr_stackdepth , int chain_depth , _PyExitData * exit )
880880{
881881 PyCodeObject * code = _PyFrame_GetCode (frame );
882882#ifdef Py_DEBUG
@@ -890,14 +890,15 @@ _PyJIT_InitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_
890890 PyUnicode_AsUTF8 (code -> co_qualname ),
891891 PyUnicode_AsUTF8 (code -> co_filename ),
892892 code -> co_firstlineno ,
893- 2 * INSTR_IP (next_instr , code ),
893+ 2 * INSTR_IP (close_loop_instr , code ),
894894 chain_depth );
895895#endif
896- add_to_trace (tstate -> interp -> jit_state .jit_tracer_code_buffer , 0 , _START_EXECUTOR , 0 , (uintptr_t )next_instr , INSTR_IP (next_instr , code ));
896+ add_to_trace (tstate -> interp -> jit_state .jit_tracer_code_buffer , 0 , _START_EXECUTOR , 0 , (uintptr_t )insert_exec_instr , INSTR_IP (insert_exec_instr , code ));
897897 add_to_trace (tstate -> interp -> jit_state .jit_tracer_code_buffer , 1 , _MAKE_WARM , 0 , 0 , 0 );
898898 tstate -> interp -> jit_state .jit_tracer_code_curr_size = 2 ;
899899 tstate -> interp -> jit_state .jit_tracer_code_max_size = UOP_MAX_TRACE_LENGTH ;
900- tstate -> interp -> jit_state .jit_tracer_initial_instr = next_instr ;
900+ tstate -> interp -> jit_state .jit_tracer_insert_exec_instr = insert_exec_instr ;
901+ tstate -> interp -> jit_state .jit_tracer_close_loop_instr = close_loop_instr ;
901902 tstate -> interp -> jit_state .jit_tracer_initial_code = (PyCodeObject * )Py_NewRef (code );
902903 tstate -> interp -> jit_state .jit_tracer_initial_func = (PyFunctionObject * )Py_NewRef (_PyFrame_GetFunction (frame ));
903904 tstate -> interp -> jit_state .jit_tracer_previous_exit = exit ;
0 commit comments