Author vstinner
Recipients inada.naoki, python-dev, serhiy.storchaka, vstinner
Date 2017-01-26.01:53:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1485395626.42.0.577836037408.issue29259@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-01-26 01:53:47vstinnersetrecipients: + vstinner, inada.naoki, python-dev, serhiy.storchaka
2017-01-26 01:53:46vstinnersetmessageid: <1485395626.42.0.577836037408.issue29259@psf.upfronthosting.co.za>
2017-01-26 01:53:46vstinnerlinkissue29259 messages
2017-01-26 01:53:45vstinnercreate