OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/interface-descriptors.h" | 9 #include "src/interface-descriptors.h" |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 return MathPowTaggedDescriptor::exponent(); | 57 return MathPowTaggedDescriptor::exponent(); |
58 } | 58 } |
59 | 59 |
60 | 60 |
61 const Register GrowArrayElementsDescriptor::ObjectRegister() { return r3; } | 61 const Register GrowArrayElementsDescriptor::ObjectRegister() { return r3; } |
62 const Register GrowArrayElementsDescriptor::KeyRegister() { return r6; } | 62 const Register GrowArrayElementsDescriptor::KeyRegister() { return r6; } |
63 | 63 |
64 | 64 |
65 void FastNewClosureDescriptor::InitializePlatformSpecific( | 65 void FastNewClosureDescriptor::InitializePlatformSpecific( |
66 CallInterfaceDescriptorData* data) { | 66 CallInterfaceDescriptorData* data) { |
67 Register registers[] = {cp, r5}; | 67 Register registers[] = {r5}; |
68 data->InitializePlatformSpecific(arraysize(registers), registers); | 68 data->InitializePlatformSpecific(arraysize(registers), registers); |
69 } | 69 } |
70 | 70 |
71 | 71 |
72 void FastNewContextDescriptor::InitializePlatformSpecific( | 72 void FastNewContextDescriptor::InitializePlatformSpecific( |
73 CallInterfaceDescriptorData* data) { | 73 CallInterfaceDescriptorData* data) { |
74 Register registers[] = {cp, r4}; | 74 Register registers[] = {r4}; |
75 data->InitializePlatformSpecific(arraysize(registers), registers); | 75 data->InitializePlatformSpecific(arraysize(registers), registers); |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 void ToNumberDescriptor::InitializePlatformSpecific( | 79 void ToNumberDescriptor::InitializePlatformSpecific( |
80 CallInterfaceDescriptorData* data) { | 80 CallInterfaceDescriptorData* data) { |
81 Register registers[] = {cp, r3}; | 81 Register registers[] = {r3}; |
82 data->InitializePlatformSpecific(arraysize(registers), registers); | 82 data->InitializePlatformSpecific(arraysize(registers), registers); |
83 } | 83 } |
84 | 84 |
85 | 85 |
86 void NumberToStringDescriptor::InitializePlatformSpecific( | 86 void NumberToStringDescriptor::InitializePlatformSpecific( |
87 CallInterfaceDescriptorData* data) { | 87 CallInterfaceDescriptorData* data) { |
88 Register registers[] = {cp, r3}; | 88 Register registers[] = {r3}; |
89 data->InitializePlatformSpecific(arraysize(registers), registers); | 89 data->InitializePlatformSpecific(arraysize(registers), registers); |
90 } | 90 } |
91 | 91 |
92 | 92 |
93 void TypeofDescriptor::InitializePlatformSpecific( | 93 void TypeofDescriptor::InitializePlatformSpecific( |
94 CallInterfaceDescriptorData* data) { | 94 CallInterfaceDescriptorData* data) { |
95 Register registers[] = {cp, r6}; | 95 Register registers[] = {r6}; |
96 data->InitializePlatformSpecific(arraysize(registers), registers); | 96 data->InitializePlatformSpecific(arraysize(registers), registers); |
97 } | 97 } |
98 | 98 |
99 | 99 |
100 void FastCloneShallowArrayDescriptor::InitializePlatformSpecific( | 100 void FastCloneShallowArrayDescriptor::InitializePlatformSpecific( |
101 CallInterfaceDescriptorData* data) { | 101 CallInterfaceDescriptorData* data) { |
102 Register registers[] = {cp, r6, r5, r4}; | 102 Register registers[] = {r6, r5, r4}; |
103 data->InitializePlatformSpecific(arraysize(registers), registers); | 103 data->InitializePlatformSpecific(arraysize(registers), registers); |
104 } | 104 } |
105 | 105 |
106 | 106 |
107 void FastCloneShallowObjectDescriptor::InitializePlatformSpecific( | 107 void FastCloneShallowObjectDescriptor::InitializePlatformSpecific( |
108 CallInterfaceDescriptorData* data) { | 108 CallInterfaceDescriptorData* data) { |
109 Register registers[] = {cp, r6, r5, r4, r3}; | 109 Register registers[] = {r6, r5, r4, r3}; |
110 data->InitializePlatformSpecific(arraysize(registers), registers); | 110 data->InitializePlatformSpecific(arraysize(registers), registers); |
111 } | 111 } |
112 | 112 |
113 | 113 |
114 void CreateAllocationSiteDescriptor::InitializePlatformSpecific( | 114 void CreateAllocationSiteDescriptor::InitializePlatformSpecific( |
115 CallInterfaceDescriptorData* data) { | 115 CallInterfaceDescriptorData* data) { |
116 Register registers[] = {cp, r5, r6}; | 116 Register registers[] = {r5, r6}; |
117 data->InitializePlatformSpecific(arraysize(registers), registers); | 117 data->InitializePlatformSpecific(arraysize(registers), registers); |
118 } | 118 } |
119 | 119 |
120 | 120 |
121 void CreateWeakCellDescriptor::InitializePlatformSpecific( | 121 void CreateWeakCellDescriptor::InitializePlatformSpecific( |
122 CallInterfaceDescriptorData* data) { | 122 CallInterfaceDescriptorData* data) { |
123 Register registers[] = {cp, r5, r6, r4}; | 123 Register registers[] = {r5, r6, r4}; |
124 data->InitializePlatformSpecific(arraysize(registers), registers); | 124 data->InitializePlatformSpecific(arraysize(registers), registers); |
125 } | 125 } |
126 | 126 |
127 | 127 |
128 void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific( | 128 void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific( |
129 CallInterfaceDescriptorData* data) { | 129 CallInterfaceDescriptorData* data) { |
130 Register registers[] = {cp, r6, r3}; | 130 Register registers[] = {r6, r3}; |
131 data->InitializePlatformSpecific(arraysize(registers), registers); | 131 data->InitializePlatformSpecific(arraysize(registers), registers); |
132 } | 132 } |
133 | 133 |
134 | 134 |
135 void CallFunctionDescriptor::InitializePlatformSpecific( | 135 void CallFunctionDescriptor::InitializePlatformSpecific( |
136 CallInterfaceDescriptorData* data) { | 136 CallInterfaceDescriptorData* data) { |
137 Register registers[] = {cp, r4}; | 137 Register registers[] = {r4}; |
138 data->InitializePlatformSpecific(arraysize(registers), registers); | 138 data->InitializePlatformSpecific(arraysize(registers), registers); |
139 } | 139 } |
140 | 140 |
141 | 141 |
142 void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific( | 142 void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific( |
143 CallInterfaceDescriptorData* data) { | 143 CallInterfaceDescriptorData* data) { |
144 Register registers[] = {cp, r4, r6}; | 144 Register registers[] = {r4, r6}; |
145 data->InitializePlatformSpecific(arraysize(registers), registers); | 145 data->InitializePlatformSpecific(arraysize(registers), registers); |
146 } | 146 } |
147 | 147 |
148 | 148 |
149 void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific( | 149 void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific( |
150 CallInterfaceDescriptorData* data) { | 150 CallInterfaceDescriptorData* data) { |
151 Register registers[] = {cp, r4, r6, r5}; | 151 Register registers[] = {r4, r6, r5}; |
152 data->InitializePlatformSpecific(arraysize(registers), registers); | 152 data->InitializePlatformSpecific(arraysize(registers), registers); |
153 } | 153 } |
154 | 154 |
155 | 155 |
156 void CallConstructDescriptor::InitializePlatformSpecific( | 156 void CallConstructDescriptor::InitializePlatformSpecific( |
157 CallInterfaceDescriptorData* data) { | 157 CallInterfaceDescriptorData* data) { |
158 // r3 : number of arguments | 158 // r3 : number of arguments |
159 // r4 : the function to call | 159 // r4 : the function to call |
160 // r5 : feedback vector | 160 // r5 : feedback vector |
161 // r6 : (only if r5 is not the megamorphic symbol) slot in feedback | 161 // r6 : (only if r5 is not the megamorphic symbol) slot in feedback |
162 // vector (Smi) | 162 // vector (Smi) |
163 // TODO(turbofan): So far we don't gather type feedback and hence skip the | 163 // TODO(turbofan): So far we don't gather type feedback and hence skip the |
164 // slot parameter, but ArrayConstructStub needs the vector to be undefined. | 164 // slot parameter, but ArrayConstructStub needs the vector to be undefined. |
165 Register registers[] = {cp, r3, r4, r5}; | 165 Register registers[] = {r3, r4, r5}; |
166 data->InitializePlatformSpecific(arraysize(registers), registers); | 166 data->InitializePlatformSpecific(arraysize(registers), registers); |
167 } | 167 } |
168 | 168 |
169 | 169 |
170 void RegExpConstructResultDescriptor::InitializePlatformSpecific( | 170 void RegExpConstructResultDescriptor::InitializePlatformSpecific( |
171 CallInterfaceDescriptorData* data) { | 171 CallInterfaceDescriptorData* data) { |
172 Register registers[] = {cp, r5, r4, r3}; | 172 Register registers[] = {r5, r4, r3}; |
173 data->InitializePlatformSpecific(arraysize(registers), registers); | 173 data->InitializePlatformSpecific(arraysize(registers), registers); |
174 } | 174 } |
175 | 175 |
176 | 176 |
177 void TransitionElementsKindDescriptor::InitializePlatformSpecific( | 177 void TransitionElementsKindDescriptor::InitializePlatformSpecific( |
178 CallInterfaceDescriptorData* data) { | 178 CallInterfaceDescriptorData* data) { |
179 Register registers[] = {cp, r3, r4}; | 179 Register registers[] = {r3, r4}; |
180 data->InitializePlatformSpecific(arraysize(registers), registers); | 180 data->InitializePlatformSpecific(arraysize(registers), registers); |
181 } | 181 } |
182 | 182 |
183 | 183 |
184 void AllocateHeapNumberDescriptor::InitializePlatformSpecific( | 184 void AllocateHeapNumberDescriptor::InitializePlatformSpecific( |
185 CallInterfaceDescriptorData* data) { | 185 CallInterfaceDescriptorData* data) { |
186 // register state | 186 data->InitializePlatformSpecific(0, nullptr, nullptr); |
187 // cp -- context | |
188 Register registers[] = {cp}; | |
189 data->InitializePlatformSpecific(arraysize(registers), registers, nullptr); | |
190 } | 187 } |
191 | 188 |
192 | 189 |
193 void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific( | 190 void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific( |
194 CallInterfaceDescriptorData* data) { | 191 CallInterfaceDescriptorData* data) { |
195 // register state | 192 // register state |
196 // cp -- context | |
197 // r3 -- number of arguments | 193 // r3 -- number of arguments |
198 // r4 -- function | 194 // r4 -- function |
199 // r5 -- allocation site with elements kind | 195 // r5 -- allocation site with elements kind |
200 Register registers[] = {cp, r4, r5}; | 196 Register registers[] = {r4, r5}; |
201 data->InitializePlatformSpecific(arraysize(registers), registers); | 197 data->InitializePlatformSpecific(arraysize(registers), registers); |
202 } | 198 } |
203 | 199 |
204 | 200 |
205 void ArrayConstructorDescriptor::InitializePlatformSpecific( | 201 void ArrayConstructorDescriptor::InitializePlatformSpecific( |
206 CallInterfaceDescriptorData* data) { | 202 CallInterfaceDescriptorData* data) { |
207 // stack param count needs (constructor pointer, and single argument) | 203 // stack param count needs (constructor pointer, and single argument) |
208 Register registers[] = {cp, r4, r5, r3}; | 204 Register registers[] = {r4, r5, r3}; |
209 data->InitializePlatformSpecific(arraysize(registers), registers); | 205 data->InitializePlatformSpecific(arraysize(registers), registers); |
210 } | 206 } |
211 | 207 |
212 | 208 |
213 void InternalArrayConstructorConstantArgCountDescriptor:: | 209 void InternalArrayConstructorConstantArgCountDescriptor:: |
214 InitializePlatformSpecific(CallInterfaceDescriptorData* data) { | 210 InitializePlatformSpecific(CallInterfaceDescriptorData* data) { |
215 // register state | 211 // register state |
216 // cp -- context | |
217 // r3 -- number of arguments | 212 // r3 -- number of arguments |
218 // r4 -- constructor function | 213 // r4 -- constructor function |
219 Register registers[] = {cp, r4}; | 214 Register registers[] = {r4}; |
220 data->InitializePlatformSpecific(arraysize(registers), registers); | 215 data->InitializePlatformSpecific(arraysize(registers), registers); |
221 } | 216 } |
222 | 217 |
223 | 218 |
224 void InternalArrayConstructorDescriptor::InitializePlatformSpecific( | 219 void InternalArrayConstructorDescriptor::InitializePlatformSpecific( |
225 CallInterfaceDescriptorData* data) { | 220 CallInterfaceDescriptorData* data) { |
226 // stack param count needs (constructor pointer, and single argument) | 221 // stack param count needs (constructor pointer, and single argument) |
227 Register registers[] = {cp, r4, r3}; | 222 Register registers[] = {r4, r3}; |
228 data->InitializePlatformSpecific(arraysize(registers), registers); | 223 data->InitializePlatformSpecific(arraysize(registers), registers); |
229 } | 224 } |
230 | 225 |
231 | 226 |
232 void CompareDescriptor::InitializePlatformSpecific( | 227 void CompareDescriptor::InitializePlatformSpecific( |
233 CallInterfaceDescriptorData* data) { | 228 CallInterfaceDescriptorData* data) { |
234 Register registers[] = {cp, r4, r3}; | 229 Register registers[] = {r4, r3}; |
235 data->InitializePlatformSpecific(arraysize(registers), registers); | 230 data->InitializePlatformSpecific(arraysize(registers), registers); |
236 } | 231 } |
237 | 232 |
238 | 233 |
239 void CompareNilDescriptor::InitializePlatformSpecific( | 234 void CompareNilDescriptor::InitializePlatformSpecific( |
240 CallInterfaceDescriptorData* data) { | 235 CallInterfaceDescriptorData* data) { |
241 Register registers[] = {cp, r3}; | 236 Register registers[] = {r3}; |
242 data->InitializePlatformSpecific(arraysize(registers), registers); | 237 data->InitializePlatformSpecific(arraysize(registers), registers); |
243 } | 238 } |
244 | 239 |
245 | 240 |
246 void ToBooleanDescriptor::InitializePlatformSpecific( | 241 void ToBooleanDescriptor::InitializePlatformSpecific( |
247 CallInterfaceDescriptorData* data) { | 242 CallInterfaceDescriptorData* data) { |
248 Register registers[] = {cp, r3}; | 243 Register registers[] = {r3}; |
249 data->InitializePlatformSpecific(arraysize(registers), registers); | 244 data->InitializePlatformSpecific(arraysize(registers), registers); |
250 } | 245 } |
251 | 246 |
252 | 247 |
253 void BinaryOpDescriptor::InitializePlatformSpecific( | 248 void BinaryOpDescriptor::InitializePlatformSpecific( |
254 CallInterfaceDescriptorData* data) { | 249 CallInterfaceDescriptorData* data) { |
255 Register registers[] = {cp, r4, r3}; | 250 Register registers[] = {r4, r3}; |
256 data->InitializePlatformSpecific(arraysize(registers), registers); | 251 data->InitializePlatformSpecific(arraysize(registers), registers); |
257 } | 252 } |
258 | 253 |
259 | 254 |
260 void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific( | 255 void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific( |
261 CallInterfaceDescriptorData* data) { | 256 CallInterfaceDescriptorData* data) { |
262 Register registers[] = {cp, r5, r4, r3}; | 257 Register registers[] = {r5, r4, r3}; |
263 data->InitializePlatformSpecific(arraysize(registers), registers); | 258 data->InitializePlatformSpecific(arraysize(registers), registers); |
264 } | 259 } |
265 | 260 |
266 | 261 |
267 void StringAddDescriptor::InitializePlatformSpecific( | 262 void StringAddDescriptor::InitializePlatformSpecific( |
268 CallInterfaceDescriptorData* data) { | 263 CallInterfaceDescriptorData* data) { |
269 Register registers[] = {cp, r4, r3}; | 264 Register registers[] = {r4, r3}; |
270 data->InitializePlatformSpecific(arraysize(registers), registers); | 265 data->InitializePlatformSpecific(arraysize(registers), registers); |
271 } | 266 } |
272 | 267 |
273 | 268 |
274 void KeyedDescriptor::InitializePlatformSpecific( | 269 void KeyedDescriptor::InitializePlatformSpecific( |
275 CallInterfaceDescriptorData* data) { | 270 CallInterfaceDescriptorData* data) { |
276 Register registers[] = { | 271 Register registers[] = { |
277 cp, // context | |
278 r5, // key | 272 r5, // key |
279 }; | 273 }; |
280 data->InitializePlatformSpecific(arraysize(registers), registers); | 274 data->InitializePlatformSpecific(arraysize(registers), registers); |
281 } | 275 } |
282 | 276 |
283 | 277 |
284 void NamedDescriptor::InitializePlatformSpecific( | 278 void NamedDescriptor::InitializePlatformSpecific( |
285 CallInterfaceDescriptorData* data) { | 279 CallInterfaceDescriptorData* data) { |
286 Register registers[] = { | 280 Register registers[] = { |
287 cp, // context | |
288 r5, // name | 281 r5, // name |
289 }; | 282 }; |
290 data->InitializePlatformSpecific(arraysize(registers), registers); | 283 data->InitializePlatformSpecific(arraysize(registers), registers); |
291 } | 284 } |
292 | 285 |
293 | 286 |
294 void CallHandlerDescriptor::InitializePlatformSpecific( | 287 void CallHandlerDescriptor::InitializePlatformSpecific( |
295 CallInterfaceDescriptorData* data) { | 288 CallInterfaceDescriptorData* data) { |
296 Register registers[] = { | 289 Register registers[] = { |
297 cp, // context | |
298 r3, // receiver | 290 r3, // receiver |
299 }; | 291 }; |
300 data->InitializePlatformSpecific(arraysize(registers), registers); | 292 data->InitializePlatformSpecific(arraysize(registers), registers); |
301 } | 293 } |
302 | 294 |
303 | 295 |
304 void ArgumentAdaptorDescriptor::InitializePlatformSpecific( | 296 void ArgumentAdaptorDescriptor::InitializePlatformSpecific( |
305 CallInterfaceDescriptorData* data) { | 297 CallInterfaceDescriptorData* data) { |
306 Register registers[] = { | 298 Register registers[] = { |
307 cp, // context | |
308 r4, // JSFunction | 299 r4, // JSFunction |
309 r3, // actual number of arguments | 300 r3, // actual number of arguments |
310 r5, // expected number of arguments | 301 r5, // expected number of arguments |
311 }; | 302 }; |
312 data->InitializePlatformSpecific(arraysize(registers), registers); | 303 data->InitializePlatformSpecific(arraysize(registers), registers); |
313 } | 304 } |
314 | 305 |
315 | 306 |
316 void ApiFunctionDescriptor::InitializePlatformSpecific( | 307 void ApiFunctionDescriptor::InitializePlatformSpecific( |
317 CallInterfaceDescriptorData* data) { | 308 CallInterfaceDescriptorData* data) { |
318 Register registers[] = { | 309 Register registers[] = { |
319 cp, // context | |
320 r3, // callee | 310 r3, // callee |
321 r7, // call_data | 311 r7, // call_data |
322 r5, // holder | 312 r5, // holder |
323 r4, // api_function_address | 313 r4, // api_function_address |
324 r6, // actual number of arguments | 314 r6, // actual number of arguments |
325 }; | 315 }; |
326 data->InitializePlatformSpecific(arraysize(registers), registers); | 316 data->InitializePlatformSpecific(arraysize(registers), registers); |
327 } | 317 } |
328 | 318 |
329 | 319 |
330 void ApiAccessorDescriptor::InitializePlatformSpecific( | 320 void ApiAccessorDescriptor::InitializePlatformSpecific( |
331 CallInterfaceDescriptorData* data) { | 321 CallInterfaceDescriptorData* data) { |
332 Register registers[] = { | 322 Register registers[] = { |
333 cp, // context | |
334 r3, // callee | 323 r3, // callee |
335 r7, // call_data | 324 r7, // call_data |
336 r5, // holder | 325 r5, // holder |
337 r4, // api_function_address | 326 r4, // api_function_address |
338 }; | 327 }; |
339 data->InitializePlatformSpecific(arraysize(registers), registers); | 328 data->InitializePlatformSpecific(arraysize(registers), registers); |
340 } | 329 } |
341 | 330 |
342 | 331 |
343 void MathRoundVariantDescriptor::InitializePlatformSpecific( | 332 void MathRoundVariantDescriptor::InitializePlatformSpecific( |
344 CallInterfaceDescriptorData* data) { | 333 CallInterfaceDescriptorData* data) { |
345 Register registers[] = { | 334 Register registers[] = { |
346 cp, // context | |
347 r4, // math rounding function | 335 r4, // math rounding function |
348 r6, // vector slot id | 336 r6, // vector slot id |
349 }; | 337 }; |
350 data->InitializePlatformSpecific(arraysize(registers), registers); | 338 data->InitializePlatformSpecific(arraysize(registers), registers); |
351 } | 339 } |
352 } // namespace internal | 340 } // namespace internal |
353 } // namespace v8 | 341 } // namespace v8 |
354 | 342 |
355 #endif // V8_TARGET_ARCH_PPC | 343 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |