123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- #ifndef _OBJC_ISA_H_
- #define _OBJC_ISA_H_
- #include "objc-config.h"
- #if (!SUPPORT_NONPOINTER_ISA && !SUPPORT_PACKED_ISA && !SUPPORT_INDEXED_ISA) ||\
- ( SUPPORT_NONPOINTER_ISA && SUPPORT_PACKED_ISA && !SUPPORT_INDEXED_ISA) ||\
- ( SUPPORT_NONPOINTER_ISA && !SUPPORT_PACKED_ISA && SUPPORT_INDEXED_ISA)
-
- #else
- # error bad config
- #endif
- #if SUPPORT_PACKED_ISA
-
-
-
-
-
-
-
-
-
- # if __arm64__
- # define ISA_MASK 0x0000000ffffffff8ULL
- # define ISA_MAGIC_MASK 0x000003f000000001ULL
- # define ISA_MAGIC_VALUE 0x000001a000000001ULL
- # define ISA_BITFIELD \
- uintptr_t nonpointer : 1; \
- uintptr_t has_assoc : 1; \
- uintptr_t has_cxx_dtor : 1; \
- uintptr_t shiftcls : 33; \
- uintptr_t magic : 6; \
- uintptr_t weakly_referenced : 1; \
- uintptr_t deallocating : 1; \
- uintptr_t has_sidetable_rc : 1; \
- uintptr_t extra_rc : 19
- # define RC_ONE (1ULL<<45)
- # define RC_HALF (1ULL<<18)
- # elif __x86_64__
- # define ISA_MASK 0x00007ffffffffff8ULL
- # define ISA_MAGIC_MASK 0x001f800000000001ULL
- # define ISA_MAGIC_VALUE 0x001d800000000001ULL
- # define ISA_BITFIELD \
- uintptr_t nonpointer : 1; \
- uintptr_t has_assoc : 1; \
- uintptr_t has_cxx_dtor : 1; \
- uintptr_t shiftcls : 44; \
- uintptr_t magic : 6; \
- uintptr_t weakly_referenced : 1; \
- uintptr_t deallocating : 1; \
- uintptr_t has_sidetable_rc : 1; \
- uintptr_t extra_rc : 8
- # define RC_ONE (1ULL<<56)
- # define RC_HALF (1ULL<<7)
- # else
- # error unknown architecture for packed isa
- # endif
- #endif
- #if SUPPORT_INDEXED_ISA
- # if __ARM_ARCH_7K__ >= 2 || (__arm64__ && !__LP64__)
-
- # define ISA_INDEX_IS_NPI_BIT 0
- # define ISA_INDEX_IS_NPI_MASK 0x00000001
- # define ISA_INDEX_MASK 0x0001FFFC
- # define ISA_INDEX_SHIFT 2
- # define ISA_INDEX_BITS 15
- # define ISA_INDEX_COUNT (1 << ISA_INDEX_BITS)
- # define ISA_INDEX_MAGIC_MASK 0x001E0001
- # define ISA_INDEX_MAGIC_VALUE 0x001C0001
- # define ISA_BITFIELD \
- uintptr_t nonpointer : 1; \
- uintptr_t has_assoc : 1; \
- uintptr_t indexcls : 15; \
- uintptr_t magic : 4; \
- uintptr_t has_cxx_dtor : 1; \
- uintptr_t weakly_referenced : 1; \
- uintptr_t deallocating : 1; \
- uintptr_t has_sidetable_rc : 1; \
- uintptr_t extra_rc : 7
- # define RC_ONE (1ULL<<25)
- # define RC_HALF (1ULL<<6)
- # else
- # error unknown architecture for indexed isa
- # endif
- #endif
- #endif
|