Update ooo320-m1
[ooovba.git] / bridges / source / cpp_uno / cc50_solaris_sparc / call.s
blobbe4027fda0704b504af7db9bf3e7513bf4c727ce
1 .global privateSnippetExecutor
2 .type privateSnippetExecutor,2
3 privateSnippetExecutor:
4 ! save %sp, -96, %sp already done in code snippet
5 st %i0, [%fp+68]
6 st %i1, [%fp+72]
7 st %i2, [%fp+76]
8 st %i3, [%fp+80]
9 st %i4, [%fp+84]
10 st %i5, [%fp+88]
11 ! %o0: functionIndex, stored by code snippet
12 ! %o1: vtableOffset, stored by code snippet
13 call cpp_vtable_call
14 add %fp, 68, %o2
15 .privateSnippetExecutorExceptionPosition:
16 subcc %o0, 11, %g0
17 be .double
18 subcc %o0, 10, %g0
19 be .float
20 ld [%fp+72], %i0
21 ld [%fp+76], %i1
22 ret
23 restore
24 .double:
25 ldd [%fp+72], %f0
26 ret
27 restore
28 .float:
29 ld [%fp+72], %f0
30 ret
31 restore
32 .size privateSnippetExecutor,(.-privateSnippetExecutor)
33 .align 8
36 .global callVirtualMethod
37 .type callVirtualMethod,2
38 callVirtualMethod:
39 ! allocate FIRST stack to have own local registers
40 sethi %hi(-96), %g1
41 or %g1, %lo(-96), %g1
42 subcc %g1, %o5, %g1
43 subcc %g1, %o5, %g1
44 subcc %g1, %o5, %g1
45 subcc %g1, %o5, %g1
46 save %sp, %g1, %sp
47 ! copy stack longs if necessary
48 subcc %i5, 6, %l5
49 ble .copyRegisters
50 nop
52 ! prepare source location
53 add %i4, 24, %l4
55 ! prepare real stack
56 add %sp, 92, %l3
58 .copyLong:
59 ld [%l4+0], %l0
60 st %l0, [%l3]
61 add %l4, 4, %l4
62 add %l3, 4, %l3
63 deccc %l5
64 bne .copyLong
65 nop
66 .copyRegisters:
67 mov %i5, %l5
68 mov %i4, %l4
70 ld [%l4], %o0
71 add %l4, 4, %l4
72 deccc %l5
73 ble .doCall
75 ld [%l4], %o1
76 add %l4, 4, %l4
77 deccc %l5
78 ble .doCall
80 ld [%l4], %o2
81 add %l4, 4, %l4
82 deccc %l5
83 ble .doCall
85 ld [%l4], %o3
86 add %l4, 4, %l4
87 deccc %l5
88 ble .doCall
90 ld [%l4], %o4
91 add %l4, 4, %l4
92 deccc %l5
93 ble .doCall
95 ld [%l4], %o5
96 add %l4, 4, %l4
98 ! prepare complex return pointer
99 st %i2, [%sp+64]
100 .doCall:
101 ! get virtual table entry
102 mov %i1, %l1
103 add %l1, 2, %l1
104 sll %l1, 2, %l1
105 ld [%i0], %l3
106 add %l3, %l1, %l1
107 ld [%l1], %l0
108 jmpl %l0,%o7
110 .callVirtualMethodExceptionPosition:
111 ! handle returns
113 !byte types
114 subcc %i3, 2, %l3 ! typelib_TypeClass_BOOLEAN
115 be .handleByte
116 subcc %i3, 3, %l3 ! typelib_TypeClass_BYTE
117 be .handleByte
119 ! half word types
120 subcc %i3, 4, %l3 ! typelib_TypeClass_SHORT
121 be .handleShort
122 subcc %i3, 5, %l3 ! typelib_TypeClass_UNSIGNED_SHORT
123 be .handleShort
124 subcc %i3, 1, %l3 ! typelib_TypeClass_CHAR (sal_Unicode==sal_uInt16)
125 be .handleShort
127 ! word types
128 subcc %i3, 6, %l3 ! typelib_TypeClass_LONG
129 be .handleWord
130 subcc %i3, 7, %l3 ! typelib_TypeClass_UNSIGNED_LONG
131 be .handleWord
132 subcc %i3, 15, %l3 ! typelib_TypeClass_ENUM
133 be .handleWord
135 ! double word types
136 subcc %i3, 8, %l3 ! typelib_TypeClass_HYPER
137 be .handleDoubleWord
138 subcc %i3, 9, %l3 ! typelib_TypeClass_UNSIGNED_HYPER
139 be .handleDoubleWord
141 ! float
142 subcc %i3, 10, %l3 ! typelib_TypeClass_FLOAT
143 be .handleFloat
145 ! double
146 subcc %i3, 11, %l3 ! typelib_TypeClass_DOUBLE
147 be .handleDouble
149 ! default: return void
150 nop ! empty prefetch
151 ba .doRestore
153 .handleByte:
154 stb %o0, [%i2]
155 ba .doRestore
157 .handleShort:
158 sth %o0, [%i2]
159 ba .doRestore
161 .handleWord:
162 st %o0, [%i2]
163 ba .doRestore
165 .handleDoubleWord:
166 st %o0, [%i2]
167 st %o1, [%i2+4]
168 ba .doRestore
170 .handleFloat:
171 st %f0, [%i2]
172 ba .doRestore
174 .handleDouble:
175 std %f0, [%fp-8]
176 ldd [%fp-8], %o0
177 st %o0, [%i2]
178 st %o1, [%i2+4]
179 ba .doRestore
181 .doRestore:
183 restore ! stack frame for own locals
184 .size callVirtualMethod,(.-callVirtualMethod)
185 .align 8
187 .rethrow_handler:
188 call __1cG__CrunMex_rethrow_q6F_v_
191 .section ".exception_ranges",#alloc
192 .word %r_disp32(.privateSnippetExecutorExceptionPosition)
193 .word 0
194 .word .rethrow_handler-.privateSnippetExecutorExceptionPosition
195 .word 0,0
196 .word %r_disp32(.callVirtualMethodExceptionPosition)
197 .word 0
198 .word .rethrow_handler-.callVirtualMethodExceptionPosition
199 .word 0,0