summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-05-02 15:17:59 (GMT)
committerGitHub <noreply@github.com>2024-05-02 15:17:59 (GMT)
commit72867c962cc59c6d56805f86530696bea6beb039 (patch)
tree239f9333f2e1f355387f41ce2443a786de04afc9 /Python/specialize.c
parent9789440de387219bb7677fe0d66860aa8c9deb02 (diff)
downloadcpython-72867c962cc59c6d56805f86530696bea6beb039.zip
cpython-72867c962cc59c6d56805f86530696bea6beb039.tar.gz
cpython-72867c962cc59c6d56805f86530696bea6beb039.tar.bz2
GH-118095: Unify the behavior of tier 2 FOR_ITER branch micro-ops (GH-118420)
* Target _FOR_ITER_TIER_TWO at POP_TOP following the matching END_FOR * Modify _GUARD_NOT_EXHAUSTED_RANGE, _GUARD_NOT_EXHAUSTED_LIST and _GUARD_NOT_EXHAUSTED_TUPLE so that they also target the POP_TOP following the matching END_FOR
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index ee51781..72114f2 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -215,6 +215,7 @@ print_gc_stats(FILE *out, GCStats *stats)
}
}
+#ifdef _Py_TIER2
static void
print_histogram(FILE *out, const char *name, uint64_t hist[_Py_UOP_HIST_SIZE])
{
@@ -249,7 +250,6 @@ print_optimization_stats(FILE *out, OptimizationStats *stats)
stats->optimizer_failure_reason_no_memory);
fprintf(out, "Optimizer remove globals builtins changed: %" PRIu64 "\n", stats->remove_globals_builtins_changed);
fprintf(out, "Optimizer remove globals incorrect keys: %" PRIu64 "\n", stats->remove_globals_incorrect_keys);
-
for (int i = 0; i <= MAX_UOP_ID; i++) {
if (stats->opcode[i].execution_count) {
fprintf(out, "uops[%s].execution_count : %" PRIu64 "\n", _PyUOpName(i), stats->opcode[i].execution_count);
@@ -258,7 +258,6 @@ print_optimization_stats(FILE *out, OptimizationStats *stats)
fprintf(out, "uops[%s].specialization.miss : %" PRIu64 "\n", _PyUOpName(i), stats->opcode[i].miss);
}
}
-
for (int i = 0; i < 256; i++) {
if (stats->unsupported_opcode[i]) {
fprintf(
@@ -289,6 +288,7 @@ print_optimization_stats(FILE *out, OptimizationStats *stats)
}
}
}
+#endif
static void
print_rare_event_stats(FILE *out, RareEventStats *stats)
@@ -309,7 +309,9 @@ print_stats(FILE *out, PyStats *stats)
print_call_stats(out, &stats->call_stats);
print_object_stats(out, &stats->object_stats);
print_gc_stats(out, stats->gc_stats);
+#ifdef _Py_TIER2
print_optimization_stats(out, &stats->optimization_stats);
+#endif
print_rare_event_stats(out, &stats->rare_event_stats);
}