ObjFW  Check-in [09e046628e]

Overview
Comment:lookup-asm-sparc64-elf.S: Support tagged pointers
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tagged-pointers
Files: files | file ages | folders
SHA3-256: 09e046628eacd8b8aba95d1770afd15629c0e79448a6849882d8501347bb1b98
User & Date: js on 2020-07-04 11:51:54
Other Links: branch diff | manifest | tags
Context
2020-07-04
13:00
Add tests for tagged pointers check-in: 6414fc9ca5 user: js tags: tagged-pointers
11:51
lookup-asm-sparc64-elf.S: Support tagged pointers check-in: 09e046628e user: js tags: tagged-pointers
00:40
Use a regular int for the tagged pointer class ID check-in: a8d453813c user: js tags: tagged-pointers
Changes

Modified src/runtime/lookup-asm/lookup-asm-sparc64-elf.S from [ca8ce4890a] to [2d374a58b8].

24
25
26
27
28
29
30


31
32
33
34
35
36
37
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro generate_lookup name not_found
\name:
	brz,pn	%o0, ret_nil


	 nop

	ldx	[%o0], %o2
	ldx	[%o2 + 64], %o2

.Lmain_\name:
#ifdef OF_SELUID24







>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro generate_lookup name not_found
\name:
	brz,pn	%o0, ret_nil
	 and	%o0, 1, %o2
	brnz,pn	%o2, .Ltagged_pointer_\name
	 nop

	ldx	[%o0], %o2
	ldx	[%o2 + 64], %o2

.Lmain_\name:
#ifdef OF_SELUID24
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

#ifdef OF_SELUID24
	ldx	[%o2 + %o3], %o2
#endif
	ldx	[%o2 + %o4], %o2
	ldx	[%o2 + %o5], %o2

	cmp	%o2, 0
	be,pn	%xcc, 0f
	 nop

	retl
	 mov	%o2, %o0

0:
	mov	%o7, %g1
	call	\not_found
	 mov	%g1, %o7




















.type \name, %function
.size \name, .-\name
.endm

.macro generate_lookup_super name lookup
\name:
	mov	%o0, %o2







|
<









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







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

#ifdef OF_SELUID24
	ldx	[%o2 + %o3], %o2
#endif
	ldx	[%o2 + %o4], %o2
	ldx	[%o2 + %o5], %o2

	brz,pn	%o2, 0f

	 nop

	retl
	 mov	%o2, %o0

0:
	mov	%o7, %g1
	call	\not_found
	 mov	%g1, %o7

.Ltagged_pointer_\name:
	and	%o0, 0xE, %o2
	sll	%o2, 2, %o2

	mov	%o7, %g1
	sethi	%hi(_GLOBAL_OFFSET_TABLE_ - 4), %o3
	call	0f
	 or	%o3, %lo(_GLOBAL_OFFSET_TABLE_ + 4), %o3
0:
	add	%o7, %o3, %o3
	mov	%g1, %o7

	sethi	%hi(objc_tagged_pointer_classes), %o0
	or	%o0, %lo(objc_tagged_pointer_classes), %o0
	ldx	[%o3 + %o0], %o0
	ldx	[%o0 + %o2], %o2
	ba	.Lmain_\name
	 ldx	[%o2 + 64], %o2

.type \name, %function
.size \name, .-\name
.endm

.macro generate_lookup_super name lookup
\name:
	mov	%o0, %o2
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

ret_nil:
#ifdef OF_PIC
	mov	%o7, %g1

	sethi	%hi(_GLOBAL_OFFSET_TABLE_ - 4), %o1
	call	0f
	 add	%o1, %lo(_GLOBAL_OFFSET_TABLE_ + 4), %o1
0:
	add	%o7, %o1, %o1

	sethi	%hi(nil_method), %o0
	or	%o0, %lo(nil_method), %o0

	jmpl	%g1 + 8, %g0







|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123

ret_nil:
#ifdef OF_PIC
	mov	%o7, %g1

	sethi	%hi(_GLOBAL_OFFSET_TABLE_ - 4), %o1
	call	0f
	 or	%o1, %lo(_GLOBAL_OFFSET_TABLE_ + 4), %o1
0:
	add	%o7, %o1, %o1

	sethi	%hi(nil_method), %o0
	or	%o0, %lo(nil_method), %o0

	jmpl	%g1 + 8, %g0