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

Delta Between Two Patch Sets: Include/object.h

Issue 29259: Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects
Left Patch Set: Created 3 years, 2 months ago
Right Patch Set: Created 3 years, 2 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 #ifndef Py_OBJECT_H 1 #ifndef Py_OBJECT_H
2 #define Py_OBJECT_H 2 #define Py_OBJECT_H
3 #ifdef __cplusplus 3 #ifdef __cplusplus
4 extern "C" { 4 extern "C" {
5 #endif 5 #endif
6 6
7 7
8 /* Object and type object interface */ 8 /* Object and type object interface */
9 9
10 /* 10 /*
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 628
629 /* Set if the type is 'ready' -- fully initialized */ 629 /* Set if the type is 'ready' -- fully initialized */
630 #define Py_TPFLAGS_READY (1UL << 12) 630 #define Py_TPFLAGS_READY (1UL << 12)
631 631
632 /* Set while the type is being 'readied', to prevent recursive ready calls */ 632 /* Set while the type is being 'readied', to prevent recursive ready calls */
633 #define Py_TPFLAGS_READYING (1UL << 13) 633 #define Py_TPFLAGS_READYING (1UL << 13)
634 634
635 /* Objects support garbage collection (see objimp.h) */ 635 /* Objects support garbage collection (see objimp.h) */
636 #define Py_TPFLAGS_HAVE_GC (1UL << 14) 636 #define Py_TPFLAGS_HAVE_GC (1UL << 14)
637 637
638 /* These two bits are preserved for Stackless Python, next after this is 17 */ 638 /* Bits 15 and 16 were used by Stackless Python, but are now used for tp_fastcal l */
639 #ifdef STACKLESS 639 #ifdef STACKLESS
640 #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION (3UL << 15) 640 # error "Stackless is no more supported"
641 #else 641 #endif
642 /* Constant kept for backward compatibility */
642 #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION 0 643 #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION 0
643 #endif
644 644
645 /* Objects support type attribute cache */ 645 /* Objects support type attribute cache */
646 #define Py_TPFLAGS_HAVE_VERSION_TAG (1UL << 18) 646 #define Py_TPFLAGS_HAVE_VERSION_TAG (1UL << 18)
647 #define Py_TPFLAGS_VALID_VERSION_TAG (1UL << 19) 647 #define Py_TPFLAGS_VALID_VERSION_TAG (1UL << 19)
648 648
649 /* Type is abstract and cannot be instantiated */ 649 /* Type is abstract and cannot be instantiated */
650 #define Py_TPFLAGS_IS_ABSTRACT (1UL << 20) 650 #define Py_TPFLAGS_IS_ABSTRACT (1UL << 20)
651 651
652 /* These flags are used to determine if a type is a subclass. */ 652 /* These flags are used to determine if a type is a subclass. */
653 #define Py_TPFLAGS_LONG_SUBCLASS (1UL << 24) 653 #define Py_TPFLAGS_LONG_SUBCLASS (1UL << 24)
654 #define Py_TPFLAGS_LIST_SUBCLASS (1UL << 25) 654 #define Py_TPFLAGS_LIST_SUBCLASS (1UL << 25)
655 #define Py_TPFLAGS_TUPLE_SUBCLASS (1UL << 26) 655 #define Py_TPFLAGS_TUPLE_SUBCLASS (1UL << 26)
656 #define Py_TPFLAGS_BYTES_SUBCLASS (1UL << 27) 656 #define Py_TPFLAGS_BYTES_SUBCLASS (1UL << 27)
657 #define Py_TPFLAGS_UNICODE_SUBCLASS (1UL << 28) 657 #define Py_TPFLAGS_UNICODE_SUBCLASS (1UL << 28)
658 #define Py_TPFLAGS_DICT_SUBCLASS (1UL << 29) 658 #define Py_TPFLAGS_DICT_SUBCLASS (1UL << 29)
659 #define Py_TPFLAGS_BASE_EXC_SUBCLASS (1UL << 30) 659 #define Py_TPFLAGS_BASE_EXC_SUBCLASS (1UL << 30)
660 #define Py_TPFLAGS_TYPE_SUBCLASS (1UL << 31) 660 #define Py_TPFLAGS_TYPE_SUBCLASS (1UL << 31)
661 661
662 #define Py_TPFLAGS_DEFAULT ( \
663 Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | \
664 Py_TPFLAGS_HAVE_VERSION_TAG | \
665 0)
666
667 /* NOTE: The following flags reuse lower bits (removed as part of the 662 /* NOTE: The following flags reuse lower bits (removed as part of the
668 * Python 3.0 transition). */ 663 * Python 3.0 transition). */
669 664
670 /* Type structure has tp_finalize member (3.4) */ 665 /* Type structure has tp_finalize member (3.4), it can be NULL */
671 #define Py_TPFLAGS_HAVE_FINALIZE (1UL << 0) 666 #define Py_TPFLAGS_HAVE_FINALIZE (1UL << 0)
667
668 /* Type structure has tp_fastcall member (3.7), it can be NULL */
669 #define Py_TPFLAGS_HAVE_FASTCALL (1UL << 15)
670
671 #define Py_TPFLAGS_DEFAULT ( \
672 Py_TPFLAGS_HAVE_VERSION_TAG | \
673 Py_TPFLAGS_HAVE_FINALIZE | \
674 Py_TPFLAGS_HAVE_FASTCALL | \
675 0)
672 676
673 #ifdef Py_LIMITED_API 677 #ifdef Py_LIMITED_API
674 #define PyType_HasFeature(t,f) ((PyType_GetFlags(t) & (f)) != 0) 678 #define PyType_HasFeature(t,f) ((PyType_GetFlags(t) & (f)) != 0)
675 #else 679 #else
676 #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) 680 #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
677 #endif 681 #endif
678 #define PyType_FastSubclass(t,f) PyType_HasFeature(t,f) 682 #define PyType_FastSubclass(t,f) PyType_HasFeature(t,f)
679 683
680 684
681 /* 685 /*
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 _PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks, 1076 _PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
1073 size_t sizeof_block); 1077 size_t sizeof_block);
1074 PyAPI_FUNC(void) 1078 PyAPI_FUNC(void)
1075 _PyObject_DebugTypeStats(FILE *out); 1079 _PyObject_DebugTypeStats(FILE *out);
1076 #endif /* ifndef Py_LIMITED_API */ 1080 #endif /* ifndef Py_LIMITED_API */
1077 1081
1078 #ifdef __cplusplus 1082 #ifdef __cplusplus
1079 } 1083 }
1080 #endif 1084 #endif
1081 #endif /* !Py_OBJECT_H */ 1085 #endif /* !Py_OBJECT_H */
LEFTRIGHT

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