GH-139109: Support switch/case dispatch with the tracing interpreter. (GH-141703)

This commit is contained in:
Mark Shannon 2025-11-18 13:31:48 +00:00 committed by GitHub
parent b87613f214
commit b420f6be53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 617 additions and 585 deletions

View file

@ -5636,10 +5636,12 @@ dummy_func(
DISPATCH();
}
label(record_previous_inst) {
inst(TRACE_RECORD, (--)) {
#if _Py_TIER2
assert(IS_JIT_TRACING());
int opcode = next_instr->op.code;
next_instr = this_instr;
frame->instr_ptr = prev_instr;
opcode = next_instr->op.code;
bool stop_tracing = (opcode == WITH_EXCEPT_START ||
opcode == RERAISE || opcode == CLEANUP_THROW ||
opcode == PUSH_EXC_INFO || opcode == INTERPRETER_EXIT);
@ -5675,7 +5677,8 @@ dummy_func(
}
DISPATCH_GOTO_NON_TRACING();
#else
Py_FatalError("JIT label executed in non-jit build.");
(void)prev_instr;
Py_FatalError("JIT instruction executed in non-jit build.");
#endif
}