Skip to content

bpo-36974: remove _PyObject_HasFastCall #13460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Include/cpython/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ PyAPI_FUNC(int) _PyStack_UnpackDict(
40 bytes on the stack. */
#define _PY_FASTCALL_SMALL_STACK 5

/* Return 1 if callable supports FASTCALL calling convention for positional
arguments: see _PyObject_Vectorcall() and _PyObject_FastCallDict() */
PyAPI_FUNC(int) _PyObject_HasFastCall(PyObject *callable);

PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *callable,
PyObject *result,
const char *where);
Expand Down
4 changes: 2 additions & 2 deletions Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
return NULL;
}

pto->use_fastcall = _PyObject_HasFastCall(func);
pto->use_fastcall = (_PyVectorcall_Function(func) != NULL);

return (PyObject *)pto;
}
Expand Down Expand Up @@ -365,7 +365,7 @@ partial_setstate(partialobject *pto, PyObject *state)
Py_INCREF(dict);

Py_INCREF(fn);
pto->use_fastcall = _PyObject_HasFastCall(fn);
pto->use_fastcall = (_PyVectorcall_Function(fn) != NULL);
Py_SETREF(pto->fn, fn);
Py_SETREF(pto->args, fnargs);
Py_SETREF(pto->kw, kw);
Expand Down
16 changes: 0 additions & 16 deletions Objects/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,6 @@ static PyObject *
cfunction_call_varargs(PyObject *func, PyObject *args, PyObject *kwargs);


int
_PyObject_HasFastCall(PyObject *callable)
{
if (PyFunction_Check(callable)) {
return 1;
}
else if (PyCFunction_Check(callable)) {
return !(PyCFunction_GET_FLAGS(callable) & METH_VARARGS);
}
else {
assert (PyCallable_Check(callable));
return 0;
}
}


static PyObject *
null_error(void)
{
Expand Down