]> granicus.if.org Git - python/commitdiff
Inline PyEval_EvalFrameEx() in callers
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Dec 2016 16:12:17 +0000 (17:12 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Dec 2016 16:12:17 +0000 (17:12 +0100)
The PEP 523 modified PyEval_EvalFrameEx(): it's now an indirection to
interp->eval_frame().

Inline the call in performance critical code. Leave PyEval_EvalFrame()
unchanged, this function is only kept for backward compatibility.

Objects/genobject.c
Python/ceval.c

index 59f53cefcb35093d5695f27a3a39e558a1befc56..9d93a761d7abe91b16419ebe3536d4d4fbf421e7 100644 (file)
@@ -186,7 +186,7 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc, int closing)
     f->f_back = tstate->frame;
 
     gen->gi_running = 1;
-    result = PyEval_EvalFrameEx(f, exc);
+    result = tstate->interp->eval_frame(f, exc);
     gen->gi_running = 0;
 
     /* Don't keep the reference to f_back any longer than necessary.  It
index c6c6e05650b076c1d94b16ad6653d2ec2bf20251..c4507fb74ddae6a6bbaf42f5c9ad8cfd4bb82ef5 100644 (file)
@@ -4069,7 +4069,7 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
         return gen;
     }
 
-    retval = PyEval_EvalFrameEx(f,0);
+    retval = tstate->interp->eval_frame(f, 0);
 
 fail: /* Jump here from prelude on failure */
 
@@ -4822,7 +4822,7 @@ _PyFunction_FastCall(PyCodeObject *co, PyObject **args, Py_ssize_t nargs,
         Py_INCREF(*args);
         fastlocals[i] = *args++;
     }
-    result = PyEval_EvalFrameEx(f,0);
+    result = tstate->interp->eval_frame(f,0);
 
     ++tstate->recursion_depth;
     Py_DECREF(f);