ObjFW  Check-in [e382d2a8cb]

Overview
Comment:Check in configure whether to use assembly lookup.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | runtime
Files: files | file ages | folders
SHA3-256: e382d2a8cbfb2fbb26603848df9e2977ff54b8447b26baf92c4dd165607633e0
User & Date: js on 2012-05-03 22:31:53
Other Links: branch diff | manifest | tags
Context
2012-05-07
08:22
Use lower 24 bits of the selector hash. check-in: ee5fd980f8 user: js tags: runtime
2012-05-03
22:31
Check in configure whether to use assembly lookup. check-in: e382d2a8cb user: js tags: runtime
2012-04-25
09:11
Remove useless GNU runtime warning check. check-in: 0dce5656f8 user: js tags: runtime
Changes

Modified configure.ac from [dcc83d6fc5] to [87a986c8ea].

188
189
190
191
192
193
194






















195
196
197
198
199
200
201
			AC_SUBST(RUNTIME_RUNTIME_LIB_A, "runtime/runtime.lib.a")
		fi
		if test x"$enable_static" = x"yes" \
		    -o x"$enable_shared" = x"no"; then
			AC_SUBST(RUNTIME_A, "runtime.a")
			AC_SUBST(RUNTIME_RUNTIME_A, "runtime/runtime.a")
		fi






















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

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







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







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
			AC_SUBST(RUNTIME_RUNTIME_LIB_A, "runtime/runtime.lib.a")
		fi
		if test x"$enable_static" = x"yes" \
		    -o x"$enable_shared" = x"no"; then
			AC_SUBST(RUNTIME_A, "runtime.a")
			AC_SUBST(RUNTIME_RUNTIME_A, "runtime/runtime.a")
		fi

		AC_EGREP_CPP(yes, [
			#if defined(__amd64__) || defined(__x86_64__)
			# ifdef __ELF__
			yes
			# endif
			#endif
		], [
			AC_SUBST(LOOKUP_S, lookup-amd64-elf.S)
			AC_DEFINE(OF_ASM_LOOKUP, 1,
				[Whether to use lookup in assembly])
		], [
			AC_EGREP_CPP(yes, [
				#if defined(__i386__) && defined(__ELF__)
				yes
				#endif
			], [
				AC_SUBST(LOOKUP_S, lookup-x86-elf.S)
				AC_DEFINE(OF_ASM_LOOKUP, 1,
					[Whether to use lookup in assembly])
			])
		])
		;;
	"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 extra.mk.in from [4dec53a4cc] to [21c2490513].

8
9
10
11
12
13
14

15
16
17
18
19
20
21
ATOMIC_H = @ATOMIC_H@
BIN_PREFIX = @BIN_PREFIX@
EXCEPTIONS_A = @EXCEPTIONS_A@
EXCEPTIONS_EXCEPTIONS_A = @EXCEPTIONS_EXCEPTIONS_A@
EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@
EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@
FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@

MACH_ALIAS_LIST = @MACH_ALIAS_LIST@
OFBLOCKTESTS_M = @OFBLOCKTESTS_M@
OBJC_PROPERTIES_M = @OBJC_PROPERTIES_M@
OBJC_SYNC_M = @OBJC_SYNC_M@
OFHTTPREQUESTTESTS_M = @OFHTTPREQUESTTESTS_M@
OFPLUGIN_M = @OFPLUGIN_M@
OFPLUGINTESTS_M = @OFPLUGINTESTS_M@







>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
ATOMIC_H = @ATOMIC_H@
BIN_PREFIX = @BIN_PREFIX@
EXCEPTIONS_A = @EXCEPTIONS_A@
EXCEPTIONS_EXCEPTIONS_A = @EXCEPTIONS_EXCEPTIONS_A@
EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@
EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@
FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@
LOOKUP_S = @LOOKUP_S@
MACH_ALIAS_LIST = @MACH_ALIAS_LIST@
OFBLOCKTESTS_M = @OFBLOCKTESTS_M@
OBJC_PROPERTIES_M = @OBJC_PROPERTIES_M@
OBJC_SYNC_M = @OBJC_SYNC_M@
OFHTTPREQUESTTESTS_M = @OFHTTPREQUESTTESTS_M@
OFPLUGIN_M = @OFPLUGIN_M@
OFPLUGINTESTS_M = @OFPLUGINTESTS_M@

