@@ -1213,8 +1213,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
12131213
12141214#ifdef STACKLESS
12151215
1216- f -> f_execute = PyEval_EvalFrame_noval ;
1217- return PyEval_EvalFrame_value (f , throwflag , retval );
1216+ f -> f_execute = slp_eval_frame_noval ;
1217+ return slp_eval_frame_value (f , throwflag , retval );
12181218exit_eval_frame :
12191219 Py_LeaveRecursiveCall ();
12201220 f -> f_executing = 0 ;
@@ -1223,30 +1223,38 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
12231223}
12241224
12251225PyObject *
1226- PyEval_EvalFrame_noval (PyFrameObject * f , int throwflag , PyObject * retval )
1226+ slp_eval_frame_noval (PyFrameObject * f , int throwflag , PyObject * retval )
12271227{
1228+ PyObject * r ;
12281229 /*
12291230 * this function is identical to PyEval_EvalFrame_value.
12301231 * it serves as a marker whether we expect a value or
12311232 * not, and it makes debugging a little easier.
12321233 */
1233- return PyEval_EvalFrame_value (f , throwflag , retval );
1234+ Py_XINCREF (f ); /* fool the link optimizer */
1235+ r = slp_eval_frame_value (f , throwflag , retval );
1236+ Py_XDECREF (f );
1237+ return r ;
12341238}
12351239
12361240PyObject *
1237- PyEval_EvalFrame_iter (PyFrameObject * f , int throwflag , PyObject * retval )
1241+ slp_eval_frame_iter (PyFrameObject * f , int throwflag , PyObject * retval )
12381242{
1243+ PyObject * r ;
12391244 /*
12401245 * this function is identical to PyEval_EvalFrame_value.
12411246 * it serves as a marker whether we are inside of a
12421247 * for_iter operation. In this case we need to handle
12431248 * null without error as valid result.
12441249 */
1245- return PyEval_EvalFrame_value (f , throwflag , retval );
1250+ Py_XINCREF (retval ); /* fool the link optimizer */
1251+ r = slp_eval_frame_value (f , throwflag , retval );
1252+ Py_XDECREF (retval );
1253+ return r ;
12461254}
12471255
12481256PyObject *
1249- PyEval_EvalFrame_setup_with (PyFrameObject * f , int throwflag , PyObject * retval )
1257+ slp_eval_frame_setup_with (PyFrameObject * f , int throwflag , PyObject * retval )
12501258{
12511259 PyObject * r ;
12521260 /*
@@ -1257,14 +1265,14 @@ PyEval_EvalFrame_setup_with(PyFrameObject *f, int throwflag, PyObject *retval)
12571265 */
12581266 Py_XINCREF (f ); /* fool the link optimizer */
12591267 Py_XINCREF (retval ); /* fool the link optimizer */
1260- r = PyEval_EvalFrame_value (f , throwflag , retval );
1268+ r = slp_eval_frame_value (f , throwflag , retval );
12611269 Py_XDECREF (retval );
12621270 Py_XDECREF (f );
12631271 return r ;
12641272}
12651273
12661274PyObject *
1267- PyEval_EvalFrame_with_cleanup (PyFrameObject * f , int throwflag , PyObject * retval )
1275+ slp_eval_frame_with_cleanup (PyFrameObject * f , int throwflag , PyObject * retval )
12681276{
12691277 PyObject * r ;
12701278 /*
@@ -1275,14 +1283,14 @@ PyEval_EvalFrame_with_cleanup(PyFrameObject *f, int throwflag, PyObject *retval)
12751283 */
12761284 Py_XINCREF (f ); /* fool the link optimizer */
12771285 Py_XINCREF (f ); /* fool the link optimizer */
1278- r = PyEval_EvalFrame_value (f , throwflag , retval );
1286+ r = slp_eval_frame_value (f , throwflag , retval );
12791287 Py_XDECREF (f );
12801288 Py_XDECREF (f );
12811289 return r ;
12821290}
12831291
12841292PyObject *
1285- PyEval_EvalFrame_value (PyFrameObject * f , int throwflag , PyObject * retval )
1293+ slp_eval_frame_value (PyFrameObject * f , int throwflag , PyObject * retval )
12861294{
12871295 /* unfortunately we repeat all the variables here... */
12881296#ifdef DXPAIRS
@@ -1679,7 +1687,7 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
16791687 the generator and on the return from each yield. In Stackless, we
16801688 reenter frames for other purposes (calls, iteration, ..) and need
16811689 to avoid incorrect reexecution and exc reference leaking. */
1682- if (f -> f_execute == PyEval_EvalFrame_noval ) {
1690+ if (f -> f_execute == slp_eval_frame_noval ) {
16831691#endif
16841692 if (!throwflag && f -> f_exc_type != NULL && f -> f_exc_type != Py_None ) {
16851693 /* We were in an except handler when we left,
@@ -1705,12 +1713,12 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
17051713
17061714
17071715#ifdef STACKLESS
1708- if (f -> f_execute == PyEval_EvalFrame_value ) {
1716+ if (f -> f_execute == slp_eval_frame_value ) {
17091717 /* this is a return */
17101718 PUSH (retval ); /* we are back from a function call */
17111719 }
17121720 else {
1713- if (f -> f_execute == PyEval_EvalFrame_iter ) {
1721+ if (f -> f_execute == slp_eval_frame_iter ) {
17141722 /* finalise the for_iter operation */
17151723 opcode = NEXTOP ();
17161724 oparg = NEXTARG ();
@@ -1743,7 +1751,7 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
17431751 JUMPBY (oparg );
17441752 }
17451753 }
1746- else if (f -> f_execute == PyEval_EvalFrame_setup_with ) {
1754+ else if (f -> f_execute == slp_eval_frame_setup_with ) {
17471755 /* finalise the SETUP_WITH operation */
17481756 opcode = NEXTOP ();
17491757 oparg = NEXTARG ();
@@ -1762,7 +1770,7 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
17621770 PUSH (retval );
17631771 }
17641772 }
1765- else if (f -> f_execute == PyEval_EvalFrame_with_cleanup ) {
1773+ else if (f -> f_execute == slp_eval_frame_with_cleanup ) {
17661774 /* finalise the WITH_CLEANUP operation */
17671775
17681776 if (retval ) {
@@ -1801,10 +1809,10 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
18011809 }
18021810 else {
18031811 /* don't push it, frame ignores value */
1804- assert (f -> f_execute == PyEval_EvalFrame_noval );
1812+ assert (f -> f_execute == slp_eval_frame_noval );
18051813 Py_XDECREF (retval );
18061814 }
1807- f -> f_execute = PyEval_EvalFrame_value ;
1815+ f -> f_execute = slp_eval_frame_value ;
18081816
18091817 }
18101818
@@ -3936,16 +3944,16 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
39363944 return retval ;
39373945
39383946stackless_setup_with :
3939- f -> f_execute = PyEval_EvalFrame_setup_with ;
3947+ f -> f_execute = slp_eval_frame_setup_with ;
39403948 goto stackless_call_with_opcode ;
39413949
39423950stackless_with_cleanup :
3943- f -> f_execute = PyEval_EvalFrame_with_cleanup ;
3951+ f -> f_execute = slp_eval_frame_with_cleanup ;
39443952 goto stackless_call ;
39453953
39463954stackless_iter :
39473955 /* restore this opcode and enable frame to handle it */
3948- f -> f_execute = PyEval_EvalFrame_iter ;
3956+ f -> f_execute = slp_eval_frame_iter ;
39493957stackless_call_with_opcode :
39503958 next_instr -= (oparg >> 16 ) ? 6 : 3 ;
39513959
@@ -3963,36 +3971,36 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
39633971 STACKLESS_UNPACK (retval );
39643972 retval = tstate -> frame -> f_execute (tstate -> frame , 0 , retval );
39653973 if (tstate -> frame != f ) {
3966- assert (f -> f_execute == PyEval_EvalFrame_value || f -> f_execute == PyEval_EvalFrame_noval ||
3967- f -> f_execute == PyEval_EvalFrame_setup_with || f -> f_execute == PyEval_EvalFrame_with_cleanup );
3968- if (f -> f_execute == PyEval_EvalFrame_noval )
3969- f -> f_execute = PyEval_EvalFrame_value ;
3974+ assert (f -> f_execute == slp_eval_frame_value || f -> f_execute == slp_eval_frame_noval ||
3975+ f -> f_execute == slp_eval_frame_setup_with || f -> f_execute == slp_eval_frame_with_cleanup );
3976+ if (f -> f_execute == slp_eval_frame_noval )
3977+ f -> f_execute = slp_eval_frame_value ;
39703978 return retval ;
39713979 }
39723980 if (STACKLESS_UNWINDING (retval ))
39733981 STACKLESS_UNPACK (retval );
39743982
39753983 f -> f_stacktop = NULL ;
3976- if (f -> f_execute == PyEval_EvalFrame_iter ) {
3984+ if (f -> f_execute == slp_eval_frame_iter ) {
39773985 next_instr += (oparg >> 16 ) ? 6 : 3 ;
3978- f -> f_execute = PyEval_EvalFrame_value ;
3986+ f -> f_execute = slp_eval_frame_value ;
39793987 goto stackless_iter_return ;
39803988 }
3981- else if (f -> f_execute == PyEval_EvalFrame_setup_with ) {
3989+ else if (f -> f_execute == slp_eval_frame_setup_with ) {
39823990 next_instr += (oparg >> 16 ) ? 6 : 3 ;
3983- f -> f_execute = PyEval_EvalFrame_value ;
3991+ f -> f_execute = slp_eval_frame_value ;
39843992 goto stackless_setup_with_return ;
39853993 }
3986- else if (f -> f_execute == PyEval_EvalFrame_with_cleanup ) {
3987- f -> f_execute = PyEval_EvalFrame_value ;
3994+ else if (f -> f_execute == slp_eval_frame_with_cleanup ) {
3995+ f -> f_execute = slp_eval_frame_value ;
39883996 goto stackless_with_cleanup_return ;
39893997 }
39903998
39913999 goto stackless_call_return ;
39924000
39934001stackless_interrupt_call :
39944002
3995- f -> f_execute = PyEval_EvalFrame_noval ;
4003+ f -> f_execute = slp_eval_frame_noval ;
39964004 f -> f_stacktop = stack_pointer ;
39974005
39984006 /* the -1 is to adjust for the f_lasti change.
0 commit comments