Commit 5eb78ca9 authored by Stefan Behnel's avatar Stefan Behnel

Remove Stackless hack for looking up "PyFrameObject.f_localsplus" from...

Remove Stackless hack for looking up "PyFrameObject.f_localsplus" from Stackless 3.8 on. CPython never needed this.

Closes https://github.com/cython/cython/issues/4329
parent 10621a05
......@@ -121,6 +121,11 @@ jobs:
backend: c
env: { STACKLESS: true, PY: 3 }
extra_hash: "-stackless"
- os: ubuntu-18.04
python-version: 3.8
backend: c
env: { STACKLESS: true, PY: 3 }
extra_hash: "-stackless"
# Pypy
- os: ubuntu-18.04
python-version: pypy-2.7
......
......@@ -2442,13 +2442,18 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
#include "frameobject.h"
#define __Pxy_PyFrame_Initialize_Offsets()
#define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
#else
// Initialised by module init code.
static size_t __pyx_pyframe_localsplus_offset = 0;
#include "frameobject.h"
// This is the long runtime version of
// #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
// offsetof(PyFrameObject, f_localsplus) differs between regular C-Python and Stackless Python.
// offsetof(PyFrameObject, f_localsplus) differs between regular C-Python and Stackless Python < 3.8.
// Therefore the offset is computed at run time from PyFrame_type.tp_basicsize. That is feasible,
// because f_localsplus is the last field of PyFrameObject (checked by Py_BUILD_ASSERT_EXPR below).
#define __Pxy_PyFrame_Initialize_Offsets() \
......@@ -2456,8 +2461,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
#define __Pyx_PyFrame_GetLocalsplus(frame) \
(assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif // !CYTHON_VECTORCALL
#endif
#endif /* !CYTHON_VECTORCALL */
#endif /* CYTHON_FAST_PYCALL */
/////////////// PyFunctionFastCall ///////////////
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment