ObjFW  Check-in [75d88e0f6e]

Overview
Comment:Add endbr32 / endbr64
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 75d88e0f6e6c6003e9dce22e8a99ac0c6d71db6805f46420e6e4f8bd59461065
User & Date: js on 2024-02-24 20:50:51
Other Links: manifest | tags
Context
2024-02-24
21:07
Add bti instructions check-in: 5c0891c85d user: js tags: trunk
20:57
Add endbr32 / endbr64 check-in: 262baf76e7 user: js tags: 1.0
20:50
Add endbr32 / endbr64 check-in: 75d88e0f6e user: js tags: trunk
19:42
runtime: Fix objc_getClassList not unlocking mutex check-in: 39e23d6363 user: js tags: trunk
Changes

Modified configure.ac from [5be93faa88] to [6589788787].

842
843
844
845
846
847
848


























849
850
851
852
853
854
855
		])
	], [
		AC_DEFINE(HAVE_VFP2, 1, [Whether we have VFP2 or above])
		AC_MSG_RESULT(yes)
	], [
		AC_MSG_RESULT(no)
	])


























	;;
esac

AC_CHECK_LIB(m, fmod, LIBS="$LIBS -lm")
AC_CHECK_LIB(complex, creal, TESTS_LIBS="$TESTS_LIBS -lcomplex")

AC_CHECK_FUNCS(strtof truncf)







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







842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
		])
	], [
		AC_DEFINE(HAVE_VFP2, 1, [Whether we have VFP2 or above])
		AC_MSG_RESULT(yes)
	], [
		AC_MSG_RESULT(no)
	])
	;;
i?86)
	AC_MSG_CHECKING(for endbr32)
	AC_COMPILE_IFELSE([
		AC_LANG_PROGRAM([], [
			__asm__ __volatile__ ("endbr32");
		])
	], [
		AC_DEFINE(HAVE_ENDBR32, 1, [Whether we have endbr32])
		AC_MSG_RESULT(yes)
	], [
		AC_MSG_RESULT(no)
	])
	;;
x86_64)
	AC_MSG_CHECKING(for endbr64)
	AC_COMPILE_IFELSE([
		AC_LANG_PROGRAM([], [
			__asm__ __volatile__ ("endbr64");
		])
	], [
		AC_DEFINE(HAVE_ENDBR64, 1, [Whether we have endbr64])
		AC_MSG_RESULT(yes)
	], [
		AC_MSG_RESULT(no)
	])
	;;
esac

AC_CHECK_LIB(m, fmod, LIBS="$LIBS -lm")
AC_CHECK_LIB(complex, creal, TESTS_LIBS="$TESTS_LIBS -lcomplex")

AC_CHECK_FUNCS(strtof truncf)

Modified src/forwarding/apple-forwarding-amd64.S from [59b2226de5] to [dda0d17f49].

27
28
29
30
31
32
33




34
35
36
37
38
39
40
	.quad Lstr_forwardingTargetForSelector_

.section __DATA, __objc_imageinfo, regular, no_dead_strip
	.long 0, 0

.section __TEXT, __text, regular, pure_instructions
_OFForward:




	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)







>
>
>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	.quad Lstr_forwardingTargetForSelector_

.section __DATA, __objc_imageinfo, regular, no_dead_strip
	.long 0, 0

.section __TEXT, __text, regular, pure_instructions
_OFForward:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)
100
101
102
103
104
105
106




107
108
109
110
111
112
113

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_OFMethodNotFound

_OFForward_stret:




	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)







>
>
>
>







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_OFMethodNotFound

_OFForward_stret:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)

Modified src/forwarding/apple-forwarding-x86.S from [5b3e10592e] to [d769e50b08].

27
28
29
30
31
32
33




34
35
36
37
38
39
40
	.long Lstr_forwardingTargetForSelector_

.section __OBJC, __image_info
	.long 0, 0

.section __TEXT, __text, regular, pure_instructions
_OFForward:




	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	LgetEIP







>
>
>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	.long Lstr_forwardingTargetForSelector_

.section __OBJC, __image_info
	.long 0, 0

.section __TEXT, __text, regular, pure_instructions
_OFForward:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	LgetEIP
77
78
79
80
81
82
83




84
85
86
87
88
89
90
	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	_OFMethodNotFound

_OFForward_stret:




	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	LgetEIP







>
>
>
>







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	_OFMethodNotFound

_OFForward_stret:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	LgetEIP

Modified src/forwarding/forwarding-amd64-elf.S from [f508a1c5c1] to [23dfe640bd].

18
19
20
21
22
23
24




25
26
27
28
29
30
31
#include "platform.h"

.globl OFForward
.globl OFForward_stret

.section .text
OFForward:




	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)







>
>
>
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "platform.h"

