Revert "Backport METH_FASTCALL from Python 3.7 (#328)"

This reverts commit cf73bbd678.
This commit is contained in:
Justine Tunney 2022-05-12 06:49:54 -07:00
parent e7611a8476
commit 2ea1dc405c
102 changed files with 3299 additions and 2894 deletions

View file

@ -44,8 +44,6 @@ PyObject *_PyObject_Call_Prepend(PyObject *func, PyObject *obj, PyObject *args,
#define _PY_FASTCALL_SMALL_STACK 5
int _PyObject_HasFastCall(PyObject *callable);
PyObject *_PyObject_FastCall_Prepend(
PyObject *callable,
PyObject *obj,

View file

@ -91,8 +91,6 @@ PyObject * PyDescr_NewMember(PyTypeObject *,
PyObject * PyDescr_NewGetSet(PyTypeObject *,
struct PyGetSetDef *);
#ifndef Py_LIMITED_API
PyObject * _PyMethodDescr_FastCallKeywords(
PyObject *descrobj, PyObject *const *stack, Py_ssize_t nargs, PyObject *kwnames);
PyObject * PyDescr_NewWrapper(PyTypeObject *,
struct wrapperbase *, void *);
#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)

View file

@ -15,16 +15,6 @@ PyObject * PyEval_EvalCodeEx(PyObject *co,
PyObject *kwdefs, PyObject *closure);
#ifndef Py_LIMITED_API
PyObject * _PyEval_EvalCodeWithName(
PyObject *co,
PyObject *globals, PyObject *locals,
PyObject **args, Py_ssize_t argcount,
PyObject **kwnames, PyObject **kwargs,
Py_ssize_t kwcount, int kwstep,
PyObject **defs, Py_ssize_t defcount,
PyObject *kwdefs, PyObject *closure,
PyObject *name, PyObject *qualname);
PyObject * _PyEval_CallTracing(PyObject *func, PyObject *args);
#endif

View file

@ -61,9 +61,6 @@ extern PyTypeObject PyFrame_Type;
PyFrameObject * PyFrame_New(PyThreadState *, PyCodeObject *,
PyObject *, PyObject *);
/* only internal use */
PyFrameObject* _PyFrame_New_NoTrack(PyThreadState *, PyCodeObject *,
PyObject *, PyObject *);
/* The rest of the interface is specific for frame objects */

View file

@ -14,12 +14,10 @@ extern PyTypeObject PyCFunction_Type;
#define PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type)
typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
typedef PyObject *(*_PyCFunctionFast) (PyObject *, PyObject **, Py_ssize_t);
typedef PyObject *(*_PyCFunctionFast) (PyObject *self, PyObject **args,
Py_ssize_t nargs, PyObject *kwnames);
typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
PyObject *);
typedef PyObject *(*_PyCFunctionFastWithKeywords) (PyObject *,
PyObject **, Py_ssize_t,
PyObject *);
typedef PyObject *(*PyNoArgsFunction)(PyObject *);
PyCFunction PyCFunction_GetFunction(PyObject *);
@ -95,20 +93,12 @@ typedef struct {
PyObject *m_module; /* The __module__ attribute, can be anything */
PyObject *m_weakreflist; /* List of weak references */
} PyCFunctionObject;
PyObject * _PyMethodDef_RawFastCallDict(
PyMethodDef *method,
PyObject *self,
PyObject **args,
Py_ssize_t nargs,
PyObject *kwargs);
PyObject * _PyMethodDef_RawFastCallKeywords(
PyMethodDef *method,
PyObject *self,
PyObject **args,
Py_ssize_t nargs,
PyObject *kwnames);
#endif
int PyCFunction_ClearFreeList(void);

View file

@ -125,8 +125,6 @@ COSMOPOLITAN_C_START_
#define BUILD_CONST_KEY_MAP 156
#define BUILD_STRING 157
#define BUILD_TUPLE_UNPACK_WITH_CALL 158
#define LOAD_METHOD 160
#define CALL_METHOD 161
/* EXCEPT_HANDLER is a special, implicit block type which is created when
entering an except handler. It is not an opcode but we define it here

View file

@ -235,28 +235,6 @@ typedef int Py_ssize_clean_t;
#define Py_DEPRECATED(VERSION_UNUSED)
#endif
/* _Py_HOT_FUNCTION
* The hot attribute on a function is used to inform the compiler that the
* function is a hot spot of the compiled program. The function is optimized
* more aggressively and on many target it is placed into special subsection of
* the text section so all hot functions appears close together improving
* locality.
*
* Usage:
* int _Py_HOT_FUNCTION x(void) { return 3; }
*
* Issue #28618: This attribute must not be abused, otherwise it can have a
* negative effect on performance. Only the functions were Python spend most of
* its time must use it. Use a profiler when running performance benchmark
* suite to find these functions.
*/
#if !IsModeDbg() && defined(__GNUC__) \
&& ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
#define _Py_HOT_FUNCTION __attribute__((hot))
#else
#define _Py_HOT_FUNCTION
#endif
#define RTYPE RTYPE
#ifdef __cplusplus
#define PyMODINIT_FUNC extern "C" PyObject *