[Python-checkins] bpo-38310: Predict BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX. (GH-16467)

Raymond Hettinger webhook-mailer at python.org
Sat Sep 28 20:12:56 EDT 2019


https://github.com/python/cpython/commit/f185a73249189bc3b75b4dc26e9ec2990a587b17
commit: f185a73249189bc3b75b4dc26e9ec2990a587b17
branch: master
author: Brandt Bucher <brandtbucher at gmail.com>
committer: Raymond Hettinger <rhettinger at users.noreply.github.com>
date: 2019-09-28T17:12:49-07:00
summary:

bpo-38310: Predict BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX. (GH-16467)

files:
A Misc/NEWS.d/next/Core and Builtins/2019-09-28-22-54-25.bpo-38310.YDTbEo.rst
M Python/ceval.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-09-28-22-54-25.bpo-38310.YDTbEo.rst b/Misc/NEWS.d/next/Core and Builtins/2019-09-28-22-54-25.bpo-38310.YDTbEo.rst
new file mode 100644
index 000000000000..5c3086b607d0
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2019-09-28-22-54-25.bpo-38310.YDTbEo.rst	
@@ -0,0 +1 @@
+Predict ``BUILD_MAP_UNPACK_WITH_CALL`` -> ``CALL_FUNCTION_EX`` opcode pairs in the main interpreter loop. Patch by Brandt Bucher.
\ No newline at end of file
diff --git a/Python/ceval.c b/Python/ceval.c
index 964ce1333694..a7d2ea80069a 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2943,6 +2943,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
             while (oparg--)
                 Py_DECREF(POP());
             PUSH(sum);
+            PREDICT(CALL_FUNCTION_EX);
             DISPATCH();
         }
 
@@ -3522,6 +3523,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
         }
 
         case TARGET(CALL_FUNCTION_EX): {
+            PREDICTED(CALL_FUNCTION_EX);
             PyObject *func, *callargs, *kwargs = NULL, *result;
             if (oparg & 0x01) {
                 kwargs = POP();



More information about the Python-checkins mailing list