PyThreadState *ts = PyThreadState_GET();
StacklessのPyCFrameObjectへキャスト
PyCFrameObject *cf = (PyCFrameObject*) f;
Stackless拡張の.stからカレントTaskletを取得する
PyTaskletObject *task = ts->st.current; int done = cf->i;
ts->frame = f;
if (retval == NULL || done) goto exit_run_cframe;
if (cf->ob2 == NULL) cf->ob2 = PyTuple_New(0);
参照の切り離し
Py_DECREF(retval);
STACKLESS_PROPOSE_ALL(); retval = PyObject_Call(cf->ob1, cf->ob2, cf->ob3);
STACKLESS_ASSERT(); cf->i = 1; /* mark ourself as done */
if (STACKLESS_UNWINDING(retval)) {
/* try to shortcut */
if (ts->st.current == task && ts->frame != NULL &&
ts->frame->f_back == (PyFrameObject *) cf) {
Py_DECREF(ts->frame->f_back);
ts->frame->f_back = cf->f_back;
Py_DECREF(cf); /* the exec reference */
}
return retval;
}
/* pop frame */
exit_run_cframe:
frameの繋がりを保存
ts->frame = cf->f_back; Py_DECREF(cf); return retval;