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.
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 59f53ce..9d93a76 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -186,7 +186,7 @@
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
diff --git a/Python/ceval.c b/Python/ceval.c
index c6c6e05..c4507fb 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4069,7 +4069,7 @@
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 @@
Py_INCREF(*args);
fastlocals[i] = *args++;
}
- result = PyEval_EvalFrameEx(f,0);
+ result = tstate->interp->eval_frame(f,0);
++tstate->recursion_depth;
Py_DECREF(f);