diff options
author | Mark Shannon <mark@hotpy.org> | 2024-08-23 09:46:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-23 09:46:03 (GMT) |
commit | 0b0f7befaddb2b5eff2811398a0f0d4604a82a90 (patch) | |
tree | 485a626615817be27498e03f56f7c631838f40de /Python/specialize.c | |
parent | 5fce482c9a9d18d36c8177bdd0028cd2fef9f09f (diff) | |
download | cpython-0b0f7befaddb2b5eff2811398a0f0d4604a82a90.zip cpython-0b0f7befaddb2b5eff2811398a0f0d4604a82a90.tar.gz cpython-0b0f7befaddb2b5eff2811398a0f0d4604a82a90.tar.bz2 |
GH-123232: Fix "not specialized" stats (GH-123236)
Diffstat (limited to 'Python/specialize.c')
-rw-r--r-- | Python/specialize.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Python/specialize.c b/Python/specialize.c index 14f0c07..da61895 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -144,8 +144,18 @@ print_spec_stats(FILE *out, OpcodeStats *stats) fprintf(out, "opcode[BINARY_SLICE].specializable : 1\n"); fprintf(out, "opcode[STORE_SLICE].specializable : 1\n"); for (int i = 0; i < 256; i++) { - if (_PyOpcode_Caches[i] && i != JUMP_BACKWARD) { - fprintf(out, "opcode[%s].specializable : 1\n", _PyOpcode_OpName[i]); + if (_PyOpcode_Caches[i]) { + /* Ignore jumps as they cannot be specialized */ + switch (i) { + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: + case POP_JUMP_IF_NONE: + case POP_JUMP_IF_NOT_NONE: + case JUMP_BACKWARD: + break; + default: + fprintf(out, "opcode[%s].specializable : 1\n", _PyOpcode_OpName[i]); + } } PRINT_STAT(i, specialization.success); PRINT_STAT(i, specialization.failure); |