Modified src/runtime/Makefile from [b3597d7cd3] to [22377f6c1a].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
include ../../extra.mk

STATIC_PIC_LIB_NOINST = ${RUNTIME_LIB_A}
STATIC_LIB_NOINST = ${RUNTIME_A}

SRCS = category.m		\
       class.m			\
       hashtable.m		\
       init.m			\
       lookup.m			\
       lookup-amd64-elf.S	\
       lookup-x86-elf.S		\
       property.m		\
       protocol.m		\
       selector.m		\
       sparsearray.m		\
       static-instances.m	\
       synchronized.m		\
       threading.m










<
|







1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
18
include ../../extra.mk

STATIC_PIC_LIB_NOINST = ${RUNTIME_LIB_A}
STATIC_LIB_NOINST = ${RUNTIME_A}

SRCS = category.m		\
       class.m			\
       hashtable.m		\
       init.m			\
       lookup.m			\

       ${LOOKUP_S}		\
       property.m		\
       protocol.m		\
       selector.m		\
       sparsearray.m		\
       static-instances.m	\
       synchronized.m		\
       threading.m

Modified src/runtime/lookup-amd64-elf.S from [57e05c2a54] to [a0fef4c085].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#if defined(__x86_64__) && defined(__ELF__)

.globl objc_msg_lookup
.globl objc_msg_lookup_super

.section .text
objc_msg_lookup:
	testq	%rdi, %rdi
	jz	ret_nil







<
<







10
11
12
13
14
15
16


17
18
19
20
21
22
23
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */



.globl objc_msg_lookup
.globl objc_msg_lookup_super

.section .text
objc_msg_lookup:
	testq	%rdi, %rdi
	jz	ret_nil
64
65
66
67
68
69
70
71
72
	movq	%rdi, %rax
	ret

.type objc_msg_lookup, @function
.type objc_msg_lookup_super, @function
.size objc_msg_lookup, forward-objc_msg_lookup
.size objc_msg_lookup_super, ret_nil-objc_msg_lookup_super

#endif







<
<
62
63
64
65
66
67
68


	movq	%rdi, %rax
	ret

.type objc_msg_lookup, @function
.type objc_msg_lookup_super, @function
.size objc_msg_lookup, forward-objc_msg_lookup
.size objc_msg_lookup_super, ret_nil-objc_msg_lookup_super


Modified src/runtime/lookup-x86-elf.S from [ee522b3dc7] to [cafa9c173a].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#if defined(__i386__) && defined(__ELF__)

.globl objc_msg_lookup
.globl objc_msg_lookup_super

.section .text
objc_msg_lookup:
	movl	4(%esp), %edx
	testl	%edx, %edx







<
<







10
11
12
13
14
15
16


17
18
19
20
21
22
23
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */



.globl objc_msg_lookup
.globl objc_msg_lookup_super

.section .text
objc_msg_lookup:
	movl	4(%esp), %edx
	testl	%edx, %edx
72
73
74
75
76
77
78
79
80
	movl	(%esp), %eax
	ret

.type objc_msg_lookup, @function
.type objc_msg_lookup_super, @function
.size objc_msg_lookup, forward-objc_msg_lookup
.size objc_msg_lookup_super, ret_nil-objc_msg_lookup_super

#endif







<
<
70
71
72
73
74
75
76


	movl	(%esp), %eax
	ret

.type objc_msg_lookup, @function
.type objc_msg_lookup_super, @function
.size objc_msg_lookup, forward-objc_msg_lookup
.size objc_msg_lookup_super, ret_nil-objc_msg_lookup_super


Modified src/runtime/lookup.m from [035f3dccce] to [4a37e847d8].

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
	if (cls == Nil)
		return NO;

	return (objc_sparsearray_get(cls->dtable, (uint32_t)sel->uid) != NULL
	    ? YES : NO);
}

#if !defined(__ELF__) || (!defined(OF_X86_ASM) && !defined(OF_AMD64_ASM))
static id
nil_method(id self, SEL _cmd)
{
	return nil;
}

IMP







|







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
	if (cls == Nil)
		return NO;

	return (objc_sparsearray_get(cls->dtable, (uint32_t)sel->uid) != NULL
	    ? YES : NO);
}

#ifndef OF_ASM_LOOKUP
static id
nil_method(id self, SEL _cmd)
{
	return nil;
}

IMP