summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index 2256d79..871979d 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -17,6 +17,7 @@
#include <stdlib.h> // rand()
+extern const char *_PyUOpName(int index);
/* For guidance on adding or extending families of instructions see
* ./adaptive.md
@@ -246,17 +247,12 @@ print_optimization_stats(FILE *out, OptimizationStats *stats)
stats->optimizer_failure_reason_no_memory);
const char* const* names;
- for (int i = 0; i < 512; i++) {
- if (i < 256) {
- names = _PyOpcode_OpName;
- } else {
- names = _PyOpcode_uop_name;
- }
+ for (int i = 0; i <= MAX_UOP_ID; i++) {
if (stats->opcode[i].execution_count) {
- fprintf(out, "uops[%s].execution_count : %" PRIu64 "\n", names[i], stats->opcode[i].execution_count);
+ fprintf(out, "uops[%s].execution_count : %" PRIu64 "\n", _PyUOpName(i), stats->opcode[i].execution_count);
}
if (stats->opcode[i].miss) {
- fprintf(out, "uops[%s].specialization.miss : %" PRIu64 "\n", names[i], stats->opcode[i].miss);
+ fprintf(out, "uops[%s].specialization.miss : %" PRIu64 "\n", _PyUOpName(i), stats->opcode[i].miss);
}
}