Skip to content

Commit 1a3f129

Browse files
fix a tracing bug, ifdef out code
1 parent cdcce30 commit 1a3f129

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

Python/bytecodes.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5219,6 +5219,7 @@ dummy_func(
52195219
}
52205220

52215221
tier1 no_save_ip inst(RECORD_PREVIOUS_INST, (--)) {
5222+
#if _Py_TIER2
52225223
assert(IS_JIT_TRACING());
52235224
int opcode = next_instr->op.code;
52245225
int full = !_PyJit_translate_single_bytecode_to_trace(tstate, frame, next_instr);
@@ -5236,6 +5237,9 @@ dummy_func(
52365237
tstate->interp->jit_state.prev_instr_oparg = oparg;
52375238
tstate->interp->jit_state.prev_instr_stacklevel = STACK_LEVEL();
52385239
DISPATCH_GOTO_NON_TRACING();
5240+
#else
5241+
Py_FatalError("JIT instruction executed in non-jit build.");
5242+
#endif
52395243
}
52405244
///////// Tier-2 only opcodes /////////
52415245

Python/ceval_macros.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ _PyFrame_SetStackPointer(frame, stack_pointer)
413413

414414
#define TIER1_TO_TIER2(EXECUTOR) \
415415
do { \
416-
LEAVE_TRACING(); \
417416
OPT_STAT_INC(traces_executed); \
418417
next_instr = _Py_jit_entry((EXECUTOR), frame, stack_pointer, tstate); \
419418
frame = tstate->current_frame; \

Python/generated_cases.c.h

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,14 +884,17 @@ _PyJit_translate_single_bytecode_to_trace(
884884
ADD_TO_TRACE(_JUMP_TO_TOP, 0, 0, 0);
885885
goto done;
886886
}
887+
DPRINTF(2, "Trace continuing\n");
887888
tstate->interp->jit_state.code_curr_size = trace_length;
888889
tstate->interp->jit_state.code_max_size = max_length;
889890
return 1;
890891
done:
892+
DPRINTF(2, "Trace done\n");
891893
tstate->interp->jit_state.code_curr_size = trace_length;
892894
tstate->interp->jit_state.code_max_size = max_length;
893895
return 0;
894896
full:
897+
DPRINTF(2, "Trace full\n");
895898
if (!is_terminator(&tstate->interp->jit_state.code_buffer[trace_length-1])) {
896899
// Undo the last few instructions.
897900
trace_length = tstate->interp->jit_state.code_curr_size;

0 commit comments

Comments
 (0)