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

This commit is contained in:
Brandt Bucher 2019-09-28 17:12:49 -07:00 committed by Raymond Hettinger
parent c5a7e0ce19
commit f185a73249
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1 @@
Predict ``BUILD_MAP_UNPACK_WITH_CALL`` -> ``CALL_FUNCTION_EX`` opcode pairs in the main interpreter loop. Patch by Brandt Bucher.

View File

@ -2943,6 +2943,7 @@ main_loop:
while (oparg--) while (oparg--)
Py_DECREF(POP()); Py_DECREF(POP());
PUSH(sum); PUSH(sum);
PREDICT(CALL_FUNCTION_EX);
DISPATCH(); DISPATCH();
} }
@ -3522,6 +3523,7 @@ main_loop:
} }
case TARGET(CALL_FUNCTION_EX): { case TARGET(CALL_FUNCTION_EX): {
PREDICTED(CALL_FUNCTION_EX);
PyObject *func, *callargs, *kwargs = NULL, *result; PyObject *func, *callargs, *kwargs = NULL, *result;
if (oparg & 0x01) { if (oparg & 0x01) {
kwargs = POP(); kwargs = POP();