ObjFW  Check-in [7fe9b2e320]

Overview
Comment:Don't inline runtime functions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7fe9b2e3202d145cfb0c2c8de9df04a23912df352a8e7f89d442dfa8b537ec71
User & Date: js on 2012-12-06 01:19:05
Other Links: manifest | tags
Context
2012-12-06
11:00
Add of_random(). check-in: f675979cf0 user: js tags: trunk
01:19
Don't inline runtime functions. check-in: 7fe9b2e320 user: js tags: trunk
01:08
runtime.h: Remove functions which are elsewhere. check-in: 5c5ae52ccd user: js tags: trunk
Changes

Modified configure.ac from [a9440db0fe] to [22d4536db7].

252
253
254
255
256
257
258



259
260
261
262
263
264
265
				[Whether to use assembly for lookup])
		])

		AS_IF([test x"$enable_seluid16" = x"yes"], [
			AC_DEFINE(OF_SELUID16, 1,
				[Whether to use 16 bit selector UIDs])
		])



		;;
	"Apple runtime")
		AC_DEFINE(OF_APPLE_RUNTIME, 1,
			[Whether we use the Apple ObjC runtime])

		AC_CHECK_LIB(objc, objc_msgSend, [
			LIBS="-lobjc $LIBS"







>
>
>







252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
				[Whether to use assembly for lookup])
		])

		AS_IF([test x"$enable_seluid16" = x"yes"], [
			AC_DEFINE(OF_SELUID16, 1,
				[Whether to use 16 bit selector UIDs])
		])

		AX_CHECK_COMPILER_FLAGS(-Wno-deprecated-objc-isa-usage,
			[OBJCFLAGS="$OBJCFLAGS -Wno-deprecated-objc-isa-usage"])
		;;
	"Apple runtime")
		AC_DEFINE(OF_APPLE_RUNTIME, 1,
			[Whether we use the Apple ObjC runtime])

		AC_CHECK_LIB(objc, objc_msgSend, [
			LIBS="-lobjc $LIBS"

Modified src/runtime/class.m from [72c72347b1] to [9dc5ac3596].

401
402
403
404
405
406
407






408
409
410
411
412
413
414
}

Class
objc_get_class(const char *name)
{
	return objc_getRequiredClass(name);
}







const char*
class_getName(Class cls)
{
	return cls->name;
}








>
>
>
>
>
>







401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
}

Class
objc_get_class(const char *name)
{
	return objc_getRequiredClass(name);
}

BOOL
class_isMetaClass(Class cls)
{
	return (cls->info & OBJC_CLASS_INFO_METACLASS);
}

const char*
class_getName(Class cls)
{
	return cls->name;
}

550
551
552
553
554
555
556






















557
558
559
560
561
562
563

	objc_update_dtable(cls);

	objc_global_mutex_unlock();

	return (IMP)nil;
}























