ObjFW  Check-in [271bfb18b3]

Overview
Comment:forwarding: Clean up local labels.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 271bfb18b39eda9c3c89df7280df6ccaccf5bda501b801a32d5d3c72f320bda0
User & Date: js on 2014-01-15 19:04:43
Other Links: manifest | tags
Context
2014-01-15
19:06
PLATFORMS.md: More detailed forwarding platforms. check-in: 1293a9d5d7 user: js tags: trunk
19:04
forwarding: Clean up local labels. check-in: 271bfb18b3 user: js tags: trunk
18:53
lookup-asm: Clean up local labels. check-in: f4cf33fee6 user: js tags: trunk
Changes

Modified src/forwarding/apple-forwarding-arm.S from [cf318c894e] to [f361ff3b23].

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
84
85
86
87
88

89
90
91
92
93
94
95
96

97
98
99

100
101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118
119




120
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
84
85
86
87

88
89
90
91
92
93
94
95

96
97
98

99
100
101
102
103
104
105
106
107
108
109

110
111
112
113
114
115




116
117
118
119
120







-
+



-
-
+
+











-
+









-
+







-
+


-
+







-
+









-
+










-
+







-
+


-
+










-
+





-
-
-
-
+
+
+
+

 * file.
 */

.globl _of_forward
.globl _of_forward_stret

.section __TEXT, __objc_methname, cstring_literals
L_str_forwardingTargetForSelector_:
str_forwardingTargetForSelector_:
	.asciz "forwardingTargetForSelector:"

.section __DATA, __objc_selrefs, literal_pointers, no_dead_strip
L_sel_forwardingTargetForSelector_:
	.long L_str_forwardingTargetForSelector_
sel_forwardingTargetForSelector_:
	.long str_forwardingTargetForSelector_

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

.section __TEXT, __text, regular, pure_instructions
.arm
.align 2
_of_forward:
	stmfd	sp!, {r0-r4, lr}
	fstmfdd	sp!, {d0-d7}

	ldr	r4, L_sel_forwardingTargetForSelector_$indirect_L0
	ldr	r4, sel_forwardingTargetForSelector_$indirect_L0
