ObjFW  Check-in [fd4a416f66]

Overview
Comment:Add lookup-asm-arm64-elf.S
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fd4a416f665c43e9e3d7b7397149ea9898f65a5b20af7be7fdbb054fc1c4baa3
User & Date: js on 2016-01-06 00:08:08
Other Links: manifest | tags
Context
2016-01-20
00:19
Add forwardingTargetForSelector: for ARM64/ELF check-in: 7e6bad326c user: js tags: trunk
2016-01-06
00:08
Add lookup-asm-arm64-elf.S check-in: fd4a416f66 user: js tags: trunk
2016-01-05
22:52
PLATFORMS.md: Update Android check-in: df7c358c36 user: js tags: trunk
Changes

Added src/runtime/lookup-asm/lookup-asm-arm64-elf.S version [33b4da82fe].




















































































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
82
83
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
 *   Jonathan Schleifer <js@heap.zone>
 *
 * 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.
 */

#include "config.h"

#include "platform.h"

.globl objc_msg_lookup
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro generate_lookup name not_found
\name:
	cmp	x0, #0
	beq	ret_nil

	ldr	x2, [x0, #0]
	ldr	x2, [x2, #64]

.Lmain_\name:
#ifdef OF_SELUID24
	ldrb	w3, [x1, #2]
	ldr	x2, [x2, x3, lsl #3]
#endif
	ldrb	w3, [x1, #1]
	ldr	x2, [x2, x3, lsl #3]
	ldrb	w3, [x1, #0]
	ldr	x2, [x2, x3, lsl #3]

	cmp	x2, #0
	beq	\not_found

	mov	x0, x2
	ret
.type \name, %function
.size \name, .-\name
.endm

.macro generate_lookup_super name lookup
\name:
	ldr	x2, [x0, #0]
	cmp	x0, #0
	beq	ret_nil

	ldr	x2, [x0, #8]
	ldr	x2, [x2, #64]

	b	.Lmain_\lookup
.type \name, %function
.size \name, .-\name
.endm

generate_lookup objc_msg_lookup objc_method_not_found
generate_lookup objc_msg_lookup_stret objc_method_not_found_stret
generate_lookup_super objc_msg_lookup_super objc_msg_lookup
generate_lookup_super objc_msg_lookup_super_stret objc_msg_lookup_stret

ret_nil:
	adr	x0, nil_method
	ret

nil_method:
	mov	x0, #0
	ret

#ifdef OF_LINUX
.section .note.GNU-stack, "", %progbits
#endif

Modified src/runtime/lookup-asm/lookup-asm.S from [3fb43b35fa] to [b638ae745b].

19
20
21
22
23
24
25


26
27
28
29
30
31
32
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34







+
+







#include "platform.h"

#if defined(OF_ELF)
# if defined(OF_X86_64)
#  include "lookup-asm-x86_64-elf.S"
# elif defined(OF_X86)
#  include "lookup-asm-x86-elf.S"
# elif defined(OF_ARM64)
#  include "lookup-asm-arm64-elf.S"
# elif defined(OF_ARM)
#  include "lookup-asm-arm-elf.S"
# elif defined(OF_POWERPC)
#  include "lookup-asm-ppc-elf.S"
# elif defined(OF_MIPS)
#  include "lookup-asm-mips-elf.S"
# elif defined(OF_SPARC64)

Modified src/runtime/runtime-private.h from [26a5f2070f] to [bae86bc27a].

182
183
184
185
186
187
188
189
190


191
192
193
194
195
196
197
182
183
184
185
186
187
188


189
190
191
192
193
194
195
196
197







-
-
+
+








	return dtable->buckets[i]->buckets[j];
#endif
}

#if defined(OF_ELF)
# if defined(OF_X86_64) || defined(OF_X86) || defined(OF_POWERPC) || \
	defined(OF_ARM) || defined(OF_MIPS) || defined(OF_SPARC64) || \
	defined(OF_SPARC)
	defined(OF_ARM64) || defined(OF_ARM) || defined(OF_MIPS) || \
	defined(OF_SPARC64) || defined(OF_SPARC)
#  define OF_ASM_LOOKUP
# endif
#elif defined(OF_MACH_O)
# if defined(OF_X86_64) || defined(OF_POWERPC)
#  define OF_ASM_LOOKUP
# endif
#elif defined(OF_WINDOWS)