[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

STINNER Victor report at bugs.python.org
Fri Jan 13 10:13:29 EST 2017


STINNER Victor added the comment:

Ok, here is a first patch: tp_fastcall.patch

* Add tp_fastcall to PyTypeObject
* Add fastcall_wrapper() and use it for tp_call in PyType_Ready()
* Modify _PyObject_FastCallDict() and _PyObject_FastCallKeywords() to use tp_fastcall if defined
* Modify a lot of types to define tp_fastcall instead of tp_call (to use FASTCALL calling convention)
* Add a few new helper functions:

  - _PyObject_FastCall_Prepend() -- similar to _PyObject_Call_Prepend()
  - _Py_FastCall_FromArgs() -- ugly name, sorry about that, it should be renamed :-)
  - PyArg_UnpackStack() -- similar to PyArg_UnpackTuple()
  - _PyArg_NoStackKeywords() -- similar to _PyArg_NoKeywords

Hum, I should make sure that these new functions are not public. By the way, I should probably rename PyArg_UnpackStack() to _PyArg_UnpackStack().

----------
keywords: +patch
Added file: http://bugs.python.org/file46281/tp_fastcall.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29259>
_______________________________________


More information about the Python-bugs-list mailing list