ObjFW  Check-in [5d814a5ef5]

Overview
Comment:Add objc_msg_lookup_stret for MIPS/ELF.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5d814a5ef5e1f6045b5c25677759578e23d1ef2b516f7fc00efdea00010f2ad8
User & Date: js on 2013-08-01 18:53:34
Other Links: manifest | tags
Context
2013-08-01
18:59
Add of_forward_stret for MIPS/ELF. check-in: d694ea89af user: js tags: trunk
18:53
Add objc_msg_lookup_stret for MIPS/ELF. check-in: 5d814a5ef5 user: js tags: trunk
2013-07-31
22:55
configure: Check that __thread works with PIC. check-in: 39cb0f9e7d user: js tags: trunk
Changes

Modified src/runtime/lookup-asm-mips-elf.S from [591bc89aea] to [87a1a9916a].

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

33
34
35
36
37
38
39

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

.section .text
objc_msg_lookup:
objc_msg_lookup_stret: /* FIXME */
	beqz	$a0, ret_nil

	lw	$t0, 0($a0)
	lw	$t0, 32($t0)

lookup:

#if defined(_MIPSEL)
# ifdef OF_SELUID24
	lbu	$t1, 2($a1)
# endif
	lbu	$t2, 1($a1)
	lbu	$t3, 0($a1)
#elif defined(_MIPSEB)







|
|
|




<
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35
36
37
38
39

.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_handler
\name:
	beqz	$a0, .ret_nil_\name

	lw	$t0, 0($a0)
	lw	$t0, 32($t0)


.main_\name:
#if defined(_MIPSEL)
# ifdef OF_SELUID24
	lbu	$t1, 2($a1)
# endif
	lbu	$t2, 1($a1)
	lbu	$t3, 0($a1)
#elif defined(_MIPSEB)
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
#endif
	addu	$t0, $t0, $t2
	lw	$t0, 0($t0)
	addu	$t0, $t0, $t3
	lw	$t0, 0($t0)

#ifdef __PIC__
	beqz	$t0, forward
#else
	beqz	$t0, objc_not_found_handler
#endif

	move	$v0, $t0
	j	$ra

ret_nil:
#ifdef __PIC__
	addiu	$v0, $t9, nil_method-objc_msg_lookup
#else
	la	$v0, nil_method
#endif
	j	$ra

#ifdef __PIC__
forward:
	lui	$gp, %hi(_gp_disp)
	addiu	$gp, $gp, %lo(_gp_disp)
	addu	$gp, $gp, $t9
	addiu	$gp, $gp, forward-objc_msg_lookup

	lw	$t9, %call16(objc_not_found_handler)($gp)
	jr	$t9
#endif
.type objc_msg_lookup, %function
.size objc_msg_lookup, .-objc_msg_lookup


objc_msg_lookup_super:
objc_msg_lookup_super_stret: /* FIXME */

	lw	$t0, 0($a0)
	beqz	$t0, ret_nil

	lw	$t0, 4($a0)
	lw	$t0, 32($t0)

	b	lookup














.type objc_msg_lookup_super, %function
.size objc_msg_lookup_super, .-objc_msg_lookup_super

nil_method:
	move	$v0, $zero
	j	$ra

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







|

|





|

|






|



|

|


|
|
>

|
<
>

|




|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|








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
#endif
	addu	$t0, $t0, $t2
	lw	$t0, 0($t0)
	addu	$t0, $t0, $t3
	lw	$t0, 0($t0)

#ifdef __PIC__
	beqz	$t0, .forward_\name
#else
	beqz	$t0, \not_found_handler
#endif

	move	$v0, $t0
	j	$ra

.ret_nil_\name:
#ifdef __PIC__
	addiu	$v0, $t9, nil_method-\name
#else
	la	$v0, nil_method
#endif
	j	$ra

#ifdef __PIC__
.forward_\name:
	lui	$gp, %hi(_gp_disp)
	addiu	$gp, $gp, %lo(_gp_disp)
	addu	$gp, $gp, $t9
	addiu	$gp, $gp, .forward_\name-\name

	lw	$t9, %call16(\not_found_handler)($gp)
	jr	$t9
#endif
.type \name, %function
.size \name, .-\name
.endm

.macro generate_lookup_super name lookup

\name:
	lw	$t0, 0($a0)
	beqz	$t0, .ret_nil_\name

	lw	$t0, 4($a0)
	lw	$t0, 32($t0)

	b	.main_\lookup

.ret_nil_\name:
#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_not_found_handler
generate_lookup objc_msg_lookup_stret objc_not_found_handler_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