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: ...@@ -121,6 +121,11 @@ jobs:
backend: c backend: c
env: { STACKLESS: true, PY: 3 } env: { STACKLESS: true, PY: 3 }
extra_hash: "-stackless" extra_hash: "-stackless"
- os: ubuntu-18.04
python-version: 3.8
backend: c
env: { STACKLESS: true, PY: 3 }
extra_hash: "-stackless"
# Pypy # Pypy
- os: ubuntu-18.04 - os: ubuntu-18.04
python-version: pypy-2.7 python-version: pypy-2.7
......
...@@ -2442,13 +2442,18 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, ...@@ -2442,13 +2442,18 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
#endif #endif
#if !CYTHON_VECTORCALL #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. // Initialised by module init code.
static size_t __pyx_pyframe_localsplus_offset = 0; static size_t __pyx_pyframe_localsplus_offset = 0;
#include "frameobject.h" #include "frameobject.h"
// This is the long runtime version of // This is the long runtime version of
// #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) // #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, // 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). // because f_localsplus is the last field of PyFrameObject (checked by Py_BUILD_ASSERT_EXPR below).
#define __Pxy_PyFrame_Initialize_Offsets() \ #define __Pxy_PyFrame_Initialize_Offsets() \
...@@ -2456,8 +2461,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, ...@@ -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))) (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
#define __Pyx_PyFrame_GetLocalsplus(frame) \ #define __Pyx_PyFrame_GetLocalsplus(frame) \
(assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif // !CYTHON_VECTORCALL
#endif #endif
#endif /* !CYTHON_VECTORCALL */
#endif /* CYTHON_FAST_PYCALL */
/////////////// PyFunctionFastCall /////////////// /////////////// 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