STINNER Victor added the comment:

Patch version 6: type inheritance and all wrappers should now be handled 
correctly. Changes:

* Add fastwrapper to wrapperbase structure
* Add d_use_fastwrapper to PyWrapperDescrObject structure
* wrapper_call() uses fast call
* Protect access to tp_fastcall with Py_TPFLAGS_HAVE_FASTCALL in all cases
* _Py_RawFastCallDict() doesn't check the result anymore, it's now checked in 
the caller: self can be NULL for static methods (try test_bytes unit test!)
* Fix type inheritance: update_one_slot() now makes sure that tp_call and 
tp_fastcall are synchronize. Before, the update was done after but not in all 
cases.
* Fix fastcall_wrapper() to support "StaticType.tp_call(obj, ...);" calls: 
Py_TYPE(obj)->tp_fastcall can be NULL, we have to search non-NULL tp_fastcall 
in base classes in this case.

IMHO the most tricky parts of the change are in update_one_slot() and 
add_operators().

Many fixes were "backported" from my work on the issue #29358 (tp_fastnew and 
tp_fastinit). Technically, I cherry-picked commits and fixes all the merge 
conflicts.

It may be worth to use FASTCALL in more wrappers (wrap_xxx functions in 
typeobject.c) of slotdefs.

----------
Added file: http://bugs.python.org/file46418/tp_fastcall-6.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29259>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to