diff --git a/Python/optimizer.c b/Python/optimizer.c index e95e4b5e24b2c5..0c0898746d2200 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -654,7 +654,8 @@ compute_frame_penalty(uint16_t fitness_initial) 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 || @@ -1469,7 +1470,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; diff --git a/Python/pystats.c b/Python/pystats.c index 2fac2db1b738c7..b231ae285efdb1 100644 --- a/Python/pystats.c +++ b/Python/pystats.c @@ -327,6 +327,7 @@ print_optimization_stats(FILE *out, OptimizationStats *stats) fprintf(out, "JIT code size: %" PRIu64 "\n", stats->jit_code_size); fprintf(out, "JIT trampoline size: %" PRIu64 "\n", stats->jit_trampoline_size); fprintf(out, "JIT data size: %" PRIu64 "\n", stats->jit_data_size); + fprintf(out, "JIT GOT size: %" PRIu64 "\n", stats->jit_got_size); fprintf(out, "JIT padding size: %" PRIu64 "\n", stats->jit_padding_size); fprintf(out, "JIT freed memory size: %" PRIu64 "\n", stats->jit_freed_memory_size); @@ -480,6 +481,7 @@ merge_optimization_stats(OptimizationStats *dest, const OptimizationStats *src) dest->jit_code_size += src->jit_code_size; dest->jit_trampoline_size += src->jit_trampoline_size; dest->jit_data_size += src->jit_data_size; + dest->jit_got_size += src->jit_got_size; dest->jit_padding_size += src->jit_padding_size; dest->jit_freed_memory_size += src->jit_freed_memory_size;