L0:
	ldr	r4, [pc, r4]

	blx	_object_getClass

	mov	r1, r4
	blx	_class_respondsToSelector

	cmp	r0, #0
	beq	fail
	beq	0f

	ldr	r0, [sp, #64]
	mov	r1, r4
	ldr	r2, [sp, #68]
	blx	_objc_msgSend

	cmp	r0, #0
	beq	fail
	beq	0f
	ldr	r1, [sp, #64]
	cmp	r0, r1
	beq	fail
	beq	0f

	fldmfdd	sp!, {d0-d7}
	add	sp, sp, #4	@ throw away r0
	ldmfd	sp!, {r1-r4, lr}

	b	_objc_msgSend

fail:
0:
	fldmfdd	sp!, {d0-d7}
	ldmfd	sp!, {r0-r4, lr}
	b	_of_method_not_found

.align 2
_of_forward_stret:
	stmfd	sp!, {r0-r4, lr}
	fstmfdd	sp!, {d0-d7}

	ldr	r4, L_sel_forwardingTargetForSelector_$indirect_L1
	ldr	r4, sel_forwardingTargetForSelector_$indirect_L1
L1:
	ldr	r4, [pc, r4]

	mov	r0, r1
	blx	_object_getClass

	mov	r1, r4
	blx	_class_respondsToSelector

	cmp	r0, #0
	beq	fail_stret
	beq	0f

	ldr	r0, [sp, #68]
	mov	r1, r4
	ldr	r2, [sp, #72]
	blx	_objc_msgSend

	cmp	r0, #0
	beq	fail_stret
	beq	0f
	ldr	r1, [sp, #68]
	cmp	r0, r1
	beq	fail_stret
	beq	0f

	mov	r1, r0

	fldmfdd	sp!, {d0-d7}
	ldmfd	sp!, {r0}
	add	sp, sp, #4	@ throw away r1
	ldmfd	sp!, {r2-r4, lr}

	b	_objc_msgSend_stret

fail_stret:
0:
	fldmfdd	sp!, {d0-d7}
	ldmfd	sp!, {r0-r4, lr}
	b	_of_method_not_found_stret

.data_region
L_sel_forwardingTargetForSelector_$indirect_L0:
	.long L_sel_forwardingTargetForSelector_-(L0+8)
L_sel_forwardingTargetForSelector_$indirect_L1:
	.long L_sel_forwardingTargetForSelector_-(L1+8)
sel_forwardingTargetForSelector_$indirect_L0:
	.long sel_forwardingTargetForSelector_-(L0+8)
sel_forwardingTargetForSelector_$indirect_L1:
	.long sel_forwardingTargetForSelector_-(L1+8)
.end_data_region

Modified src/forwarding/apple-forwarding-arm64.S from [a6501f118e] to [d1e540726b].

14
15
16
17
18
19
20
21

22
23
24
25
26


27
28
29
30
31
32
33
14
15
16
17
18
19
20

21
22
23
24


25
26
27
28
29
30
31
32
33







-
+



-
-
+
+







 * file.
 */

.globl _of_forward
.globl _of_forward_stret

.section __TEXT, __objc_methname, cstring_literals
L_str_forwardingTargetForSelector_:
str_forwardingTargetForSelector_:
	.asciz "forwardingTargetForSelector:"

.section __DATA, __objc_selrefs, literal_pointers, no_dead_strip
L_sel_forwardingTargetForSelector_:
	.quad L_str_forwardingTargetForSelector_
sel_forwardingTargetForSelector_:
	.quad str_forwardingTargetForSelector_

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

.section __TEXT, __text, regular, pure_instructions
_of_forward:
_of_forward_stret:
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
84
85
86
87
88
89

90
91
92
93
94
95
96
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
84
85
86
87
88

89
90
91
92
93
94
95
96







-
-
+
+





-
+





-
+


-
+



















-
+







	stp	q0, q1, [sp, #80]
	stp	q2, q3, [sp, #112]
	stp	q4, q5, [sp, #144]
	stp	q6, q7, [sp, #176]

	bl	_object_getClass

	adrp	x19, L_sel_forwardingTargetForSelector_@PAGE
	add	x19, x19, L_sel_forwardingTargetForSelector_@PAGEOFF
	adrp	x19, sel_forwardingTargetForSelector_@PAGE
	add	x19, x19, sel_forwardingTargetForSelector_@PAGEOFF
	ldr	x19, [x19]

	mov	x1, x19
	bl	_class_respondsToSelector

	cbz	x0, fail
	cbz	x0, 0f

	ldp	x0, x2, [sp]
	mov	x1, x19
	bl	_objc_msgSend

	cbz	x0, fail
	cbz	x0, 0f
	ldr	x1, [sp]
	cmp	x0, x1
	b.eq	fail
	b.eq	0f

	/* Restore all arguments, x8 and x19, but not x0 */
	ldr	x1, [sp, #8]
	ldp	x2, x3, [sp, #16]
	ldp	x4, x5, [sp, #32]
	ldp	x6, x7, [sp, #48]
	ldp	x8, x19, [sp, #64]

	/* Restore all foating point arguments */
	ldp	q0, q1, [sp, #80]
	ldp	q2, q3, [sp, #112]
	ldp	q4, q5, [sp, #144]
	ldp	q6, q7, [sp, #176]

	mov	sp, fp
	ldp	fp, lr, [sp], #208

	b	_objc_msgSend

fail:
0:
	ldp	x0, x1, [sp]
	ldr	x19, [sp, #72]

	mov	sp, fp
	ldp	fp, lr, [sp], #208

	b	_of_method_not_found

Modified src/forwarding/apple-forwarding-i386.S from [a53cc8a86c] to [70855fc5db].

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
84
85
86
87
88
89
90

91
92
93
94
95
96
97

98
99
100
101
102

103
104
105
106

107
108
109
110
111
112
113

114
115

116
117
118
119
120
121
122
123
124
125

126
127
128
129
130
131
132
133
134
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
84
85
86
87
88
89

90
91
92
93
94
95
96

97
98
99
100
101

102
103
104
105

106
107
108
109
110
111
112

113
114

115
116
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132
133
134







-
+



-
-
+
+













-
+






-
+




-
+



-
+






-
+

-
+









-
+














-
+






-
+




-
+



-
+






-
+

-
+









-
+









 * file.
 */

.globl _of_forward
.globl _of_forward_stret

.section __TEXT, __cstring, cstring_literals
L_str_forwardingTargetForSelector_:
str_forwardingTargetForSelector_:
	.asciz "forwardingTargetForSelector:"

.section __OBJC, __message_refs, literal_pointers, no_dead_strip
L_sel_forwardingTargetForSelector_:
	.long L_str_forwardingTargetForSelector_
sel_forwardingTargetForSelector_:
	.long str_forwardingTargetForSelector_

.section __OBJC, __image_info
	.long 0, 0

.section __TEXT, __text, regular, pure_instructions
_of_forward:
	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	get_eip
.L0:
0:

	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	call	_object_getClass

	movl	%eax, (%esp)
	movl	L_sel_forwardingTargetForSelector_-.L0(%ebx), %eax
	movl	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	call	_class_respondsToSelector

	testl	%eax, %eax
	jz	fail
	jz	0f

	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	movl	L_sel_forwardingTargetForSelector_-.L0(%ebx), %eax
	movl	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	movl	12(%ebp), %eax
	movl	%eax, 8(%esp)
	call	_objc_msgSend

	testl	%eax, %eax
	jz	fail
	jz	0f
	cmpl	8(%ebp), %eax
	je	fail
	je	0f

	movl	%eax, 8(%ebp)

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	_objc_msgSend

fail:
0:
	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	_of_method_not_found

_of_forward_stret:
	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	get_eip
.L1:
0:

	movl	12(%ebp), %eax
	movl	%eax, (%esp)
	call	_object_getClass

	movl	%eax, (%esp)
	movl	L_sel_forwardingTargetForSelector_-.L1(%ebx), %eax
	movl	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	call	_class_respondsToSelector

	testl	%eax, %eax
	jz	fail_stret
	jz	0f

	movl	12(%ebp), %eax
	movl	%eax, (%esp)
	movl	L_sel_forwardingTargetForSelector_-.L1(%ebx), %eax
	movl	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	movl	16(%ebp), %eax
	movl	%eax, 8(%esp)
	call	_objc_msgSend

	testl	%eax, %eax
	jz	fail_stret
	jz	0f
	cmpl	12(%ebp), %eax
	je	fail_stret
	je	0f

	movl	%eax, 12(%ebp)

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	_objc_msgSend_stret

fail_stret:
0:
	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	_of_method_not_found_stret

get_eip:
	movl	(%esp), %ebx
	ret

Modified src/forwarding/apple-forwarding-ppc.S from [4e35ca1579] to [98b4edd567].

14
15
16
17
18
19
20
21

22
23
24
25
26


27
28
29
30
31
32
33
14
15
16
17
18
19
20

21
22
23
24


25
26
27
28
29
30
31
32
33







-
+



-
-
+
+







 * file.
 */

.globl _of_forward
.globl _of_forward_stret

.section __TEXT, __cstring, cstring_literals
L_str_forwardingTargetForSelector_:
str_forwardingTargetForSelector_:
	.asciz "forwardingTargetForSelector:"

.section __OBJC, __message_refs, literal_pointers, no_dead_strip
L_sel_forwardingTargetForSelector_:
	.long L_str_forwardingTargetForSelector_
sel_forwardingTargetForSelector_:
	.long str_forwardingTargetForSelector_

.section __OBJC, __image_info
	.long 0, 0

.section __TEXT, __text, regular, pure_instructions
_of_forward:
	mflr	r0
63
64
65
66
67
68
69
70
71


72
73
74


75
76
77
78
79
80

81
82
83
84
85
86
87
88

89
90
91

92
93
94
95
96
97
98
63
64
65
66
67
68
69


70
71
72


73
74
75
76
77
78
79

80
81
82
83
84
85
86
87

88
89
90

91
92
93
94
95
96
97
98







-
-
+
+

-
-
+
+





-
+







-
+


-
+







	stfd	f10, 160(r1)
	stfd	f11, 168(r1)
	stfd	f12, 176(r1)
	stfd	f13, 184(r1)

	bl	_object_getClass

	bl	L0
L0:
	bl	0f
0:
	mflr	r13
	addis	r13, r13, ha16(L_sel_forwardingTargetForSelector_-L0)
	lwz	r13, lo16(L_sel_forwardingTargetForSelector_-L0)(r13)
	addis	r13, r13, ha16(sel_forwardingTargetForSelector_-0b)
	lwz	r13, lo16(sel_forwardingTargetForSelector_-0b)(r13)

	mr	r4, r13
	bl	_class_respondsToSelector

	cmpwi	r3, 0
	beq-	fail
	beq-	0f

	lwz	r3, 216(r1)
	mr	r4, r13
	lwz	r5, 220(r1)
	bl	_objc_msgSend

	cmpwi	r3, 0
	beq-	fail
	beq-	0f
	lwz	r4, 216(r1)
	cmpw	r3, r4
	beq-	fail
	beq-	0f

	/* Restore all arguments and r13, except r3 */
	lwz	r4, 220(r1)
	lwz	r5, 56(r1)
	lwz	r6, 60(r1)
	lwz	r7, 64(r1)
	lwz	r8, 68(r1)
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
117
118
119
120
121
122
123

124
125
126
127
128
129
130
131







-
+








	addi	r1, r1, 192
	lwz	r0, 8(r1)
	mtlr	r0

	b	_objc_msgSend

fail:
0:
	lwz	r3, 216(r1)
	lwz	r4, 220(r1)

	addi	r1, r1, 192
	lwz	r0, 8(r1)
	mtlr	r0

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
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







-
+
-
+

-
-
+
+





-
+







-
+


-
+







	stfd	f11, 160(r1)
	stfd	f12, 168(r1)
	stfd	f13, 176(r1)

	mr	r3, r4
	bl	_object_getClass

	bl	L1
	bl	0f
L1:
0:
	mflr	r13
	addis	r13, r13, ha16(L_sel_forwardingTargetForSelector_-L1)
	lwz	r13, lo16(L_sel_forwardingTargetForSelector_-L1)(r13)
	addis	r13, r13, ha16(sel_forwardingTargetForSelector_-0b)
	lwz	r13, lo16(sel_forwardingTargetForSelector_-0b)(r13)

	mr	r4, r13
	bl	_class_respondsToSelector

	cmpwi	r3, 0
	beq-	fail_stret
	beq-	0f

	lwz	r3, 212(r1)
	mr	r4, r13
	lwz	r5, 216(r1)
	bl	_objc_msgSend

	cmpwi	r3, 0
	beq-	fail_stret
	beq-	0f
	lwz	r4, 212(r1)
	cmpw	r3, r4
	beq-	fail_stret
	beq-	0f

	mr	r4, r3

	/* Restore all arguments and r13, except r4 */
	lwz	r3, 208(r1)
	lwz	r5, 216(r1)
	lwz	r6, 56(r1)
222
223
224
225
226
227
228
229

230
231
232
233
234
235
236
237
238
222
223
224
225
226
227
228

229
230
231
232
233
234
235
236
237
238







-
+










	addi	r1, r1, 184
	lwz	r0, 8(r1)
	mtlr	r0

	b	_objc_msgSend_stret

fail_stret:
0:
	lwz	r3, 208(r1)
	lwz	r4, 212(r1)
	lwz	r5, 216(r1)

	addi	r1, r1, 184
	lwz	r0, 8(r1)
	mtlr	r0

	b	_of_method_not_found_stret

Modified src/forwarding/apple-forwarding-x86_64.S from [69dabd9c4d] to [7dd4375ec7].

14
15
16
17
18
19
20
21

22
23
24
25
26


27
28
29
30
31
32
33
14
15
16
17
18
19
20

21
22
23
24


25
26
27
28
29
30
31
32
33







-
+



-
-
+
+







 * file.
 */

.globl _of_forward
.globl _of_forward_stret

.section __TEXT, __objc_methname, cstring_literals
L_str_forwardingTargetForSelector_:
str_forwardingTargetForSelector_:
	.asciz "forwardingTargetForSelector:"

.section __DATA, __objc_selrefs, literal_pointers, no_dead_strip
L_sel_forwardingTargetForSelector_:
	.quad L_str_forwardingTargetForSelector_
sel_forwardingTargetForSelector_:
	.quad str_forwardingTargetForSelector_

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

.section __TEXT, __text, regular, pure_instructions
_of_forward:
	pushq	%rbp
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
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







-
+



-
+


-
+




-
+

-
+







	movdqa	%xmm5, -0xA0(%rbp)
	movdqa	%xmm6, -0xB0(%rbp)
	movdqa	%xmm7, -0xC0(%rbp)

	call	_object_getClass

	movq	%rax, %rdi
	movq	L_sel_forwardingTargetForSelector_(%rip), %rsi
	movq	sel_forwardingTargetForSelector_(%rip), %rsi
	call	_class_respondsToSelector

	testq	%rax, %rax
	jz	fail
	jz	0f

	movq	-0x10(%rbp), %rdi
	movq	L_sel_forwardingTargetForSelector_(%rip), %rsi
	movq	sel_forwardingTargetForSelector_(%rip), %rsi
	movq	-0x18(%rbp), %rdx
	call	_objc_msgSend

	testq	%rax, %rax
	jz	fail
	jz	0f
	cmpq	-0x10(%rbp), %rax
	je	fail
	je	0f

	movq	%rax, %rdi

	/* Restore all arguments, except %rdi */
	movdqa	-0xC0(%rbp), %xmm7
	movdqa	-0xB0(%rbp), %xmm6
	movdqa	-0xA0(%rbp), %xmm5
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
89
90
91
92
93
94
95

96
97
98
99
100
101
102
103







-
+







	movq	-0x8(%rbp), %rax

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_objc_msgSend

fail:
0:
	movq	-0x10(%rbp), %rdi
	movq	-0x18(%rbp), %rsi

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_of_method_not_found
124
125
126
127
128
129
130
131

132
133
134

135
136
137

138
139
140
141
142

143
144

145
146
147
148
149
150
151
124
125
126
127
128
129
130

131
132
133

134
135
136

137
138
139
140
141

142
143

144
145
146
147
148
149
150
151







-
+


-
+


-
+




-
+

-
+







	movdqa	%xmm6, -0xB0(%rbp)
	movdqa	%xmm7, -0xC0(%rbp)

	movq	%rsi, %rdi
	call	_object_getClass

	movq	%rax, %rdi
	movq	L_sel_forwardingTargetForSelector_(%rip), %rsi
	movq	sel_forwardingTargetForSelector_(%rip), %rsi
	call	_class_respondsToSelector
	testq	%rax, %rax
	jz	fail_stret
	jz	0f

	movq	-0x18(%rbp), %rdi
	movq	L_sel_forwardingTargetForSelector_(%rip), %rsi
	movq	sel_forwardingTargetForSelector_(%rip), %rsi
	movq	-0x20(%rbp), %rdx
	call	_objc_msgSend

	testq	%rax, %rax
	jz	fail_stret
	jz	0f
	cmpq	-0x18(%rbp), %rax
	je	fail_stret
	je	0f

	movq	%rax, %rsi

	/* Restore all arguments, except %rsi */
	movdqa	-0xC0(%rbp), %xmm7
	movdqa	-0xB0(%rbp), %xmm6
	movdqa	-0xA0(%rbp), %xmm5
162
163
164
165
166
167
168
169

170
171
172
173
174
175
176
177
162
163
164
165
166
167
168

169
170
171
172
173
174
175
176
177







-
+








	movq	-0x8(%rbp), %rax

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_objc_msgSend_stret

fail_stret:
0:
	movq	-0x10(%rbp), %rdi
	movq	-0x18(%rbp), %rsi
	movq	-0x20(%rbp), %rdx

	movq	%rbp, %rsp
	popq	%rbp

	jmp	_of_method_not_found_stret

Modified src/forwarding/forwarding-amd64-elf.S from [740378abfd] to [7cc00abdac].

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
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







-
+











-
+

-
+







	call	object_getClass@PLT

	movq	%rax, %rdi
	leaq	sel_forwardingTargetForSelector_(%rip), %rsi
	call	class_respondsToSelector@PLT

	testq	%rax, %rax
	jz	fail
	jz	0f

	movq	-0x10(%rbp), %rdi
	leaq	sel_forwardingTargetForSelector_(%rip), %rsi
	call	objc_msg_lookup@PLT

	movq	-0x10(%rbp), %rdi
	leaq	sel_forwardingTargetForSelector_(%rip), %rsi
	movq	-0x18(%rbp), %rdx
	call	*%rax

	testq	%rax, %rax
	jz	fail
	jz	0f
	cmpq	-0x10(%rbp), %rax
	je	fail
	je	0f

	movq	%rax, -0x10(%rbp)

	movq	%rax, %rdi
	movq	-0x18(%rbp), %rsi
	call	objc_msg_lookup@PLT
	movq	%rax, %r11
88
89
90
91
92
93
94
95

96
97
98
99
100
101
102
88
89
90
91
92
93
94

95
96
97
98
99
100
101
102







-
+







	movq	-0x8(%rbp), %rax

	movq	%rbp, %rsp
	popq	%rbp

	jmpq     *%r11

fail:
0:
	movq	-0x10(%rbp), %rdi
	movq	-0x18(%rbp), %rsi

	movq	%rbp, %rsp
	popq	%rbp

	jmp	of_method_not_found@PLT
129
130
131
132
133
134
135
136

137
138
139
140
141
142
143
144
145
146
147
148

149
150

151
152
153
154
155
156
157
129
130
131
132
133
134
135

136
137
138
139
140
141
142
143
144
145
146
147

148
149

150
151
152
153
154
155
156
157







-
+











-
+

-
+







	call	object_getClass@PLT

	movq	%rax, %rdi
	leaq	sel_forwardingTargetForSelector_(%rip), %rsi
	call	class_respondsToSelector@PLT

	testq	%rax, %rax
	jz	fail_stret
	jz	0f

	movq	-0x18(%rbp), %rdi
	leaq	sel_forwardingTargetForSelector_(%rip), %rsi
	call	objc_msg_lookup@PLT

	movq	-0x18(%rbp), %rdi
	leaq	sel_forwardingTargetForSelector_(%rip), %rsi
	movq	-0x20(%rbp), %rdx
	call	*%rax

	testq	%rax, %rax
	jz	fail_stret
	jz	0f
	cmpq	-0x18(%rbp), %rax
	je	fail_stret
	je	0f

	movq	%rax, -0x18(%rbp)

	movq	%rax, %rdi
	movq	-0x20(%rbp), %rsi
	call	objc_msg_lookup_stret@PLT
	movq	%rax, %r11
174
175
176
177
178
179
180
181

182
183
184
185
186
187
188
174
175
176
177
178
179
180

181
182
183
184
185
186
187
188







-
+







	movq	-0x8(%rbp), %rax

	movq	%rbp, %rsp
	popq	%rbp

	jmpq     *%r11

fail_stret:
0:
	movq	-0x10(%rbp), %rdi
	movq	-0x18(%rbp), %rsi
	movq	-0x20(%rbp), %rdx

	movq	%rbp, %rsp
	popq	%rbp

Modified src/forwarding/forwarding-arm-elf.S from [9a8cfc8350] to [fd312e20f1].

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
84
85

86
87
88
89
90
91
92
93
94
95
96
97
98

99
100
101

102
103
104
105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121

122
123
124
125
126

127
128

129
130

131
132
133
134
135
136
137
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
84

85
86
87
88
89
90
91
92
93
94
95
96
97

98
99
100

101
102
103
104
105
106
107
108
109
110
111
112

113
114
115
116
117
118
119
120

121
122
123
124
125

126
127

128
129

130
131
132
133
134
135
136
137







-
+









-
+












-
+


-
+











-
+










-
+










-
+












-
+


-
+











-
+







-
+




-
+

-
+

-
+







.globl of_forward_stret

.section .text
of_forward:
	stmfd	sp!, {r0-r4, lr}
	fstmfdd	sp!, {d0-d7}

	ldr	r4, sel_forwardingTargetForSelector_$indirect_L0
	ldr	r4, sel_forwardingTargetForSelector_$indirect_.L0
.L0:
	add	r4, pc

	bl	object_getClass(PLT)

	mov	r1, r4
	bl	class_respondsToSelector(PLT)

	cmp	r0, #0
	beq	fail
	beq	0f

	ldr	r0, [sp, #64]
	mov	r1, r4
	bl	objc_msg_lookup(PLT)

	mov	r12, r0
	ldr	r0, [sp, #64]
	mov	r1, r4
	ldr	r2, [sp, #68]
	blx	r12

	cmp	r0, #0
	beq	fail
	beq	0f
	ldr	r1, [sp, #64]
	cmp	r0, r1
	beq	fail
	beq	0f

	str	r0, [sp, #64]
	ldr	r1, [sp, #68]
	bl	objc_msg_lookup(PLT)

	mov	r12, r0
	fldmfdd	sp!, {d0-d7}
	ldmfd	sp!, {r0-r4, lr}

	bx	r12

fail:
0:
	fldmfdd	sp!, {d0-d7}
	ldmfd	sp!, {r0-r4, lr}
	b	of_method_not_found(PLT)
.type of_forward, %function
.size of_forward, .-of_forward

of_forward_stret:
	stmfd	sp!, {r0-r4, lr}
	fstmfdd	sp!, {d0-d7}

	ldr	r4, sel_forwardingTargetForSelector_$indirect_L1
	ldr	r4, sel_forwardingTargetForSelector_$indirect_.L1
.L1:
	add	r4, pc

	mov	r0, r1
	bl	object_getClass(PLT)

	mov	r1, r4
	bl	class_respondsToSelector(PLT)

	cmp	r0, #0
	beq	fail_stret
	beq	0f

	ldr	r0, [sp, #68]
	mov	r1, r4
	bl	objc_msg_lookup(PLT)

	mov	r12, r0
	ldr	r0, [sp, #68]
	mov	r1, r4
	ldr	r2, [sp, #72]
	blx	r12

	cmp	r0, #0
	beq	fail_stret
	beq	0f
	ldr	r1, [sp, #68]
	cmp	r0, r1
	beq	fail_stret
	beq	0f

	str	r0, [sp, #68]
	ldr	r1, [sp, #72]
	bl	objc_msg_lookup_stret(PLT)

	mov	r12, r0
	fldmfdd	sp!, {d0-d7}
	ldmfd	sp!, {r0-r4, lr}

	bx	r12

fail_stret:
0:
	fldmfdd	sp!, {d0-d7}
	ldmfd	sp!, {r0-r4, lr}
	b	of_method_not_found_stret(PLT)
.type of_forward_stret, %function
.size of_forward_stret, .-of_forward_stret

init:
	ldr	r0, module_indirect_L2
	ldr	r0, module$indirect_.L2
.L2:
	add	r0, pc
	b	__objc_exec_class(PLT)

sel_forwardingTargetForSelector_$indirect_L0:
sel_forwardingTargetForSelector_$indirect_.L0:
	.long sel_forwardingTargetForSelector_-(.L0+8)
sel_forwardingTargetForSelector_$indirect_L1:
sel_forwardingTargetForSelector_$indirect_.L1:
	.long sel_forwardingTargetForSelector_-(.L1+8)
module_indirect_L2:
module$indirect_.L2:
	.long module-(.L2+8)

.section .ctors, "aw", %progbits
	.long init

.section .rodata
str_forwardingTargetForSelector_:

Modified src/forwarding/forwarding-mips-elf.S from [c170131eff] to [ae68d9f6ad].

87
88
89
90
91
92
93
94

95
96
97
98
99
100
101
102
103
104
105
106
107
108

109
110

111
112
113
114
115
116
117
87
88
89
90
91
92
93

94
95
96
97
98
99
100
101
102
103
104
105
106
107

108
109

110
111
112
113
114
115
116
117







-
+













-
+

-
+








	jal_pic	object_getClass

	move	$gp, $s0
	move	$a0, $v0
	move	$a1, $s1
	jal_pic	class_respondsToSelector
	beqz	$v0, fail
	beqz	$v0, 0f

	move	$gp, $s0
	lw	$a0, 28($sp)
	move	$a1, $s1
	jal_pic	objc_msg_lookup

	move	$gp, $s0
	lw	$a0, 28($sp)
	move	$a1, $s1
	lw	$a2, 32($sp)
	move	$t9, $v0
	jalr	$t9

	beqz	$v0, fail
	beqz	$v0, 0f
	lw	$t0, 28($sp)
	beq	$v0, $t0, fail
	beq	$v0, $t0, 0f

	sw	$v0, 28($sp)

	move	$gp, $s0
	move	$a0, $v0
	lw	$a1, 32($sp)
	jal_pic	objc_msg_lookup
141
142
143
144
145
146
147
148

149
150
151
152
153
154
155
141
142
143
144
145
146
147

148
149
150
151
152
153
154
155







-
+







	lw	$ra, 16($sp)

	addiu	$sp, $sp, 96

	move	$t9, $v0
	jr	$t9

fail:
0:
	move	$gp, $s0

	lw	$a1, 32($sp)
	lw	$a0, 28($sp)
	lw	$s1, 24($sp)
	lw	$s0, 20($sp)
	lw	$ra, 16($sp)
212
213
214
215
216
217
218
219

220
221
222
223
224
225
226
227
228
229
230
231
232
233

234
235

236
237
238
239
240
241
242
212
213
214
215
216
217
218

219
220
221
222
223
224
225
226
227
228
229
230
231
232

233
234

235
236
237
238
239
240
241
242







-
+













-
+

-
+







	move	$a0, $a1
	jal_pic	object_getClass

	move	$gp, $s0
	move	$a0, $v0
	move	$a1, $s1
	jal_pic	class_respondsToSelector
	beqz	$v0, fail_stret
	beqz	$v0, 0f

	move	$gp, $s0
	lw	$a0, 32($sp)
	move	$a1, $s1
	jal_pic	objc_msg_lookup

	move	$gp, $s0
	lw	$a0, 32($sp)
	move	$a1, $s1
	lw	$a2, 36($sp)
	move	$t9, $v0
	jalr	$t9

	beqz	$v0, fail_stret
	beqz	$v0, 0f
	lw	$t0, 32($sp)
	beq	$v0, $t0, fail_stret
	beq	$v0, $t0, 0f

	sw	$v0, 32($sp)

	move	$gp, $s0
	move	$a0, $v0
	lw	$a1, 36($sp)
	jal_pic	objc_msg_lookup_stret
266
267
268
269
270
271
272
273

274
275
276
277
278
279
280
266
267
268
269
270
271
272

273
274
275
276
277
278
279
280







-
+







	lw	$ra, 16($sp)

	addiu	$sp, $sp, 96

	move	$t9, $v0
	jr	$t9

fail_stret:
0:
	move	$gp, $s0

	lw	$a2, 36($sp)
	lw	$a1, 32($sp)
	lw	$a0, 28($sp)
	lw	$s1, 24($sp)
	lw	$s0, 20($sp)

Modified src/forwarding/forwarding-ppc-elf.S from [97cc5dcf63] to [ed223d4d17].

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
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







-
+














-
+


-
+







	bl	object_getClass@plt

	lis	%r4, sel_forwardingTargetForSelector_@ha
	la	%r4, sel_forwardingTargetForSelector_@l(%r4)
	bl	class_respondsToSelector@plt

	cmpwi	%r3, 0
	beq-	fail
	beq-	0f

	lwz	%r3, 8(%r1)
	lis	%r4, sel_forwardingTargetForSelector_@ha
	la	%r4, sel_forwardingTargetForSelector_@l(%r4)
	bl	objc_msg_lookup@plt
	mtctr	%r3

	lwz	%r3, 8(%r1)
	lis	%r4, sel_forwardingTargetForSelector_@ha
	la	%r4, sel_forwardingTargetForSelector_@l(%r4)
	lwz	%r5, 12(%r1)
	bctrl

	cmpwi	%r3, 0
	beq-	fail
	beq-	0f
	lwz	%r4, 8(%r1)
	cmpw	%r3, %r4
	beq-	fail
	beq-	0f

	stw	%r3, 8(%r1)

	lwz	%r4, 12(%r1)
	bl	objc_msg_lookup@plt
	mtctr	%r3

97
98
99
100
101
102
103
104

105
106
107
108
109
110
111
97
98
99
100
101
102
103

104
105
106
107
108
109
110
111







-
+







	lfd	%f8, 96(%r1)

	lwz	%r0, 116(%r1)
	mtlr	%r0
	addi	%r1, %r1, 112
	bctr

fail:
0:
	lwz	%r3, 8(%r1)
	lwz	%r4, 12(%r1)

	lwz	%r0, 116(%r1)
	mtlr	%r0
	addi	%r1, %r1, 112

142
143
144
145
146
147
148
149

150
151
152
153
154
155
156
157
158
159
160
161
162
163
164

165
166
167

168
169
170
171
172
173
174
142
143
144
145
146
147
148

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163

164
165
166

167
168
169
170
171
172
173
174







-
+














-
+


-
+







	bl	object_getClass@plt

	lis	%r4, sel_forwardingTargetForSelector_@ha
	la	%r4, sel_forwardingTargetForSelector_@l(%r4)
	bl	class_respondsToSelector@plt

	cmpwi	%r3, 0
	beq-	fail_stret
	beq-	0f

	lwz	%r3, 12(%r1)
	lis	%r4, sel_forwardingTargetForSelector_@ha
	la	%r4, sel_forwardingTargetForSelector_@l(%r4)
	bl	objc_msg_lookup@plt
	mtctr	%r3

	lwz	%r3, 12(%r1)
	lis	%r4, sel_forwardingTargetForSelector_@ha
	la	%r4, sel_forwardingTargetForSelector_@l(%r4)
	lwz	%r5, 16(%r1)
	bctrl

	cmpwi	%r3, 0
	beq-	fail_stret
	beq-	0f
	lwz	%r4, 12(%r1)
	cmpw	%r3, %r4
	beq-	fail_stret
	beq-	0f

	stw	%r3, 12(%r1)

	lwz	%r4, 16(%r1)
	bl	objc_msg_lookup_stret@plt
	mtctr	%r3

193
194
195
196
197
198
199
200

201
202
203
204
205
206
207
193
194
195
196
197
198
199

200
201
202
203
204
205
206
207







-
+







	lfd	%f8, 96(%r1)

	lwz	%r0, 116(%r1)
	mtlr	%r0
	addi	%r1, %r1, 112
	bctr

fail_stret:
0:
	lwz	%r3, 8(%r1)
	lwz	%r4, 12(%r1)
	lwz	%r5, 16(%r1)

	lwz	%r0, 116(%r1)
	mtlr	%r0
	addi	%r1, %r1, 112

Modified src/forwarding/forwarding-x86-elf.S from [1b29e27ce4] to [330f54d44c].

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
84
85
86
87
88
89
90
91
92
93
94
95
96
97

98
99
100
101

102
103
104
105

106
107

108
109
110
111

112
113
114
115

116
117

118
119
120
121
122

123
124
125
126
127
128
129

130
131

132
133
134
135
136
137

138
139
140
141
142
143
144
145
146
147


148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166


167
168

169
170
171
172
173
174
175
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
84
85
86
87
88
89
90
91
92
93
94
95
96

97
98
99
100

101
102
103
104

105
106

107
108
109
110

111
112
113
114

115
116

117
118
119
120
121

122
123
124
125
126
127
128

129
130

131
132
133
134
135
136

137
138
139
140
141
142
143
144
145


146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164


165
166
167

168
169
170
171
172
173
174
175







-
+



-
+



-
+

-
+



-
+



-
+

-
+




-
+






-
+

-
+





-
+








-
-
+
+

















-
+



-
+



-
+

-
+



-
+



-
+

-
+




-
+






-
+

-
+





-
+








-
-
+
+

















-
-
+
+

-
+







	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	get_eip
.L0:
0:

	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	leal	object_getClass-.L0(%ebx), %eax
	leal	object_getClass-0b(%ebx), %eax
	call	*%eax

	movl	%eax, (%esp)
	leal	sel_forwardingTargetForSelector_-.L0(%ebx), %eax
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	leal	class_respondsToSelector-.L0(%ebx), %eax
	leal	class_respondsToSelector-0b(%ebx), %eax
	call	*%eax

	testl	%eax, %eax
	jz	fail
	jz	1f

	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	leal	sel_forwardingTargetForSelector_-.L0(%ebx), %eax
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	leal	objc_msg_lookup-.L0(%ebx), %eax
	leal	objc_msg_lookup-0b(%ebx), %eax
	call	*%eax

	movl	8(%ebp), %edx
	movl	%edx, (%esp)
	leal	sel_forwardingTargetForSelector_-.L0(%ebx), %edx
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %edx
	movl	%edx, 4(%esp)
	movl	12(%ebp), %edx
	movl	%edx, 8(%esp)
	call	*%eax

	testl	%eax, %eax
	jz	fail
	jz	1f
	cmpl	8(%ebp), %eax
	je	fail
	je	1f

	movl	%eax, 8(%ebp)
	movl	%eax, (%esp)
	movl	12(%ebp), %eax
	movl	%eax, 4(%esp)
	leal	objc_msg_lookup-.L0(%ebx), %eax
	leal	objc_msg_lookup-0b(%ebx), %eax
	call	*%eax

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	*%eax

fail:
	leal	of_method_not_found-.L0(%ebx), %eax
1:
	leal	of_method_not_found-0b(%ebx), %eax

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

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

of_forward_stret:
	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	get_eip
.L1:
0:

	movl	12(%ebp), %eax
	movl	%eax, (%esp)
	leal	object_getClass-.L1(%ebx), %eax
	leal	object_getClass-0b(%ebx), %eax
	call	*%eax

	movl	%eax, (%esp)
	leal	sel_forwardingTargetForSelector_-.L1(%ebx), %eax
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	leal	class_respondsToSelector-.L1(%ebx), %eax
	leal	class_respondsToSelector-0b(%ebx), %eax
	call	*%eax

	testl	%eax, %eax
	jz	fail_stret
	jz	1f

	movl	12(%ebp), %eax
	movl	%eax, (%esp)
	leal	sel_forwardingTargetForSelector_-.L1(%ebx), %eax
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	leal	objc_msg_lookup-.L1(%ebx), %eax
	leal	objc_msg_lookup-0b(%ebx), %eax
	call	*%eax

	movl	12(%ebp), %edx
	movl	%edx, (%esp)
	leal	sel_forwardingTargetForSelector_-.L1(%ebx), %edx
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %edx
	movl	%edx, 4(%esp)
	movl	16(%ebp), %edx
	movl	%edx, 8(%esp)
	call	*%eax

	testl	%eax, %eax
	jz	fail_stret
	jz	1f
	cmpl	12(%ebp), %eax
	je	fail_stret
	je	1f

	movl	%eax, 12(%ebp)
	movl	%eax, (%esp)
	movl	16(%ebp), %eax
	movl	%eax, 4(%esp)
	leal	objc_msg_lookup_stret-.L1(%ebx), %eax
	leal	objc_msg_lookup_stret-0b(%ebx), %eax
	call	*%eax

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	*%eax

fail_stret:
	leal	of_method_not_found_stret-.L1(%ebx), %eax
1:
	leal	of_method_not_found_stret-0b(%ebx), %eax

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

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

init:
	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$4, %esp

	call	get_eip
.L2:
	leal	module-.L2(%ebx), %eax
0:
	leal	module-0b(%ebx), %eax
	movl	%eax, (%esp)
	leal	__objc_exec_class-.L2(%ebx), %eax
	leal	__objc_exec_class-0b(%ebx), %eax
	call	*%eax

	addl	$4, %esp
	popl	%ebx
	popl	%ebp
	ret

Modified src/forwarding/forwarding-x86-win32.S from [f1c1087573] to [a85a18d2f1].

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
84
85
86
87
88
89
90
91
92
93
94
95

96
97
98
99

100
101
102
103

104
105

106
107
108
109

110
111
112
113

114
115

116
117
118
119
120

121
122
123
124
125
126
127

128
129

130
131
132
133
134
135

136
137
138
139
140
141
142
143
144
145


146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162


163
164

165
166
167
168
169
170
171
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
84
85
86
87
88
89
90
91
92
93
94

95
96
97
98

99
100
101
102

103
104

105
106
107
108

109
110
111
112

113
114

115
116
117
118
119

120
121
122
123
124
125
126

127
128

129
130
131
132
133
134

135
136
137
138
139
140
141
142
143


144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160


161
162
163

164
165
166
167
168
169
170
171







-
+



-
+



-
+

-
+



-
+



-
+

-
+




-
+






-
+

-
+





-
+








-
-
+
+















-
+



-
+



-
+

-
+



-
+



-
+

-
+




-
+






-
+

-
+





-
+








-
-
+
+















-
-
+
+

-
+







	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	get_eip
.L0:
0:

	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	leal	_object_getClass-.L0(%ebx), %eax
	leal	_object_getClass-0b(%ebx), %eax
	call	*%eax

	movl	%eax, (%esp)
	leal	sel_forwardingTargetForSelector_-.L0(%ebx), %eax
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	leal	_class_respondsToSelector-.L0(%ebx), %eax
	leal	_class_respondsToSelector-0b(%ebx), %eax
	call	*%eax

	testl	%eax, %eax
	jz	fail
	jz	1f

	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	leal	sel_forwardingTargetForSelector_-.L0(%ebx), %eax
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	leal	_objc_msg_lookup-.L0(%ebx), %eax
	leal	_objc_msg_lookup-0b(%ebx), %eax
	call	*%eax

	movl	8(%ebp), %edx
	movl	%edx, (%esp)
	leal	sel_forwardingTargetForSelector_-.L0(%ebx), %edx
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %edx
	movl	%edx, 4(%esp)
	movl	12(%ebp), %edx
	movl	%edx, 8(%esp)
	call	*%eax

	testl	%eax, %eax
	jz	fail
	jz	1f
	cmpl	8(%ebp), %eax
	je	fail
	je	1f

	movl	%eax, 8(%ebp)
	movl	%eax, (%esp)
	movl	12(%ebp), %eax
	movl	%eax, 4(%esp)
	leal	_objc_msg_lookup-.L0(%ebx), %eax
	leal	_objc_msg_lookup-0b(%ebx), %eax
	call	*%eax

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	*%eax

fail:
	leal	_of_method_not_found-.L0(%ebx), %eax
1:
	leal	_of_method_not_found-0b(%ebx), %eax

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	*%eax

_of_forward_stret:
	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$20, %esp

	call	get_eip
.L1:
0:

	movl	12(%ebp), %eax
	movl	%eax, (%esp)
	leal	_object_getClass-.L1(%ebx), %eax
	leal	_object_getClass-0b(%ebx), %eax
	call	*%eax

	movl	%eax, (%esp)
	leal	sel_forwardingTargetForSelector_-.L1(%ebx), %eax
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	leal	_class_respondsToSelector-.L1(%ebx), %eax
	leal	_class_respondsToSelector-0b(%ebx), %eax
	call	*%eax

	testl	%eax, %eax
	jz	fail_stret
	jz	1f

	movl	12(%ebp), %eax
	movl	%eax, (%esp)
	leal	sel_forwardingTargetForSelector_-.L1(%ebx), %eax
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %eax
	movl	%eax, 4(%esp)
	leal	_objc_msg_lookup-.L1(%ebx), %eax
	leal	_objc_msg_lookup-0b(%ebx), %eax
	call	*%eax

	movl	12(%ebp), %edx
	movl	%edx, (%esp)
	leal	sel_forwardingTargetForSelector_-.L1(%ebx), %edx
	leal	sel_forwardingTargetForSelector_-0b(%ebx), %edx
	movl	%edx, 4(%esp)
	movl	16(%ebp), %edx
	movl	%edx, 8(%esp)
	call	*%eax

	testl	%eax, %eax
	jz	fail_stret
	jz	1f
	cmpl	12(%ebp), %eax
	je	fail_stret
	je	1f

	movl	%eax, 12(%ebp)
	movl	%eax, (%esp)
	movl	16(%ebp), %eax
	movl	%eax, 4(%esp)
	leal	_objc_msg_lookup_stret-.L1(%ebx), %eax
	leal	_objc_msg_lookup_stret-0b(%ebx), %eax
	call	*%eax

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	*%eax

fail_stret:
	leal	_of_method_not_found_stret-.L1(%ebx), %eax
1:
	leal	_of_method_not_found_stret-0b(%ebx), %eax

	addl	$20, %esp
	popl	%ebx
	popl	%ebp

	jmp	*%eax

init:
	pushl	%ebp
	movl	%esp, %ebp

	pushl	%ebx
	subl	$4, %esp

	call	get_eip
.L2:
	leal	module-.L2(%ebx), %eax
0:
	leal	module-0b(%ebx), %eax
	movl	%eax, (%esp)
	leal	___objc_exec_class-.L2(%ebx), %eax
	leal	___objc_exec_class-0b(%ebx), %eax
	call	*%eax

	addl	$4, %esp
	popl	%ebx
	popl	%ebp
	ret

Modified src/forwarding/forwarding.S from [39eb5e4c4b] to [05269f0df2].

35
36
37
38
39
40
41
42

43
44
45
46
47
48
35
36
37
38
39
40
41

42
43
44
45
46
47
48







-
+






#  elif defined(__i386__)
#   include "forwarding-x86-elf.S"
#  elif defined(__arm__) || defined(__ARM__)
#   include "forwarding-arm-elf.S"
#  elif defined(__ppc__) || defined(__PPC__)
#   include "forwarding-ppc-elf.S"
#  elif (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
    (defined(__mips_eabi) && _MIPS_SZPTR == 32)
	(defined(__mips_eabi) && _MIPS_SZPTR == 32)
#   include "forwarding-mips-elf.S"
#  endif
# elif defined(_WIN32) && defined(__i386__)
#  include "forwarding-x86-win32.S"
# endif
#endif