.globl OFForward
.globl OFForward_stret

.section .text
OFForward:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)
103
104
105
106
107
108
109




110
111
112
113
114
115
116
	popq	%rbp

	jmp	OFMethodNotFound@PLT
.type OFForward, %function
.size OFForward, .-OFForward

OFForward_stret:




	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)







>
>
>
>







107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
	popq	%rbp

	jmp	OFMethodNotFound@PLT
.type OFForward, %function
.size OFForward, .-OFForward

OFForward_stret:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)
190
191
192
193
194
195
196




197
198
199
200
201
202
203
	popq	%rbp

	jmp	OFMethodNotFound_stret@PLT
.type OFForward_stret, %function
.size OFForward_stret, .-OFForward_stret

.Linit:




	leaq	.Lmodule(%rip), %rdi
	jmp	__objc_exec_class@PLT

#ifdef OF_SOLARIS
.section .init_array, "aw"
#else
.section .ctors, "aw", %progbits







>
>
>
>







198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
	popq	%rbp

	jmp	OFMethodNotFound_stret@PLT
.type OFForward_stret, %function
.size OFForward_stret, .-OFForward_stret

.Linit:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	leaq	.Lmodule(%rip), %rdi
	jmp	__objc_exec_class@PLT

#ifdef OF_SOLARIS
.section .init_array, "aw"
#else
.section .ctors, "aw", %progbits

Modified src/forwarding/forwarding-amd64-macho.S from [fb857e93f9] to [b2c96d5bb0].

18
19
20
21
22
23
24




25
26
27
28
29
30
31
#include "platform.h"

.globl _OFForward
.globl _OFForward_stret

.section __TEXT, __text, regular, pure_instructions
_OFForward:




	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)







>
>
>
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "platform.h"

.globl _OFForward
.globl _OFForward_stret

.section __TEXT, __text, regular, pure_instructions
_OFForward:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)
101
102
103
104
105
106
107




108
109
110
111
112
113
114

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_OFMethodNotFound

_OFForward_stret:




	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)







>
>
>
>







105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_OFMethodNotFound

_OFForward_stret:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0xC0, %rsp	/* 16-byte alignment */
	movq	%rax, -0x8(%rbp)
	movq	%rdi, -0x10(%rbp)
186
187
188
189
190
191
192




193
194
195
196
197
198
199

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_OFMethodNotFound_stret

Linit:




	leaq	Lmodule(%rip), %rdi
	jmp	___objc_exec_class

.section __DATA, __mod_init_func, mod_init_funcs
	.quad Linit

.section __TEXT, __cstring, cstring_literals







>
>
>
>







194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_OFMethodNotFound_stret

Linit:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	leaq	Lmodule(%rip), %rdi
	jmp	___objc_exec_class

.section __DATA, __mod_init_func, mod_init_funcs
	.quad Linit

.section __TEXT, __cstring, cstring_literals

Modified src/forwarding/forwarding-amd64-win64.S from [fedf0b1bb7] to [e1d53b7337].

16
17
18
19
20
21
22




23
24
25
26
27
28
29
#include "config.h"

.globl OFForward
.globl OFForward_stret

.section .text
OFForward:




	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0x90, %rsp	/* 16-byte alignment */
	movq	%rax, -0x28(%rbp)
	movq	%rcx, -0x30(%rbp)







>
>
>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "config.h"

.globl OFForward
.globl OFForward_stret

.section .text
OFForward:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0x90, %rsp	/* 16-byte alignment */
	movq	%rax, -0x28(%rbp)
	movq	%rcx, -0x30(%rbp)
91
92
93
94
95
96
97




98
99
100
101
102
103
104
	jmp	OFMethodNotFound
.def OFForward
.scl 2
.type 32
.endef

OFForward_stret:




	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0x90, %rsp	/* 16-byte alignment */
	movq	%rax, -0x28(%rbp)
	movq	%rcx, -0x30(%rbp)







>
>
>
>







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
	jmp	OFMethodNotFound
.def OFForward
.scl 2
.type 32
.endef

OFForward_stret:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	pushq	%rbp
	movq	%rsp, %rbp

	/* Save all arguments */
	subq	$0x90, %rsp	/* 16-byte alignment */
	movq	%rax, -0x28(%rbp)
	movq	%rcx, -0x30(%rbp)
168
169
170
171
172
173
174




175
176
177
178
179
180
181
	jmp	OFMethodNotFound_stret
.def OFForward_stret
.scl 2
.type 32
.endef

.Linit:




	leaq	.Lmodule(%rip), %rcx
	jmp	__objc_exec_class

.section .ctors, "aw"
	.quad .Linit

.section .rodata







>
>
>
>







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
	jmp	OFMethodNotFound_stret
.def OFForward_stret
.scl 2
.type 32
.endef

