2 * Copyright (c) 2006 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 //////////////////////////////////////////////////////////////////////
28 // Assembly directives to begin an exported function.
30 // Takes: functionName - name of the exported function
31 //////////////////////////////////////////////////////////////////////
39 //////////////////////////////////////////////////////////////////////
41 // END_ENTRY functionName
43 // Assembly directives to end an exported function. Just a placeholder,
44 // a close-parenthesis for ENTRY, until it is needed for something.
46 // Takes: functionName - name of the exported function
47 //////////////////////////////////////////////////////////////////////
52 //////////////////////////////////////////////////////////////////////
54 // OBJC_GET_PROPERTY_OFFSET offset
56 // Optimized id typed accessor methods.
57 // Generates an accesssor for a specified compile time offset.
59 // Takes: offset - offset of an id typed instance variable
60 //////////////////////////////////////////////////////////////////////
62 .macro OBJC_GET_PROPERTY_OFFSET
63 .private_extern __objc_getProperty_offset_$0
64 ENTRY __objc_getProperty_offset_$0
68 END_ENTRY __objc_getProperty_offset_$0
72 * Thunk to retrieve PC.
73 * `call 1; 1: pop` sequence breaks any branch-prediction stack.
79 .macro LAZY_PIC_FUNCTION_STUB
84 call L_get_pc_thunk.edx
86 movl L$0$lz - L0$$0(%edx), %ecx
89 lea L$0$lz - L0$$0(%edx),%eax
91 jmp dyld_stub_binding_helper
100 LAZY_PIC_FUNCTION_STUB _objc_assign_ivar_gc
101 #define OBJC_ASSIGN_IVAR L_objc_assign_ivar_gc$stub // call objc_assign_ivar_gc() directly to avoid extra levels of testing/branching
103 .macro OBJC_SET_PROPERTY_OFFSET
104 .private_extern __objc_setProperty_offset_$0
105 ENTRY __objc_setProperty_offset_$0
107 movl %eax, 8(%esp) // pass self as the second parameter.
109 movl %eax, 4(%esp) // pass value as the first parameter.
110 movl $$$0, 12(%esp) // pass the offset as the third parameter.
111 jmp OBJC_ASSIGN_IVAR // objc_assign_ivar_gc() is __private_extern__
112 END_ENTRY __objc_setProperty_offset_$0
115 /********************************************************************
116 * id _objc_getProperty_offset_N(id self, SEL _cmd);
117 ********************************************************************/
119 OBJC_GET_PROPERTY_OFFSET 0
120 OBJC_GET_PROPERTY_OFFSET 4
121 OBJC_GET_PROPERTY_OFFSET 8
122 OBJC_GET_PROPERTY_OFFSET 12
123 OBJC_GET_PROPERTY_OFFSET 16
124 OBJC_GET_PROPERTY_OFFSET 20
125 OBJC_GET_PROPERTY_OFFSET 24
126 OBJC_GET_PROPERTY_OFFSET 28
127 OBJC_GET_PROPERTY_OFFSET 32
128 OBJC_GET_PROPERTY_OFFSET 36
129 OBJC_GET_PROPERTY_OFFSET 40
130 OBJC_GET_PROPERTY_OFFSET 44
131 OBJC_GET_PROPERTY_OFFSET 48
132 OBJC_GET_PROPERTY_OFFSET 52
133 OBJC_GET_PROPERTY_OFFSET 56
134 OBJC_GET_PROPERTY_OFFSET 60
135 OBJC_GET_PROPERTY_OFFSET 64
137 /********************************************************************
138 * id _objc_setProperty_offset_N(id self, SEL _cmd, id value);
139 ********************************************************************/
141 OBJC_SET_PROPERTY_OFFSET 0
142 OBJC_SET_PROPERTY_OFFSET 4
143 OBJC_SET_PROPERTY_OFFSET 8
144 OBJC_SET_PROPERTY_OFFSET 12
145 OBJC_SET_PROPERTY_OFFSET 16
146 OBJC_SET_PROPERTY_OFFSET 20
147 OBJC_SET_PROPERTY_OFFSET 24
148 OBJC_SET_PROPERTY_OFFSET 28
149 OBJC_SET_PROPERTY_OFFSET 32
150 OBJC_SET_PROPERTY_OFFSET 36
151 OBJC_SET_PROPERTY_OFFSET 40
152 OBJC_SET_PROPERTY_OFFSET 44
153 OBJC_SET_PROPERTY_OFFSET 48
154 OBJC_SET_PROPERTY_OFFSET 52
155 OBJC_SET_PROPERTY_OFFSET 56
156 OBJC_SET_PROPERTY_OFFSET 60
157 OBJC_SET_PROPERTY_OFFSET 64