Skip to content

Commit 1312e98

Browse files
author
Anselm Kruis
committed
merge 3.3-slp (Stackless python#109)
2 parents cf58fd3 + 87fd8f9 commit 1312e98

File tree

7 files changed

+156
-159
lines changed

7 files changed

+156
-159
lines changed

Python/ceval.c

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -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);
12181218
exit_eval_frame:
12191219
Py_LeaveRecursiveCall();
12201220
f->f_executing = 0;
@@ -1223,30 +1223,38 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
12231223
}
12241224

12251225
PyObject *
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

12361240
PyObject *
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

12481256
PyObject *
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

12661274
PyObject *
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

12841292
PyObject *
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

@@ -3912,16 +3920,16 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
39123920
return retval;
39133921

39143922
stackless_setup_with:
3915-
f->f_execute = PyEval_EvalFrame_setup_with;
3923+
f->f_execute = slp_eval_frame_setup_with;
39163924
goto stackless_call_with_opcode;
39173925

39183926
stackless_with_cleanup:
3919-
f->f_execute = PyEval_EvalFrame_with_cleanup;
3927+
f->f_execute = slp_eval_frame_with_cleanup;
39203928
goto stackless_call;
39213929

39223930
stackless_iter:
39233931
/* restore this opcode and enable frame to handle it */
3924-
f->f_execute = PyEval_EvalFrame_iter;
3932+
f->f_execute = slp_eval_frame_iter;
39253933
stackless_call_with_opcode:
39263934
next_instr -= (oparg >> 16) ? 6 : 3;
39273935

@@ -3939,36 +3947,36 @@ PyEval_EvalFrame_value(PyFrameObject *f, int throwflag, PyObject *retval)
39393947
STACKLESS_UNPACK(retval);
39403948
retval = tstate->frame->f_execute(tstate->frame, 0, retval);
39413949
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;
39463954
return retval;
39473955
}
39483956
if (STACKLESS_UNWINDING(retval))
39493957
STACKLESS_UNPACK(retval);
39503958

39513959
f->f_stacktop = NULL;
3952-
if (f->f_execute == PyEval_EvalFrame_iter) {
3960+
if (f->f_execute == slp_eval_frame_iter) {
39533961
next_instr += (oparg >> 16) ? 6 : 3;
3954-
f->f_execute = PyEval_EvalFrame_value;
3962+
f->f_execute = slp_eval_frame_value;
39553963
goto stackless_iter_return;
39563964
}
3957-
else if (f->f_execute == PyEval_EvalFrame_setup_with) {
3965+
else if (f->f_execute == slp_eval_frame_setup_with) {
39583966
next_instr += (oparg >> 16) ? 6 : 3;
3959-
f->f_execute = PyEval_EvalFrame_value;
3967+
f->f_execute = slp_eval_frame_value;
39603968
goto stackless_setup_with_return;
39613969
}
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;
39643972
goto stackless_with_cleanup_return;
39653973
}
39663974

39673975
goto stackless_call_return;
39683976

39693977
stackless_interrupt_call:
39703978

3971-
f->f_execute = PyEval_EvalFrame_noval;
3979+
f->f_execute = slp_eval_frame_noval;
39723980
f->f_stacktop = stack_pointer;
39733981

39743982
/* the -1 is to adjust for the f_lasti change.

Stackless/changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ What's New in Stackless 3.X.X?
99

1010
*Release date: 20XX-XX-XX*
1111

12+
- https://bitbucket.org/stackless-dev/stackless/issues/109
13+
The Stackless python*.dll no longer exports private symbols. Symbols
14+
required by Stackless-aware 3rd party extension modules should still be
15+
available.
16+
1217
- https://bitbucket.org/stackless-dev/stackless/issues/108
1318
Use PyVarObject_HEAD_INIT to initialise type objects. See PEP 3123.
1419

0 commit comments

Comments
 (0)