@@ -5193,40 +5193,6 @@ dummy_func(
51935193 Py_FatalError ("Executing RESERVED instruction." );
51945194 }
51955195
5196- tier1 no_save_ip inst (RECORD_PREVIOUS_INST , (-- )) {
5197- #if _Py_TIER2
5198- assert (IS_JIT_TRACING ());
5199- int opcode = next_instr -> op .code ;
5200- int full = !_PyJit_translate_single_bytecode_to_trace (tstate , frame , next_instr );
5201- if (full ) {
5202- LEAVE_TRACING ();
5203- int err = bail_tracing_and_jit (tstate , frame );
5204- ERROR_IF (err < 0 );
5205- DISPATCH_GOTO_NON_TRACING ();
5206- }
5207- // Super instructions. Instruction deopted. There's a mismatch in what the stack expects
5208- // in the optimizer. So we have to reflect in the trace correctly.
5209- if ((tstate -> interp -> jit_state .prev_instr -> op .code == CALL_LIST_APPEND &&
5210- opcode == POP_TOP ) ||
5211- (tstate -> interp -> jit_state .prev_instr -> op .code == BINARY_OP_INPLACE_ADD_UNICODE &&
5212- opcode == STORE_FAST )) {
5213- tstate -> interp -> jit_state .prev_instr_is_super = true;
5214- }
5215- else {
5216- tstate -> interp -> jit_state .prev_instr = next_instr ;
5217- }
5218- tstate -> interp -> jit_state .specialize_counter = 0 ;
5219- PyCodeObject * prev_code = (PyCodeObject * )Py_NewRef (_PyFrame_GetCode (frame ));
5220- Py_SETREF (tstate -> interp -> jit_state .prev_instr_code , prev_code );
5221-
5222- tstate -> interp -> jit_state .prev_instr_frame = frame ;
5223- tstate -> interp -> jit_state .prev_instr_oparg = oparg ;
5224- tstate -> interp -> jit_state .prev_instr_stacklevel = STACK_LEVEL ();
5225- DISPATCH_GOTO_NON_TRACING ();
5226- #else
5227- Py_FatalError ("JIT instruction executed in non-jit build." );
5228- #endif
5229- }
52305196 ///////// Tier-2 only opcodes /////////
52315197
52325198 op (_GUARD_IS_TRUE_POP , (flag -- )) {
@@ -5646,6 +5612,40 @@ dummy_func(
56465612 DISPATCH ();
56475613 }
56485614
5615+ label (record_previous_inst ) {
5616+ #if _Py_TIER2
5617+ assert (IS_JIT_TRACING ());
5618+ int opcode = next_instr -> op .code ;
5619+ int full = !_PyJit_translate_single_bytecode_to_trace (tstate , frame , next_instr );
5620+ if (full ) {
5621+ LEAVE_TRACING ();
5622+ int err = bail_tracing_and_jit (tstate , frame );
5623+ ERROR_IF (err < 0 );
5624+ DISPATCH_GOTO_NON_TRACING ();
5625+ }
5626+ // Super instructions. Instruction deopted. There's a mismatch in what the stack expects
5627+ // in the optimizer. So we have to reflect in the trace correctly.
5628+ if ((tstate -> interp -> jit_state .prev_instr -> op .code == CALL_LIST_APPEND &&
5629+ opcode == POP_TOP ) ||
5630+ (tstate -> interp -> jit_state .prev_instr -> op .code == BINARY_OP_INPLACE_ADD_UNICODE &&
5631+ opcode == STORE_FAST )) {
5632+ tstate -> interp -> jit_state .prev_instr_is_super = true;
5633+ }
5634+ else {
5635+ tstate -> interp -> jit_state .prev_instr = next_instr ;
5636+ }
5637+ tstate -> interp -> jit_state .specialize_counter = 0 ;
5638+ PyCodeObject * prev_code = (PyCodeObject * )Py_NewRef (_PyFrame_GetCode (frame ));
5639+ Py_SETREF (tstate -> interp -> jit_state .prev_instr_code , prev_code );
5640+
5641+ tstate -> interp -> jit_state .prev_instr_frame = frame ;
5642+ tstate -> interp -> jit_state .prev_instr_oparg = oparg ;
5643+ tstate -> interp -> jit_state .prev_instr_stacklevel = STACK_LEVEL ();
5644+ DISPATCH_GOTO_NON_TRACING ();
5645+ #else
5646+ Py_FatalError ("JIT label executed in non-jit build." );
5647+ #endif
5648+ }
56495649
56505650
56515651// END BYTECODES //
0 commit comments