diff --git a/Include/cpython/pystats.h b/Include/cpython/pystats.h index e473110eca7415..3a8616fa138807 100644 --- a/Include/cpython/pystats.h +++ b/Include/cpython/pystats.h @@ -162,6 +162,7 @@ typedef struct _optimization_stats { uint64_t jit_code_size; uint64_t jit_trampoline_size; uint64_t jit_data_size; + uint64_t jit_got_size; uint64_t jit_padding_size; uint64_t jit_freed_memory_size; uint64_t trace_total_memory_hist[_Py_UOP_HIST_SIZE]; diff --git a/Python/optimizer.c b/Python/optimizer.c index f09bf778587b12..316044437bf663 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -601,7 +601,8 @@ add_to_trace( static int is_terminator(const _PyUOpInstruction *uop) { - int opcode = _PyUop_Uncached[uop->opcode]; + int opcode = uop->opcode; + assert(opcode <= MAX_UOP_ID); return ( opcode == _EXIT_TRACE || opcode == _DEOPT || @@ -1345,7 +1346,10 @@ sanity_check(_PyExecutorObject *executor) CHECK(inst->format == UOP_FORMAT_JUMP); CHECK(inst->error_target < executor->code_size); } - if (is_terminator(inst)) { + if (base_opcode == _EXIT_TRACE || + base_opcode == _DEOPT || + base_opcode == _JUMP_TO_TOP || + base_opcode == _DYNAMIC_EXIT) { ended = true; i++; break;