.Linit:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	leaq	.Lmodule(%rip), %rcx
	jmp	__objc_exec_class

.section .ctors, "aw"
	.quad .Linit

.section .rodata

Modified src/forwarding/forwarding-x86-elf.S from [8672a85794] to [c50bd5dc41].

18
19
20
21
22
23
24




25
26
27
28
29
30
31
#include "platform.h"

.globl OFForward
.globl OFForward_stret

.section .text
OFForward:




	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	.LgetEIP







>
>
>
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "platform.h"

.globl OFForward
.globl OFForward_stret

.section .text
OFForward:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	.LgetEIP
82
83
84
85
86
87
88




89
90
91
92
93
94
95
	popl	%ebp

	jmp	*%eax
.type OFForward, %function
.size OFForward, .-OFForward

OFForward_stret:




	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	.LgetEIP







>
>
>
>







86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
	popl	%ebp

	jmp	*%eax
.type OFForward, %function
.size OFForward, .-OFForward

OFForward_stret:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	.LgetEIP
146
147
148
149
150
151
152




153
154
155
156
157
158
159
	popl	%ebp

	jmp	*%eax
.type OFForward_stret, %function
.size OFForward_stret, .-OFForward_stret

.Linit:




	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$4, %esp

	call	.LgetEIP







>
>
>
>







154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
	popl	%ebp

	jmp	*%eax
.type OFForward_stret, %function
.size OFForward_stret, .-OFForward_stret

.Linit:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$4, %esp

	call	.LgetEIP

Modified src/forwarding/forwarding-x86-win32.S from [5d1651a3b2] to [fa878f1d90].

16
17
18
19
20
21
22




23
24
25
26
27
28
29
#include "config.h"

.globl _OFForward
.globl _OFForward_stret

.section .text
_OFForward:




	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	movl	8(%ebp), %eax







>
>
>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "config.h"

.globl _OFForward
.globl _OFForward_stret

.section .text
_OFForward:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	movl	8(%ebp), %eax
77
78
79
80
81
82
83




84
85
86
87
88
89
90
	jmp	_OFMethodNotFound
.def _OFForward
.scl 2
.type 32
.endef

_OFForward_stret:




	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	movl	12(%ebp), %eax







>
>
>
>







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
	jmp	_OFMethodNotFound
.def _OFForward
.scl 2
.type 32
.endef

_OFForward_stret:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	movl	12(%ebp), %eax
138
139
140
141
142
143
144




145
146
147
148
149
150
151
	jmp	_OFMethodNotFound_stret
.def _OFForward_stret
.scl 2
.type 32
.endef

.Linit:




	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$4, %esp

	movl	$.Lmodule, %eax







>
>
>
>







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
	jmp	_OFMethodNotFound_stret
.def _OFForward_stret
.scl 2
.type 32
.endef

.Linit:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$4, %esp

	movl	$.Lmodule, %eax

Modified src/runtime/lookup-asm/lookup-asm-amd64-elf.S from [d99537b0fa] to [2b44a729f4].

21
22
23
24
25
26
27




28
29
30
31
32
33
34
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:




	testq	%rdi, %rdi
	jz	.LreturnNilMethod

	testb	$1, %dil
	jnz	.LtaggedPointer_\name

	movq	(%rdi), %r8







>
>
>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	testq	%rdi, %rdi
	jz	.LreturnNilMethod

	testb	$1, %dil
	jnz	.LtaggedPointer_\name

	movq	(%rdi), %r8
64
65
66
67
68
69
70




71
72
73
74
75
76
77
	jmp	.Lmain_\name
.type \name, %function
.size \name, .-\name
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:




	movq	%rdi, %r8
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	jz	.LreturnNilMethod

	movq	8(%r8), %r8
	movq	64(%r8), %r8







>
>
>
>







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
	jmp	.Lmain_\name
.type \name, %function
.size \name, .-\name
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	movq	%rdi, %r8
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	jz	.LreturnNilMethod

	movq	8(%r8), %r8
	movq	64(%r8), %r8

Modified src/runtime/lookup-asm/lookup-asm-amd64-macho.S from [77b3efe9ac] to [e88d4f78e5].

19
20
21
22
23
24
25




26
27
28
29
30
31
32
.globl _objc_msg_lookup_stret
.globl _objc_msg_lookup_super
.globl _objc_msg_lookup_super_stret

.section __TEXT, __text, regular, pure_instructions
.macro GENERATE_LOOKUP
$0:




	testq	%rdi, %rdi
	jz	LreturnNilMethod

	testb	$$1, %dil
	jnz	LtaggedPointer_$0

	movq	(%rdi), %r8







>
>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.globl _objc_msg_lookup_stret
.globl _objc_msg_lookup_super
.globl _objc_msg_lookup_super_stret

