@@ -1215,39 +1215,47 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
1215
1215
1216
1216
#ifdef STACKLESS
1217
1217
1218
- f -> f_execute = PyEval_EvalFrame_noval ;
1219
- return PyEval_EvalFrame_value (f , throwflag , retval );
1218
+ f -> f_execute = slp_eval_frame_noval ;
1219
+ return slp_eval_frame_value (f , throwflag , retval );
1220
1220
exit_eval_frame :
1221
1221
Py_LeaveRecursiveCall ();
1222
1222
tstate -> frame = f -> f_back ;
1223
1223
return NULL ;
1224
1224
}
1225
1225
1226
1226
PyObject *
1227
- PyEval_EvalFrame_noval (PyFrameObject * f , int throwflag , PyObject * retval )
1227
+ slp_eval_frame_noval (PyFrameObject * f , int throwflag , PyObject * retval )
1228
1228
{
1229
+ PyObject * r ;
1229
1230
/*
1230
1231
* this function is identical to PyEval_EvalFrame_value.
1231
1232
* it serves as a marker whether we expect a value or
1232
1233
* not, and it makes debugging a little easier.
1233
1234
*/
1234
- return PyEval_EvalFrame_value (f , throwflag , retval );
1235
+ Py_XINCREF (f ); /* fool the link optimizer */
1236
+ r = slp_eval_frame_value (f , throwflag , retval );
1237
+ Py_XDECREF (f );
1238
+ return r ;
1235
1239
}
1236
1240
1237
1241
PyObject *
1238
- PyEval_EvalFrame_iter (PyFrameObject * f , int throwflag , PyObject * retval )
1242
+ slp_eval_frame_iter (PyFrameObject * f , int throwflag , PyObject * retval )
1239
1243
{
1244
+ PyObject * r ;
1240
1245
/*
1241
1246
* this function is identical to PyEval_EvalFrame_value.
1242
1247
* it serves as a marker whether we are inside of a
1243
1248
* for_iter operation. In this case we need to handle
1244
1249
* null without error as valid result.
1245
1250
*/
1246
- return PyEval_EvalFrame_value (f , throwflag , retval );
1251
+ Py_XINCREF (retval ); /* fool the link optimizer */
1252
+ r = slp_eval_frame_value (f , throwflag , retval );
1253
+ Py_XDECREF (retval );
1254
+ return r ;
1247
1255
}
1248
1256
1249
1257
PyObject *
1250
- PyEval_EvalFrame_setup_with (PyFrameObject * f , int throwflag , PyObject * retval )
1258
+ slp_eval_frame_setup_with (PyFrameObject * f , int throwflag , PyObject * retval )
1251
1259
{
1252
1260
PyObject * r ;
1253
1261
/*
@@ -1258,14 +1266,14 @@ PyEval_EvalFrame_setup_with(PyFrameObject *f, int throwflag, PyObject *retval)
1258
1266
*/
1259
1267
Py_XINCREF (f ); /* fool the link optimizer */
1260
1268
Py_XINCREF (retval ); /* fool the link optimizer */
1261
- r = PyEval_EvalFrame_value (f , throwflag , retval );
1269
+ r = slp_eval_frame_value (f , throwflag , retval );
1262
1270
Py_XDECREF (retval );
1263
1271
Py_XDECREF (f );
1264
1272
return r ;
1265
1273
}
1266
1274
1267
1275
PyObject *
1268
- PyEval_EvalFrame_with_cleanup (PyFrameObject * f , int throwflag , PyObject * retval )
1276
+ slp_eval_frame_with_cleanup (PyFrameObject * f , int throwflag , PyObject * retval )
1269
1277
{
1270
1278
PyObject * r ;
1271
1279
/*
@@ -1276,14 +1284,14 @@ PyEval_EvalFrame_with_cleanup(PyFrameObject *f, int throwflag, PyObject *retval)
1276
1284
*/
1277
1285
Py_XINCREF (f ); /* fool the link optimizer */
1278
1286
Py_XINCREF (f ); /* fool the link optimizer */
1279
- r = PyEval_EvalFrame_value (f , throwflag , retval );
1287
+ r = slp_eval_frame_value (f , throwflag , retval );
1280
1288
Py_XDECREF (f );
1281
1289
Py_XDECREF (f );
1282
1290
return r ;
1283
1291
}
1284
1292
1285
1293
PyObject *
1286
- PyEval_EvalFrame_value (PyFrameObject * f , int throwflag , PyObject * retval )
1294
+ slp_eval_frame_value (PyFrameObject * f , int throwflag , PyObject * retval )
1287
1295
{
1288
1296
/* unfortunately we repeat all the variables here... */
1289
1297
#ifdef DXPAIRS
@@ -1685,7 +1693,7 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1685
1693
the generator and on the return from each yield. In Stackless, we
1686
1694
reenter frames for other purposes (calls, iteration, ..) and need
1687
1695
to avoid incorrect reexecution and exc reference leaking. */
1688
- if (f -> f_execute == PyEval_EvalFrame_noval ) {
1696
+ if (f -> f_execute == slp_eval_frame_noval ) {
1689
1697
#endif
1690
1698
if (f -> f_exc_type != NULL && f -> f_exc_type != Py_None ) {
1691
1699
/* We were in an except handler when we left,
@@ -1716,12 +1724,12 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1716
1724
1717
1725
1718
1726
#ifdef STACKLESS
1719
- if (f -> f_execute == PyEval_EvalFrame_value ) {
1727
+ if (f -> f_execute == slp_eval_frame_value ) {
1720
1728
/* this is a return */
1721
1729
PUSH (retval ); /* we are back from a function call */
1722
1730
}
1723
1731
else {
1724
- if (f -> f_execute == PyEval_EvalFrame_iter ) {
1732
+ if (f -> f_execute == slp_eval_frame_iter ) {
1725
1733
/* finalise the for_iter operation */
1726
1734
opcode = NEXTOP ();
1727
1735
oparg = NEXTARG ();
@@ -1752,7 +1760,7 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1752
1760
JUMPBY (oparg );
1753
1761
}
1754
1762
}
1755
- else if (f -> f_execute == PyEval_EvalFrame_setup_with ) {
1763
+ else if (f -> f_execute == slp_eval_frame_setup_with ) {
1756
1764
/* finalise the SETUP_WITH operation */
1757
1765
opcode = NEXTOP ();
1758
1766
oparg = NEXTARG ();
@@ -1771,7 +1779,7 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1771
1779
PUSH (retval );
1772
1780
}
1773
1781
}
1774
- else if (f -> f_execute == PyEval_EvalFrame_with_cleanup ) {
1782
+ else if (f -> f_execute == slp_eval_frame_with_cleanup ) {
1775
1783
/* finalise the WITH_CLEANUP operation */
1776
1784
1777
1785
if (retval ) {
@@ -1809,10 +1817,10 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1809
1817
}
1810
1818
else {
1811
1819
/* don't push it, frame ignores value */
1812
- assert (f -> f_execute == PyEval_EvalFrame_noval );
1820
+ assert (f -> f_execute == slp_eval_frame_noval );
1813
1821
Py_XDECREF (retval );
1814
1822
}
1815
- f -> f_execute = PyEval_EvalFrame_value ;
1823
+ f -> f_execute = slp_eval_frame_value ;
1816
1824
1817
1825
}
1818
1826
@@ -3748,16 +3756,16 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
3748
3756
return retval ;
3749
3757
3750
3758
stackless_setup_with :
3751
- f -> f_execute = PyEval_EvalFrame_setup_with ;
3759
+ f -> f_execute = slp_eval_frame_setup_with ;
3752
3760
goto stackless_call_with_opcode ;
3753
3761
3754
3762
stackless_with_cleanup :
3755
- f -> f_execute = PyEval_EvalFrame_with_cleanup ;
3763
+ f -> f_execute = slp_eval_frame_with_cleanup ;
3756
3764
goto stackless_call ;
3757
3765
3758
3766
stackless_iter :
3759
3767
/* restore this opcode and enable frame to handle it */
3760
- f -> f_execute = PyEval_EvalFrame_iter ;
3768
+ f -> f_execute = slp_eval_frame_iter ;
3761
3769
stackless_call_with_opcode :
3762
3770
next_instr -= (oparg >> 16 ) ? 6 : 3 ;
3763
3771
@@ -3776,37 +3784,37 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
3776
3784
STACKLESS_UNPACK (retval );
3777
3785
retval = tstate -> frame -> f_execute (tstate -> frame , 0 , retval );
3778
3786
if (tstate -> frame != f ) {
3779
- assert (f -> f_execute == PyEval_EvalFrame_value || f -> f_execute == PyEval_EvalFrame_noval ||
3780
- f -> f_execute == PyEval_EvalFrame_setup_with || f -> f_execute == PyEval_EvalFrame_with_cleanup );
3781
- if (f -> f_execute == PyEval_EvalFrame_noval )
3782
- f -> f_execute = PyEval_EvalFrame_value ;
3787
+ assert (f -> f_execute == slp_eval_frame_value || f -> f_execute == slp_eval_frame_noval ||
3788
+ f -> f_execute == slp_eval_frame_setup_with || f -> f_execute == slp_eval_frame_with_cleanup );
3789
+ if (f -> f_execute == slp_eval_frame_noval )
3790
+ f -> f_execute = slp_eval_frame_value ;
3783
3791
return retval ;
3784
3792
}
3785
3793
if (STACKLESS_UNWINDING (retval ))
3786
3794
STACKLESS_UNPACK (retval );
3787
3795
3788
3796
x = retval ;
3789
3797
f -> f_stacktop = NULL ;
3790
- if (f -> f_execute == PyEval_EvalFrame_iter ) {
3798
+ if (f -> f_execute == slp_eval_frame_iter ) {
3791
3799
next_instr += (oparg >> 16 ) ? 6 : 3 ;
3792
- f -> f_execute = PyEval_EvalFrame_value ;
3800
+ f -> f_execute = slp_eval_frame_value ;
3793
3801
goto stackless_iter_return ;
3794
3802
}
3795
- else if (f -> f_execute == PyEval_EvalFrame_setup_with ) {
3803
+ else if (f -> f_execute == slp_eval_frame_setup_with ) {
3796
3804
next_instr += (oparg >> 16 ) ? 6 : 3 ;
3797
- f -> f_execute = PyEval_EvalFrame_value ;
3805
+ f -> f_execute = slp_eval_frame_value ;
3798
3806
goto stackless_setup_with_return ;
3799
3807
}
3800
- else if (f -> f_execute == PyEval_EvalFrame_with_cleanup ) {
3801
- f -> f_execute = PyEval_EvalFrame_value ;
3808
+ else if (f -> f_execute == slp_eval_frame_with_cleanup ) {
3809
+ f -> f_execute = slp_eval_frame_value ;
3802
3810
goto stackless_with_cleanup_return ;
3803
3811
}
3804
3812
3805
3813
goto stackless_call_return ;
3806
3814
3807
3815
stackless_interrupt_call :
3808
3816
3809
- f -> f_execute = PyEval_EvalFrame_noval ;
3817
+ f -> f_execute = slp_eval_frame_noval ;
3810
3818
f -> f_stacktop = stack_pointer ;
3811
3819
3812
3820
/* the -1 is to adjust for the f_lasti change.
0 commit comments