]>
git.saurik.com Git - apple/objc4.git/blob - runtime/objc-runtime-new.h
2 * Copyright (c) 2005-2007 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 // Values for class_ro_t->flags
25 // These are emitted by the compiler and are part of the ABI.
26 // class is a metaclass
27 #define RO_META (1<<0)
28 // class is a root class
29 #define RO_ROOT (1<<1)
30 // class has .cxx_construct/destruct implementations
31 #define RO_HAS_CXX_STRUCTORS (1<<2)
32 // class has +load implementation
33 // #define RO_HAS_LOAD_METHOD (1<<3)
34 // class has visibility=hidden set
35 #define RO_HIDDEN (1<<4)
36 // class has attribute(objc_exception): OBJC_EHTYPE_$_ThisClass is non-weak
37 #define RO_EXCEPTION (1<<5)
38 // class is in an unloadable bundle - must never be set by compiler
39 #define RO_FROM_BUNDLE (1<<29)
40 // class is unrealized future class - must never be set by compiler
41 #define RO_FUTURE (1<<30)
42 // class is realized - must never be set by compiler
43 #define RO_REALIZED (1<<31)
45 // Values for class_rw_t->flags
46 // These are not emitted by the compiler and are never used in class_ro_t.
47 // Their presence should be considered in future ABI versions.
48 // class_t->data is class_rw_t, not class_ro_t
49 #define RW_REALIZED (1<<31)
50 // class is unresolved future class
51 #define RW_FUTURE (1<<30)
52 // class is initialized
53 #define RW_INITIALIZED (1<<29)
54 // class is initializing
55 #define RW_INITIALIZING (1<<28)
56 // class_rw_t->ro is heap copy of class_ro_t
57 #define RW_COPIED_RO (1<<27)
58 // class allocated but not yet registered
59 #define RW_CONSTRUCTING (1<<26)
60 // class allocated and registered
61 #define RW_CONSTRUCTED (1<<25)
62 // GC: class has unsafe finalize method
63 #define RW_FINALIZE_ON_MAIN_THREAD (1<<24)
64 // class +load has been called
65 #define RW_LOADED (1<<23)
66 // class does not share super's vtable
67 #define RW_SPECIALIZED_VTABLE (1<<22)
68 // class instances may have associative references
69 #define RW_INSTANCES_HAVE_ASSOCIATED_OBJECTS (1<<21)
71 typedef struct method_t
{
77 typedef struct method_list_t
{
78 uint32_t entsize_NEVER_USE
; // low 2 bits used for fixup markers
80 struct method_t first
;
83 typedef struct ivar_t
{
84 // *offset is 64-bit by accident even though other
85 // fields restrict total instance size to 32-bit.
89 // alignment is sometimes -1; use ivar_alignment() instead
90 uint32_t alignment
__attribute__((deprecated
));
94 typedef struct ivar_list_t
{
100 typedef uintptr_t protocol_ref_t
; // protocol_t *, but unremapped
102 typedef struct protocol_t
{
105 struct protocol_list_t
*protocols
;
106 method_list_t
*instanceMethods
;
107 method_list_t
*classMethods
;
108 method_list_t
*optionalInstanceMethods
;
109 method_list_t
*optionalClassMethods
;
110 struct objc_property_list
*instanceProperties
;
113 typedef struct protocol_list_t
{
114 // count is 64-bit by accident.
116 protocol_ref_t list
[0]; // variable-size
119 typedef struct class_ro_t
{
121 uint32_t instanceStart
;
122 uint32_t instanceSize
;
127 const uint8_t * ivarLayout
;
130 const method_list_t
* baseMethods
;
131 const protocol_list_t
* baseProtocols
;
132 const ivar_list_t
* ivars
;
134 const uint8_t * weakIvarLayout
;
135 const struct objc_property_list
*baseProperties
;
138 typedef struct class_rw_t
{
142 const class_ro_t
*ro
;
144 struct method_list_t
**methods
;
145 struct chained_property_list
*properties
;
146 struct protocol_list_t
** protocols
;
148 struct class_t
*firstSubclass
;
149 struct class_t
*nextSiblingClass
;
152 typedef struct class_t
{
154 struct class_t
*superclass
;
160 typedef struct category_t
{
163 struct method_list_t
*instanceMethods
;
164 struct method_list_t
*classMethods
;
165 struct protocol_list_t
*protocols
;
166 struct objc_property_list
*instanceProperties
;