static void
free_class(Class rcls)
{
	struct objc_abi_class *cls = (struct objc_abi_class*)rcls;

	if (rcls->subclass_list != NULL) {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591

	objc_update_dtable(cls);

	objc_global_mutex_unlock();

	return (IMP)nil;
}

Class
object_getClass(id obj)
{
	return obj->isa;
}

Class
object_setClass(id obj, Class cls)
{
	Class old = obj->isa;

	obj->isa = cls;

	return old;
}

const char*
object_getClassName(id obj)
{
	return obj->isa->name;
}

static void
free_class(Class rcls)
{
	struct objc_abi_class *cls = (struct objc_abi_class*)rcls;

	if (rcls->subclass_list != NULL) {

Modified src/runtime/runtime.h from [311da7e0b4] to [16313bd3af].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

#ifndef __has_feature
# define __has_feature(x) 0
#endif

#if __has_feature(objc_arc)
# define OBJC_UNSAFE_UNRETAINED __unsafe_unretained
# define OBJC_BRIDGE __bridge
#else
# define OBJC_UNSAFE_UNRETAINED
# define OBJC_BRIDGE
#endif

typedef struct objc_class *Class;
typedef struct objc_object *id;
typedef const struct objc_selector *SEL;
typedef signed char BOOL;
typedef id (*IMP)(id, SEL, ...);







<


<







20
21
22
23
24
25
26

27
28

29
30
31
32
33
34
35

#ifndef __has_feature
# define __has_feature(x) 0
#endif

#if __has_feature(objc_arc)
# define OBJC_UNSAFE_UNRETAINED __unsafe_unretained

#else
# define OBJC_UNSAFE_UNRETAINED

#endif

typedef struct objc_class *Class;
typedef struct objc_object *id;
typedef const struct objc_selector *SEL;
typedef signed char BOOL;
typedef id (*IMP)(id, SEL, ...);
168
169
170
171
172
173
174

175
176
177
178
179
180
181
182
183



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

extern SEL sel_registerName(const char*);
extern const char* sel_getName(SEL);
extern BOOL sel_isEqual(SEL, SEL);
extern id objc_lookUpClass(const char*);
extern id objc_getClass(const char*);
extern id objc_getRequiredClass(const char*);

extern const char* class_getName(Class);
extern Class class_getSuperclass(Class);
extern BOOL class_isKindOfClass(Class, Class);
extern unsigned long class_getInstanceSize(Class);
extern BOOL class_respondsToSelector(Class, SEL);
extern BOOL class_conformsToProtocol(Class, Protocol*);
extern IMP class_getMethodImplementation(Class, SEL);
extern IMP class_replaceMethod(Class, SEL, IMP, const char*);
extern const char* objc_get_type_encoding(Class, SEL);



extern IMP objc_msg_lookup(id, SEL);
extern IMP objc_msg_lookup_super(struct objc_super*, SEL);
extern const char* protocol_getName(Protocol*);
extern BOOL protocol_isEqual(Protocol*, Protocol*);
extern BOOL protocol_conformsToProtocol(Protocol*, Protocol*);
extern void objc_exit(void);
extern objc_uncaught_exception_handler objc_setUncaughtExceptionHandler(
    objc_uncaught_exception_handler);
extern IMP (*objc_forward_handler)(id, SEL);
extern id objc_autorelease(id);
extern void* objc_autoreleasePoolPush(void);
extern void objc_autoreleasePoolPop(void*);
extern id _objc_rootAutorelease(id);

static inline Class
object_getClass(id obj_)
{
	struct objc_object *obj = (OBJC_BRIDGE struct objc_object*)obj_;

	return obj->isa;
}

static inline Class
object_setClass(id obj_, Class cls)
{
	struct objc_object *obj = (OBJC_BRIDGE struct objc_object*)obj_;
	Class old = obj->isa;

	obj->isa = cls;

	return old;
}

static inline const char*
object_getClassName(id obj)
{
	return class_getName(object_getClass(obj));
}

static inline BOOL
class_isMetaClass(Class cls_)
{
	struct objc_class *cls = (OBJC_BRIDGE struct objc_class*)cls_;

	return (cls->info & OBJC_CLASS_INFO_METACLASS);
}

#undef OBJC_UNSAFE_UNRETAINED
#undef OBJC_BRIDGE

#endif







>









>
>
>














<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<


166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199

































200

201
202

extern SEL sel_registerName(const char*);
extern const char* sel_getName(SEL);
extern BOOL sel_isEqual(SEL, SEL);
extern id objc_lookUpClass(const char*);
extern id objc_getClass(const char*);
extern id objc_getRequiredClass(const char*);
extern BOOL class_isMetaClass(Class);
extern const char* class_getName(Class);
extern Class class_getSuperclass(Class);
extern BOOL class_isKindOfClass(Class, Class);
extern unsigned long class_getInstanceSize(Class);
extern BOOL class_respondsToSelector(Class, SEL);
extern BOOL class_conformsToProtocol(Class, Protocol*);
extern IMP class_getMethodImplementation(Class, SEL);
extern IMP class_replaceMethod(Class, SEL, IMP, const char*);
extern const char* objc_get_type_encoding(Class, SEL);
extern Class object_getClass(id);
extern Class object_setClass(id, Class);
extern const char* object_getClassName(id);
extern IMP objc_msg_lookup(id, SEL);
extern IMP objc_msg_lookup_super(struct objc_super*, SEL);
extern const char* protocol_getName(Protocol*);
extern BOOL protocol_isEqual(Protocol*, Protocol*);
extern BOOL protocol_conformsToProtocol(Protocol*, Protocol*);
extern void objc_exit(void);
extern objc_uncaught_exception_handler objc_setUncaughtExceptionHandler(
    objc_uncaught_exception_handler);
extern IMP (*objc_forward_handler)(id, SEL);
extern id objc_autorelease(id);
extern void* objc_autoreleasePoolPush(void);
extern void objc_autoreleasePoolPop(void*);
extern id _objc_rootAutorelease(id);


































#undef OBJC_UNSAFE_UNRETAINED


#endif