.section __TEXT, __text, regular, pure_instructions
.macro GENERATE_LOOKUP
$0:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	testq	%rdi, %rdi
	jz	LreturnNilMethod

	testb	$$1, %dil
	jnz	LtaggedPointer_$0

	movq	(%rdi), %r8
60
61
62
63
64
65
66




67
68
69
70
71
72
73
	movq	64(%r8), %r8

	jmp	Lmain_$0
.endmacro

.macro GENERATE_LOOKUP_SUPER
$0:




	movq	%rdi, %r8
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	jz	LreturnNilMethod

	movq	8(%r8), %r8
	movq	64(%r8), %r8







>
>
>
>







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
	movq	64(%r8), %r8

	jmp	Lmain_$0
.endmacro

.macro GENERATE_LOOKUP_SUPER
$0:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	movq	%rdi, %r8
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	jz	LreturnNilMethod

	movq	8(%r8), %r8
	movq	64(%r8), %r8

Modified src/runtime/lookup-asm/lookup-asm-amd64-win64.S from [c432b0ebda] to [94ccf0547a].

19
20
21
22
23
24
25




26
27
28
29
30
31
32
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:




	testq	%rcx, %rcx
	jz	.LreturnNilMethod

	testb	$1, %cl
	jnz	.LtaggedPointer_\name

	movq	(%rcx), %r8







>
>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	testq	%rcx, %rcx
	jz	.LreturnNilMethod

	testb	$1, %cl
	jnz	.LtaggedPointer_\name

	movq	(%rcx), %r8
71
72
73
74
75
76
77




78
79
80
81
82
83
84
.scl 2
.type 32
.endef
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:




	movq	%rcx, %r8
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	jz	.LreturnNilMethod

	movq	8(%r8), %r8
	movq	56(%r8), %r8







>
>
>
>







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.scl 2
.type 32
.endef
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:
#ifdef HAVE_ENDBR64
	endbr64
#endif

	movq	%rcx, %r8
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	jz	.LreturnNilMethod

	movq	8(%r8), %r8
	movq	56(%r8), %r8

Modified src/runtime/lookup-asm/lookup-asm-x86-elf.S from [875e7a8b79] to [8f444911c9].

21
22
23
24
25
26
27




28
29
30
31
32
33
34
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:




	movl	4(%esp), %edx
	testl	%edx, %edx
	jz	.LreturnNilMethod

	testb	$1, %dl
	jnz	.LtaggedPointer_\name








>
>
>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	movl	4(%esp), %edx
	testl	%edx, %edx
	jz	.LreturnNilMethod

	testb	$1, %dl
	jnz	.LtaggedPointer_\name

74
75
76
77
78
79
80




81
82
83
84
85
86
87
	jmp	.Lmain_\name
.type \name, %function
.size \name, .-\name
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:




	movl	4(%esp), %edx
	movl	(%edx), %eax
	testl	%eax, %eax
	jz	.LreturnNilMethod

	movl	%eax, 4(%esp)
	mov	4(%edx), %edx







>
>
>
>







78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
	jmp	.Lmain_\name
.type \name, %function
.size \name, .-\name
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	movl	4(%esp), %edx
	movl	(%edx), %eax
	testl	%eax, %eax
	jz	.LreturnNilMethod

	movl	%eax, 4(%esp)
	mov	4(%edx), %edx

Modified src/runtime/lookup-asm/lookup-asm-x86-win32.S from [f5268f2582] to [aee3f07f59].

19
20
21
22
23
24
25




26
27
28
29
30
31
32
.globl _objc_msg_lookup_stret
.globl _objc_msg_lookup_super
.globl _objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:




	movl	4(%esp), %edx
	testl	%edx, %edx
	jz	.LreturnNilMethod

	testb	$1, %dl
	jnz	.LtaggedPointer_\name








>
>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.globl _objc_msg_lookup_stret
.globl _objc_msg_lookup_super
.globl _objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	movl	4(%esp), %edx
	testl	%edx, %edx
	jz	.LreturnNilMethod

	testb	$1, %dl
	jnz	.LtaggedPointer_\name

63
64
65
66
67
68
69




70
71
72
73
74
75
76
.scl 2
.type 32
.endef
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:




	movl	4(%esp), %edx
	movl	(%edx), %eax
	test	%eax, %eax
	jz	.LreturnNilMethod

	movl	%eax, 4(%esp)
	movl	4(%edx), %edx







>
>
>
>







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.scl 2
.type 32
.endef
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:
#ifdef HAVE_ENDBR32
	endbr32
#endif

	movl	4(%esp), %edx
	movl	(%edx), %eax
	test	%eax, %eax
	jz	.LreturnNilMethod

	movl	%eax, 4(%esp)
	movl	4(%edx), %edx