Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(214)

Delta Between Two Patch Sets: Objects/classobject.c

Issue 29259: Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects
Left Patch Set: Created 3 years ago
Right Patch Set: Created 2 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 /* Class object implementation (dead now except for methods) */ 1 /* Class object implementation (dead now except for methods) */
2 2
3 #include "Python.h" 3 #include "Python.h"
4 #include "structmember.h" 4 #include "structmember.h"
5 5
6 #define TP_DESCR_GET(t) ((t)->tp_descr_get) 6 #define TP_DESCR_GET(t) ((t)->tp_descr_get)
7 7
8 /* Free list for method objects to safe malloc/free overhead 8 /* Free list for method objects to safe malloc/free overhead
9 * The im_self element is used to chain the elements. 9 * The im_self element is used to chain the elements.
10 */ 10 */
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 (reprfunc)method_repr, /* tp_repr */ 344 (reprfunc)method_repr, /* tp_repr */
345 0, /* tp_as_number */ 345 0, /* tp_as_number */
346 0, /* tp_as_sequence */ 346 0, /* tp_as_sequence */
347 0, /* tp_as_mapping */ 347 0, /* tp_as_mapping */
348 (hashfunc)method_hash, /* tp_hash */ 348 (hashfunc)method_hash, /* tp_hash */
349 0, /* tp_call */ 349 0, /* tp_call */
350 0, /* tp_str */ 350 0, /* tp_str */
351 method_getattro, /* tp_getattro */ 351 method_getattro, /* tp_getattro */
352 PyObject_GenericSetAttr, /* tp_setattro */ 352 PyObject_GenericSetAttr, /* tp_setattro */
353 0, /* tp_as_buffer */ 353 0, /* tp_as_buffer */
354 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC 354 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */
355 | Py_TPFLAGS_HAVE_FASTCALL, /* tp_flags */
356 method_doc, /* tp_doc */ 355 method_doc, /* tp_doc */
357 (traverseproc)method_traverse, /* tp_traverse */ 356 (traverseproc)method_traverse, /* tp_traverse */
358 0, /* tp_clear */ 357 0, /* tp_clear */
359 method_richcompare, /* tp_richcompare */ 358 method_richcompare, /* tp_richcompare */
360 offsetof(PyMethodObject, im_weakreflist), /* tp_weaklistoffset */ 359 offsetof(PyMethodObject, im_weakreflist), /* tp_weaklistoffset */
361 0, /* tp_iter */ 360 0, /* tp_iter */
362 0, /* tp_iternext */ 361 0, /* tp_iternext */
363 method_methods, /* tp_methods */ 362 method_methods, /* tp_methods */
364 method_memberlist, /* tp_members */ 363 method_memberlist, /* tp_members */
365 method_getset, /* tp_getset */ 364 method_getset, /* tp_getset */
366 0, /* tp_base */ 365 0, /* tp_base */
367 0, /* tp_dict */ 366 0, /* tp_dict */
368 method_descr_get, /* tp_descr_get */ 367 method_descr_get, /* tp_descr_get */
369 0, /* tp_descr_set */ 368 0, /* tp_descr_set */
370 0, /* tp_dictoffset */ 369 0, /* tp_dictoffset */
371 0, /* tp_init */ 370 0, /* tp_init */
372 0, /* tp_alloc */ 371 0, /* tp_alloc */
373 method_new, /* tp_new */ 372 method_new, /* tp_new */
374 0, /* tp_free */ 373
375 0, /* tp_is_gc */ 374 .tp_fastcall = (fastternaryfunc)method_call,
376 0, /* tp_bases */
377 0, /* tp_mro */
378 0, /* tp_cache */
379 0, /* tp_subclasses */
380 0, /* tp_weaklist */
381 0, /* tp_del */
382 0, /* tp_version_tag */
383 0, /* tp_finalize */
384 (fastternaryfunc)method_call, /* tp_fastcall */
385 }; 375 };
386 376
387 /* Clear out the free list */ 377 /* Clear out the free list */
388 378
389 int 379 int
390 PyMethod_ClearFreeList(void) 380 PyMethod_ClearFreeList(void)
391 { 381 {
392 int freelist_size = numfree; 382 int freelist_size = numfree;
393 383
394 while (free_list) { 384 while (free_list) {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 instancemethod_getset, /* tp_getset */ 641 instancemethod_getset, /* tp_getset */
652 0, /* tp_base */ 642 0, /* tp_base */
653 0, /* tp_dict */ 643 0, /* tp_dict */
654 instancemethod_descr_get, /* tp_descr_get */ 644 instancemethod_descr_get, /* tp_descr_get */
655 0, /* tp_descr_set */ 645 0, /* tp_descr_set */
656 0, /* tp_dictoffset */ 646 0, /* tp_dictoffset */
657 0, /* tp_init */ 647 0, /* tp_init */
658 0, /* tp_alloc */ 648 0, /* tp_alloc */
659 instancemethod_new, /* tp_new */ 649 instancemethod_new, /* tp_new */
660 }; 650 };
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+