summaryrefslogtreecommitdiffstats
path: root/Objects/call.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-10-25 12:26:17 (GMT)
committerGitHub <noreply@github.com>2017-10-25 12:26:17 (GMT)
commit086c3ae5f0995a62092b9080f32dd118c2923453 (patch)
treef8af12704c97121754f389acbbaaab86845c8ef9 /Objects/call.c
parent95f1a7bb09db03ae239c8cbf43e8890ab12fd782 (diff)
downloadcpython-086c3ae5f0995a62092b9080f32dd118c2923453.zip
cpython-086c3ae5f0995a62092b9080f32dd118c2923453.tar.gz
cpython-086c3ae5f0995a62092b9080f32dd118c2923453.tar.bz2
bpo-31835: Optimize also FASTCALL using __future__ (#4087)
_PyFunction_FastCallDict() and _PyFunction_FastCallKeywords() now also takes the fast path if the code object uses __future__ (CO_FUTURE_xxx flags).
Diffstat (limited to 'Objects/call.c')
-rw-r--r--Objects/call.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/call.c b/Objects/call.c
index 91e6078..7b46dbc 100644
--- a/Objects/call.c
+++ b/Objects/call.c
@@ -315,7 +315,7 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
if (co->co_kwonlyargcount == 0 &&
(kwargs == NULL || PyDict_GET_SIZE(kwargs) == 0) &&
- co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))
+ (co->co_flags & ~PyCF_MASK) == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))
{
/* Fast paths */
if (argdefs == NULL && co->co_argcount == nargs) {
@@ -402,7 +402,7 @@ _PyFunction_FastCallKeywords(PyObject *func, PyObject **stack,
be unique */
if (co->co_kwonlyargcount == 0 && nkwargs == 0 &&
- co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))
+ (co->co_flags & ~PyCF_MASK) == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))
{
if (argdefs == NULL && co->co_argcount == nargs) {
return function_code_fastcall(co, stack, nargs, globals);