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
84
85
86
87
88
|
* 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"
.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:
beqz $a0, 0f
lw $t0, 0($a0)
lw $t0, 32($t0)
.Lmain_\name:
#if defined(__MIPSEL__)
# ifdef OF_SELUID24
lbu $t1, 2($a1)
# endif
lbu $t2, 1($a1)
lbu $t3, 0($a1)
#elif defined(__MIPSEB__)
# ifdef OF_SELUID24
lbu $t1, 1($a1)
# endif
lbu $t2, 2($a1)
lbu $t3, 3($a1)
#else
# error Neither __MIPSEL__ nor __MIPSEB__ defined!
#endif
#ifdef OF_SELUID24
sll $t1, $t1, 2
#endif
sll $t2, $t2, 2
sll $t3, $t3, 2
#ifdef OF_SELUID24
addu $t0, $t0, $t1
lw $t0, 0($t0)
#endif
addu $t0, $t0, $t2
lw $t0, 0($t0)
addu $t0, $t0, $t3
lw $t0, 0($t0)
#ifdef __PIC__
beqz $t0, 1f
#else
beqz $t0, \not_found
#endif
move $v0, $t0
j $ra
0:
#ifdef __PIC__
addiu $v0, $t9, nil_method-\name
#else
la $v0, nil_method
#endif
j $ra
#ifdef __PIC__
1:
lui $gp, %hi(_gp_disp)
addiu $gp, $gp, %lo(_gp_disp)
addu $gp, $gp, $t9
addiu $gp, $gp, 1b-\name
lw $t9, %call16(\not_found)($gp)
|
>
>
<
|
<
<
<
<
<
>
>
|
>
>
|
|
|
|
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
84
85
86
87
88
|
* 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:
beqz $a0, 0f
lw $t0, 0($a0)
lw $t0, 32($t0)
.Lmain_\name:
#ifdef OF_BIGENDIAN
# ifdef OF_SELUID24
lbu $t1, 1($a1)
# endif
lbu $t2, 2($a1)
lbu $t3, 3($a1)
#else
# ifdef OF_SELUID24
lbu $t1, 2($a1)
# endif
lbu $t2, 1($a1)
lbu $t3, 0($a1)
#endif
#ifdef OF_SELUID24
sll $t1, $t1, 2
#endif
sll $t2, $t2, 2
sll $t3, $t3, 2
#ifdef OF_SELUID24
addu $t0, $t0, $t1
lw $t0, 0($t0)
#endif
addu $t0, $t0, $t2
lw $t0, 0($t0)
addu $t0, $t0, $t3
lw $t0, 0($t0)
#ifdef OF_PIC
beqz $t0, 1f
#else
beqz $t0, \not_found
#endif
move $v0, $t0
j $ra
0:
#ifdef OF_PIC
addiu $v0, $t9, nil_method-\name
#else
la $v0, nil_method
#endif
j $ra
#ifdef OF_PIC
1:
lui $gp, %hi(_gp_disp)
addiu $gp, $gp, %lo(_gp_disp)
addu $gp, $gp, $t9
addiu $gp, $gp, 1b-\name
lw $t9, %call16(\not_found)($gp)
|
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
|
lw $t0, 4($a0)
lw $t0, 32($t0)
b .Lmain_\lookup
0:
#ifdef __PIC__
addiu $v0, $t9, nil_method-\name
#else
la $v0, nil_method
#endif
j $ra
.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
nil_method:
move $v0, $zero
j $ra
#ifdef __linux__
.section .note.GNU-stack, "", %progbits
#endif
|
|
|
|
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
|
lw $t0, 4($a0)
lw $t0, 32($t0)
b .Lmain_\lookup
0:
#ifdef OF_PIC
addiu $v0, $t9, nil_method-\name
#else
la $v0, nil_method
#endif
j $ra
.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
nil_method:
move $v0, $zero
j $ra
#ifdef OF_LINUX
.section .note.GNU-stack, "", %progbits
#endif
|