Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ca246c

Browse files
committed
Inline PyEval_EvalFrameEx() in callers
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.
1 parent 14e6d09 commit 0ca246c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Objects/genobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc, int closing)
186186
f->f_back = tstate->frame;
187187

188188
gen->gi_running = 1;
189-
result = PyEval_EvalFrameEx(f, exc);
189+
result = tstate->interp->eval_frame(f, exc);
190190
gen->gi_running = 0;
191191

192192
/* Don't keep the reference to f_back any longer than necessary. It

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4069,7 +4069,7 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
40694069
return gen;
40704070
}
40714071

4072-
retval = PyEval_EvalFrameEx(f,0);
4072+
retval = tstate->interp->eval_frame(f, 0);
40734073

40744074
fail: /* Jump here from prelude on failure */
40754075

@@ -4822,7 +4822,7 @@ _PyFunction_FastCall(PyCodeObject *co, PyObject **args, Py_ssize_t nargs,
48224822
Py_INCREF(*args);
48234823
fastlocals[i] = *args++;
48244824
}
4825-
result = PyEval_EvalFrameEx(f,0);
4825+
result = tstate->interp->eval_frame(f,0);
48264826

48274827
++tstate->recursion_depth;
48284828
Py_DECREF(f);

0 commit comments

Comments
 (0)