]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46329: Fix test failure when `Py_STATS` is enabled (GH-31511)
authorBrandt Bucher <brandtbucher@microsoft.com>
Wed, 23 Feb 2022 11:00:28 +0000 (03:00 -0800)
committerGitHub <noreply@github.com>
Wed, 23 Feb 2022 11:00:28 +0000 (11:00 +0000)
Misc/NEWS.d/next/Core and Builtins/2022-02-22-14-03-56.bpo-46329.RX_AzJ.rst [new file with mode: 0644]
Python/specialize.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-02-22-14-03-56.bpo-46329.RX_AzJ.rst b/Misc/NEWS.d/next/Core and Builtins/2022-02-22-14-03-56.bpo-46329.RX_AzJ.rst
new file mode 100644 (file)
index 0000000..8d1d502
--- /dev/null
@@ -0,0 +1 @@
+Fix specialization stats gathering for :opcode:`PRECALL` instructions.
index b46f7014289232dbb97b8d3cc3840aed85b07cae..91010a5be3c06c4191836b7990a5e6d581d0a9bd 100644 (file)
@@ -160,6 +160,7 @@ _Py_GetSpecializationStats(void) {
     err += add_stat_dict(stats, BINARY_OP, "binary_op");
     err += add_stat_dict(stats, COMPARE_OP, "compare_op");
     err += add_stat_dict(stats, UNPACK_SEQUENCE, "unpack_sequence");
+    err += add_stat_dict(stats, PRECALL, "precall");
     if (err < 0) {
         Py_DECREF(stats);
         return NULL;
@@ -180,8 +181,6 @@ print_spec_stats(FILE *out, OpcodeStats *stats)
     /* Mark some opcodes as specializable for stats,
      * even though we don't specialize them yet. */
     fprintf(out, "opcode[%d].specializable : 1\n", FOR_ITER);
-    fprintf(out, "opcode[%d].specializable : 1\n", PRECALL);
-    fprintf(out, "opcode[%d].specializable : 1\n", UNPACK_SEQUENCE);
     for (int i = 0; i < 256; i++) {
         if (adaptive_opcodes[i]) {
             fprintf(out, "opcode[%d].specializable : 1\n", i);