ObjFW  Check-in [3dbfc001c0]

Overview
Comment:Get rid of src/runtime/asm and move the files to src/runtime.

Subdirectories don't really work without traversing them and having a
Makefile in them and it's not really worth the effort for just 2 files.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | runtime
Files: files | file ages | folders
SHA3-256: 3dbfc001c00acd86377b17313d52e63c9405f4cfbb536f29efca559ac9251292
User & Date: js on 2012-03-06 17:18:06
Other Links: branch diff | manifest | tags
Context
2012-03-06
17:19
Fix an evil typo. check-in: b3dd58a1ae user: js tags: runtime
17:18
Get rid of src/runtime/asm and move the files to src/runtime. check-in: 3dbfc001c0 user: js tags: runtime
17:09
Fix a typo. check-in: 650f34cb63 user: js tags: runtime
Changes

Modified src/runtime/Makefile from [700f73028d] to [48afff7077].

1
2
3
4
5
6
7
8
9
10


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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			\


       protocol.m		\
       selector.m		\
       sparsearray.m		\
       static-instances.m	\
       threading.m		\
       asm/amd64-elf/lookup.S	\
       asm/x86-elf/lookup.S
INCLUDES = runtime.h

include ../../buildsys.mk

CPPFLAGS += -I. -I.. -I../..
AS = ${OBJC}
ASFLAGS = ${CPPFLAGS}
LD = ${OBJC}










>
>




|
<
<








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17


18
19
20
21
22
23
24
25
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		\
       protocol.m		\
       selector.m		\
       sparsearray.m		\
       static-instances.m	\
       threading.m


INCLUDES = runtime.h

include ../../buildsys.mk

CPPFLAGS += -I. -I.. -I../..
AS = ${OBJC}
ASFLAGS = ${CPPFLAGS}
LD = ${OBJC}

Deleted src/runtime/asm/amd64-elf/lookup.S version [1fd16b224f].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * 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__)

.intel_syntax noprefix
.globl objc_msg_lookup
.globl objc_msg_lookup_super

.section .text
objc_msg_lookup:
	test	rdi, rdi
	jz	ret_nil

	mov	r8, [rdi]
	mov	r8, [r8+64]

lookup:
	mov	rax, [rsi]
	movzx	ecx, ah
	movzx	edx, al
	shr	eax, 16

	mov	r8, [r8+rax*8]
	mov	r8, [r8+rcx*8]
	mov	rax, [r8+rdx*8]

	test	rax, rax
	jz	forward

	ret

forward:
	mov	rax, qword ptr objc_forward_handler@GOTPCREL[rip]
	jmp	[rax]

objc_msg_lookup_super:
	mov	rax, [rdi]
	test	rax, rax
	jz	ret_nil

	mov	r8, [rdi+8]
	mov	r8, [r8+64]
	mov	rdi, rax
	jmp	lookup

ret_nil:
	lea	rax, nil_method[rip]
	ret

nil_method:
	mov	rax, rdi
	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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































































































































Deleted src/runtime/asm/x86-elf/lookup.S version [213672a51c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * 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__)

.intel_syntax noprefix
.globl objc_msg_lookup
.globl objc_msg_lookup_super

.section .text
objc_msg_lookup:
	mov	edx, [esp+4]
	test	edx, edx
	jz	ret_nil

	mov	edx, [edx]
	mov	edx, [edx+32]

lookup:
	mov	eax, [esp+8]

	movzx	ecx, byte ptr [eax+2]
	mov	edx, [edx+ecx*4]
	movzx	ecx, byte ptr [eax+1]
	mov	edx, [edx+ecx*4]
	movzx	ecx, byte ptr [eax]
	mov	eax, [edx+ecx*4]

	test	eax, eax
	jz	forward

	ret

forward:
	call	get_eip
.L1:
	add	eax, offset objc_forward_handler - offset .L1
	jmp	[eax]

objc_msg_lookup_super:
	mov	edx, [esp+4]
	cmp	dword ptr [edx], 0
	je	ret_nil

	mov	edx, [edx+4]
	mov	edx, [edx+32]
	jmp	lookup

ret_nil:
	call	get_eip
.L2:
	add	eax, offset nil_method - offset .L2
	ret

nil_method:
	mov	eax, [esp+4]
	ret

get_eip:
	mov	eax, dword ptr [esp]
	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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































































































































































Added src/runtime/lookup-amd64-elf.S version [1fd16b224f].



















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * 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__)

.intel_syntax noprefix
.globl objc_msg_lookup
.globl objc_msg_lookup_super

.section .text
objc_msg_lookup:
	test	rdi, rdi
	jz	ret_nil

	mov	r8, [rdi]
	mov	r8, [r8+64]

lookup:
	mov	rax, [rsi]
	movzx	ecx, ah
	movzx	edx, al
	shr	eax, 16

	mov	r8, [r8+rax*8]
	mov	r8, [r8+rcx*8]
	mov	rax, [r8+rdx*8]

	test	rax, rax
	jz	forward

	ret

forward:
	mov	rax, qword ptr objc_forward_handler@GOTPCREL[rip]
	jmp	[rax]

objc_msg_lookup_super:
	mov	rax, [rdi]
	test	rax, rax
	jz	ret_nil

	mov	r8, [rdi+8]
	mov	r8, [r8+64]
	mov	rdi, rax
	jmp	lookup

ret_nil:
	lea	rax, nil_method[rip]
	ret

nil_method:
	mov	rax, rdi
	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

Added src/runtime/lookup-x86-elf.S version [213672a51c].



































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * 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__)

.intel_syntax noprefix
.globl objc_msg_lookup
.globl objc_msg_lookup_super

.section .text
objc_msg_lookup:
	mov	edx, [esp+4]
	test	edx, edx
	jz	ret_nil

	mov	edx, [edx]
	mov	edx, [edx+32]

lookup:
	mov	eax, [esp+8]

	movzx	ecx, byte ptr [eax+2]
	mov	edx, [edx+ecx*4]
	movzx	ecx, byte ptr [eax+1]
	mov	edx, [edx+ecx*4]
	movzx	ecx, byte ptr [eax]
	mov	eax, [edx+ecx*4]

	test	eax, eax
	jz	forward

	ret

forward:
	call	get_eip
.L1:
	add	eax, offset objc_forward_handler - offset .L1
	jmp	[eax]

objc_msg_lookup_super:
	mov	edx, [esp+4]
	cmp	dword ptr [edx], 0
	je	ret_nil

	mov	edx, [edx+4]
	mov	edx, [edx+32]
	jmp	lookup

ret_nil:
	call	get_eip
.L2:
	add	eax, offset nil_method - offset .L2
	ret

nil_method:
	mov	eax, [esp+4]
	ret

get_eip:
	mov	eax, dword ptr [esp]
	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

Modified src/runtime/lookup.m from [979591be16] to [29b33e14c4].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 */

#include "config.h"

#include <stdio.h>
#include <stdlib.h>

#import  "runtime.h"
#import "runtime-private.h"
#import "macros.h"

static IMP not_found_handler(id, SEL);
IMP (*objc_forward_handler)(id, SEL) = not_found_handler;

static IMP







|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 */

#include "config.h"

#include <stdio.h>
#include <stdlib.h>

#import "runtime.h"
#import "runtime-private.h"
#import "macros.h"

static IMP not_found_handler(id, SEL);
IMP (*objc_forward_handler)(id, SEL) = not_found_handler;

static IMP