]>
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 realized - must never be set by compiler
39 #define RO_REALIZED (1<<31)
41 // Values for class_rw_t->flags
42 // These are not emitted by the compiler and are never used in class_ro_t.
43 // Their presence should be considered in future ABI versions.
44 // class_t->data is class_rw_t, not class_ro_t
45 #define RW_REALIZED (1<<31)
46 // class's method lists are fixed up
47 #define RW_METHODIZED (1<<30)
48 // class is initialized
49 #define RW_INITIALIZED (1<<29)
50 // class is initializing
51 #define RW_INITIALIZING (1<<28)
52 // class_rw_t->ro is heap copy of class_ro_t
53 #define RW_COPIED_RO (1<<27)
54 // class allocated but not yet registered
55 #define RW_CONSTRUCTING (1<<26)
56 // class allocated and registered
57 #define RW_CONSTRUCTED (1<<25)
58 // GC: class has unsafe finalize method
59 #define RW_FINALIZE_ON_MAIN_THREAD (1<<24)
60 // class +load has been called
61 #define RW_LOADED (1<<23)
63 typedef struct method_t
{
69 typedef struct method_list_t
{
72 struct method_t first
;
75 typedef struct ivar_t
{
76 // *offset is 64-bit by accident even though other
77 // fields restrict total instance size to 32-bit.
85 typedef struct ivar_list_t
{
91 typedef struct protocol_t
{
94 struct protocol_list_t
*protocols
;
95 method_list_t
*instanceMethods
;
96 method_list_t
*classMethods
;
97 method_list_t
*optionalInstanceMethods
;
98 method_list_t
*optionalClassMethods
;
99 struct objc_property_list
*instanceProperties
;
102 typedef struct protocol_list_t
{
103 // count is 64-bit by accident.
105 protocol_t
*list
[0]; // variable-size
108 typedef struct class_ro_t
{
110 uint32_t instanceStart
;
111 uint32_t instanceSize
;
114 const uint8_t * ivarLayout
;
117 const method_list_t
* baseMethods
;
118 const protocol_list_t
* baseProtocols
;
119 const ivar_list_t
* ivars
;
121 const uint8_t * weakIvarLayout
;
122 const struct objc_property_list
*baseProperties
;
125 typedef struct class_rw_t
{
129 const class_ro_t
*ro
;
131 struct chained_method_list
*methods
;
132 struct chained_property_list
*properties
;
133 struct protocol_list_t
** protocols
; // these are UNREMAPPED protocols!
135 struct class_t
*firstSubclass
;
136 struct class_t
*nextSiblingClass
;
139 typedef struct class_t
{
141 struct class_t
*superclass
;
147 typedef struct category_t
{
150 struct method_list_t
*instanceMethods
;
151 struct method_list_t
*classMethods
;
152 struct protocol_list_t
*protocols
;
153 struct objc_property_list
*instanceProperties
;