@@ -1213,8 +1213,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
1213
1213
1214
1214
#ifdef STACKLESS
1215
1215
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 );
1218
1218
exit_eval_frame :
1219
1219
Py_LeaveRecursiveCall ();
1220
1220
f -> f_executing = 0 ;
@@ -1223,30 +1223,38 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
1223
1223
}
1224
1224
1225
1225
PyObject *
1226
- PyEval_EvalFrame_noval (PyFrameObject * f , int throwflag , PyObject * retval )
1226
+ slp_eval_frame_noval (PyFrameObject * f , int throwflag , PyObject * retval )
1227
1227
{
1228
+ PyObject * r ;
1228
1229
/*
1229
1230
* this function is identical to PyEval_EvalFrame_value.
1230
1231
* it serves as a marker whether we expect a value or
1231
1232
* not, and it makes debugging a little easier.
1232
1233
*/
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 ;
1234
1238
}
1235
1239
1236
1240
PyObject *
1237
- PyEval_EvalFrame_iter (PyFrameObject * f , int throwflag , PyObject * retval )
1241
+ slp_eval_frame_iter (PyFrameObject * f , int throwflag , PyObject * retval )
1238
1242
{
1243
+ PyObject * r ;
1239
1244
/*
1240
1245
* this function is identical to PyEval_EvalFrame_value.
1241
1246
* it serves as a marker whether we are inside of a
1242
1247
* for_iter operation. In this case we need to handle
1243
1248
* null without error as valid result.
1244
1249
*/
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 ;
1246
1254
}
1247
1255
1248
1256
PyObject *
1249
- PyEval_EvalFrame_setup_with (PyFrameObject * f , int throwflag , PyObject * retval )
1257
+ slp_eval_frame_setup_with (PyFrameObject * f , int throwflag , PyObject * retval )
1250
1258
{
1251
1259
PyObject * r ;
1252
1260
/*
@@ -1257,14 +1265,14 @@ PyEval_EvalFrame_setup_with(PyFrameObject *f, int throwflag, PyObject *retval)
1257
1265
*/
1258
1266
Py_XINCREF (f ); /* fool the link optimizer */
1259
1267
Py_XINCREF (retval ); /* fool the link optimizer */
1260
- r = PyEval_EvalFrame_value (f , throwflag , retval );
1268
+ r = slp_eval_frame_value (f , throwflag , retval );
1261
1269
Py_XDECREF (retval );
1262
1270
Py_XDECREF (f );
1263
1271
return r ;
1264
1272
}
1265
1273
1266
1274
PyObject *
1267
- PyEval_EvalFrame_with_cleanup (PyFrameObject * f , int throwflag , PyObject * retval )
1275
+ slp_eval_frame_with_cleanup (PyFrameObject * f , int throwflag , PyObject * retval )
1268
1276
{
1269
1277
PyObject * r ;
1270
1278
/*
@@ -1275,14 +1283,14 @@ PyEval_EvalFrame_with_cleanup(PyFrameObject *f, int throwflag, PyObject *retval)
1275
1283
*/
1276
1284
Py_XINCREF (f ); /* fool the link optimizer */
1277
1285
Py_XINCREF (f ); /* fool the link optimizer */
1278
- r = PyEval_EvalFrame_value (f , throwflag , retval );
1286
+ r = slp_eval_frame_value (f , throwflag , retval );
1279
1287
Py_XDECREF (f );
1280
1288
Py_XDECREF (f );
1281
1289
return r ;
1282
1290
}
1283
1291
1284
1292
PyObject *
1285
- PyEval_EvalFrame_value (PyFrameObject * f , int throwflag , PyObject * retval )
1293
+ slp_eval_frame_value (PyFrameObject * f , int throwflag , PyObject * retval )
1286
1294
{
1287
1295
/* unfortunately we repeat all the variables here... */
1288
1296
#ifdef DXPAIRS
@@ -1679,7 +1687,7 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1679
1687
the generator and on the return from each yield. In Stackless, we
1680
1688
reenter frames for other purposes (calls, iteration, ..) and need
1681
1689
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 ) {
1683
1691
#endif
1684
1692
if (!throwflag && f -> f_exc_type != NULL && f -> f_exc_type != Py_None ) {
1685
1693
/* We were in an except handler when we left,
@@ -1705,12 +1713,12 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1705
1713
1706
1714
1707
1715
#ifdef STACKLESS
1708
- if (f -> f_execute == PyEval_EvalFrame_value ) {
1716
+ if (f -> f_execute == slp_eval_frame_value ) {
1709
1717
/* this is a return */
1710
1718
PUSH (retval ); /* we are back from a function call */
1711
1719
}
1712
1720
else {
1713
- if (f -> f_execute == PyEval_EvalFrame_iter ) {
1721
+ if (f -> f_execute == slp_eval_frame_iter ) {
1714
1722
/* finalise the for_iter operation */
1715
1723
opcode = NEXTOP ();
1716
1724
oparg = NEXTARG ();
@@ -1743,7 +1751,7 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1743
1751
JUMPBY (oparg );
1744
1752
}
1745
1753
}
1746
- else if (f -> f_execute == PyEval_EvalFrame_setup_with ) {
1754
+ else if (f -> f_execute == slp_eval_frame_setup_with ) {
1747
1755
/* finalise the SETUP_WITH operation */
1748
1756
opcode = NEXTOP ();
1749
1757
oparg = NEXTARG ();
@@ -1762,7 +1770,7 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1762
1770
PUSH (retval );
1763
1771
}
1764
1772
}
1765
- else if (f -> f_execute == PyEval_EvalFrame_with_cleanup ) {
1773
+ else if (f -> f_execute == slp_eval_frame_with_cleanup ) {
1766
1774
/* finalise the WITH_CLEANUP operation */
1767
1775
1768
1776
if (retval ) {
@@ -1801,10 +1809,10 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
1801
1809
}
1802
1810
else {
1803
1811
/* don't push it, frame ignores value */
1804
- assert (f -> f_execute == PyEval_EvalFrame_noval );
1812
+ assert (f -> f_execute == slp_eval_frame_noval );
1805
1813
Py_XDECREF (retval );
1806
1814
}
1807
- f -> f_execute = PyEval_EvalFrame_value ;
1815
+ f -> f_execute = slp_eval_frame_value ;
1808
1816
1809
1817
}
1810
1818
@@ -3912,16 +3920,16 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
3912
3920
return retval ;
3913
3921
3914
3922
stackless_setup_with :
3915
- f -> f_execute = PyEval_EvalFrame_setup_with ;
3923
+ f -> f_execute = slp_eval_frame_setup_with ;
3916
3924
goto stackless_call_with_opcode ;
3917
3925
3918
3926
stackless_with_cleanup :
3919
- f -> f_execute = PyEval_EvalFrame_with_cleanup ;
3927
+ f -> f_execute = slp_eval_frame_with_cleanup ;
3920
3928
goto stackless_call ;
3921
3929
3922
3930
stackless_iter :
3923
3931
/* restore this opcode and enable frame to handle it */
3924
- f -> f_execute = PyEval_EvalFrame_iter ;
3932
+ f -> f_execute = slp_eval_frame_iter ;
3925
3933
stackless_call_with_opcode :
3926
3934
next_instr -= (oparg >> 16 ) ? 6 : 3 ;
3927
3935
@@ -3939,36 +3947,36 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
3939
3947
STACKLESS_UNPACK (retval );
3940
3948
retval = tstate -> frame -> f_execute (tstate -> frame , 0 , retval );
3941
3949
if (tstate -> frame != f ) {
3942
- assert (f -> f_execute == PyEval_EvalFrame_value || f -> f_execute == PyEval_EvalFrame_noval ||
3943
- f -> f_execute == PyEval_EvalFrame_setup_with || f -> f_execute == PyEval_EvalFrame_with_cleanup );
3944
- if (f -> f_execute == PyEval_EvalFrame_noval )
3945
- f -> f_execute = PyEval_EvalFrame_value ;
3950
+ assert (f -> f_execute == slp_eval_frame_value || f -> f_execute == slp_eval_frame_noval ||
3951
+ f -> f_execute == slp_eval_frame_setup_with || f -> f_execute == slp_eval_frame_with_cleanup );
3952
+ if (f -> f_execute == slp_eval_frame_noval )
3953
+ f -> f_execute = slp_eval_frame_value ;
3946
3954
return retval ;
3947
3955
}
3948
3956
if (STACKLESS_UNWINDING (retval ))
3949
3957
STACKLESS_UNPACK (retval );
3950
3958
3951
3959
f -> f_stacktop = NULL ;
3952
- if (f -> f_execute == PyEval_EvalFrame_iter ) {
3960
+ if (f -> f_execute == slp_eval_frame_iter ) {
3953
3961
next_instr += (oparg >> 16 ) ? 6 : 3 ;
3954
- f -> f_execute = PyEval_EvalFrame_value ;
3962
+ f -> f_execute = slp_eval_frame_value ;
3955
3963
goto stackless_iter_return ;
3956
3964
}
3957
- else if (f -> f_execute == PyEval_EvalFrame_setup_with ) {
3965
+ else if (f -> f_execute == slp_eval_frame_setup_with ) {
3958
3966
next_instr += (oparg >> 16 ) ? 6 : 3 ;
3959
- f -> f_execute = PyEval_EvalFrame_value ;
3967
+ f -> f_execute = slp_eval_frame_value ;
3960
3968
goto stackless_setup_with_return ;
3961
3969
}
3962
- else if (f -> f_execute == PyEval_EvalFrame_with_cleanup ) {
3963
- f -> f_execute = PyEval_EvalFrame_value ;
3970
+ else if (f -> f_execute == slp_eval_frame_with_cleanup ) {
3971
+ f -> f_execute = slp_eval_frame_value ;
3964
3972
goto stackless_with_cleanup_return ;
3965
3973
}
3966
3974
3967
3975
goto stackless_call_return ;
3968
3976
3969
3977
stackless_interrupt_call :
3970
3978
3971
- f -> f_execute = PyEval_EvalFrame_noval ;
3979
+ f -> f_execute = slp_eval_frame_noval ;
3972
3980
f -> f_stacktop = stack_pointer ;
3973
3981
3974
3982
/* the -1 is to adjust for the f_lasti change.
0 commit comments