Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: src/ia32/interface-descriptors-ia32.cc

Issue 1197703002: Use big-boy Types to annotate interface descriptor parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Latest Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/interface-descriptors.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/interface-descriptors.h" 9 #include "src/interface-descriptors.h"
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 const Register MathPowIntegerDescriptor::exponent() { 57 const Register MathPowIntegerDescriptor::exponent() {
58 return MathPowTaggedDescriptor::exponent(); 58 return MathPowTaggedDescriptor::exponent();
59 } 59 }
60 60
61 61
62 const Register GrowArrayElementsDescriptor::ObjectRegister() { return eax; } 62 const Register GrowArrayElementsDescriptor::ObjectRegister() { return eax; }
63 const Register GrowArrayElementsDescriptor::KeyRegister() { return ebx; } 63 const Register GrowArrayElementsDescriptor::KeyRegister() { return ebx; }
64 64
65 65
66 void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData* data) { 66 void FastNewClosureDescriptor::InitializePlatformSpecific(
67 CallInterfaceDescriptorData* data) {
67 Register registers[] = {esi, ebx}; 68 Register registers[] = {esi, ebx};
68 data->Initialize(arraysize(registers), registers, NULL); 69 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
69 } 70 }
70 71
71 72
72 void FastNewContextDescriptor::Initialize(CallInterfaceDescriptorData* data) { 73 void FastNewContextDescriptor::InitializePlatformSpecific(
74 CallInterfaceDescriptorData* data) {
73 Register registers[] = {esi, edi}; 75 Register registers[] = {esi, edi};
74 data->Initialize(arraysize(registers), registers, NULL); 76 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
75 } 77 }
76 78
77 79
78 void ToNumberDescriptor::Initialize(CallInterfaceDescriptorData* data) { 80 void ToNumberDescriptor::InitializePlatformSpecific(
81 CallInterfaceDescriptorData* data) {
79 // ToNumberStub invokes a function, and therefore needs a context. 82 // ToNumberStub invokes a function, and therefore needs a context.
80 Register registers[] = {esi, eax}; 83 Register registers[] = {esi, eax};
81 data->Initialize(arraysize(registers), registers, NULL); 84 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
82 } 85 }
83 86
84 87
85 void NumberToStringDescriptor::Initialize(CallInterfaceDescriptorData* data) { 88 void NumberToStringDescriptor::InitializePlatformSpecific(
89 CallInterfaceDescriptorData* data) {
86 Register registers[] = {esi, eax}; 90 Register registers[] = {esi, eax};
87 data->Initialize(arraysize(registers), registers, NULL); 91 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
88 } 92 }
89 93
90 94
91 void TypeofDescriptor::Initialize(CallInterfaceDescriptorData* data) { 95 void TypeofDescriptor::InitializePlatformSpecific(
96 CallInterfaceDescriptorData* data) {
92 Register registers[] = {esi, ebx}; 97 Register registers[] = {esi, ebx};
93 data->Initialize(arraysize(registers), registers, NULL); 98 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
94 } 99 }
95 100
96 101
97 void FastCloneShallowArrayDescriptor::Initialize( 102 void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
98 CallInterfaceDescriptorData* data) { 103 CallInterfaceDescriptorData* data) {
99 Register registers[] = {esi, eax, ebx, ecx}; 104 Register registers[] = {esi, eax, ebx, ecx};
100 Representation representations[] = { 105 data->InitializePlatformSpecific(arraysize(registers), registers);
101 Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
102 Representation::Tagged()};
103 data->Initialize(arraysize(registers), registers, representations);
104 } 106 }
105 107
106 108
107 void FastCloneShallowObjectDescriptor::Initialize( 109 void FastCloneShallowObjectDescriptor::InitializePlatformSpecific(
108 CallInterfaceDescriptorData* data) { 110 CallInterfaceDescriptorData* data) {
109 Register registers[] = {esi, eax, ebx, ecx, edx}; 111 Register registers[] = {esi, eax, ebx, ecx, edx};
110 data->Initialize(arraysize(registers), registers, NULL); 112 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
111 } 113 }
112 114
113 115
114 void CreateAllocationSiteDescriptor::Initialize( 116 void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
115 CallInterfaceDescriptorData* data) { 117 CallInterfaceDescriptorData* data) {
116 Register registers[] = {esi, ebx, edx}; 118 Register registers[] = {esi, ebx, edx};
117 Representation representations[] = {Representation::Tagged(), 119 data->InitializePlatformSpecific(arraysize(registers), registers);
118 Representation::Tagged(),
119 Representation::Smi()};
120 data->Initialize(arraysize(registers), registers, representations);
121 } 120 }
122 121
123 122
124 void CreateWeakCellDescriptor::Initialize(CallInterfaceDescriptorData* data) { 123 void CreateWeakCellDescriptor::InitializePlatformSpecific(
124 CallInterfaceDescriptorData* data) {
125 Register registers[] = {esi, ebx, edx, edi}; 125 Register registers[] = {esi, ebx, edx, edi};
126 Representation representations[] = { 126 data->InitializePlatformSpecific(arraysize(registers), registers);
127 Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
128 Representation::Tagged()};
129 data->Initialize(arraysize(registers), registers, representations);
130 } 127 }
131 128
132 129
133 void StoreArrayLiteralElementDescriptor::Initialize( 130 void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific(
134 CallInterfaceDescriptorData* data) { 131 CallInterfaceDescriptorData* data) {
135 Register registers[] = {esi, ecx, eax}; 132 Register registers[] = {esi, ecx, eax};
136 data->Initialize(arraysize(registers), registers, NULL); 133 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
137 } 134 }
138 135
139 136
140 void CallFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { 137 void CallFunctionDescriptor::InitializePlatformSpecific(
138 CallInterfaceDescriptorData* data) {
141 Register registers[] = {esi, edi}; 139 Register registers[] = {esi, edi};
142 data->Initialize(arraysize(registers), registers, NULL); 140 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
143 } 141 }
144 142
145 143
146 void CallFunctionWithFeedbackDescriptor::Initialize( 144 void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
147 CallInterfaceDescriptorData* data) { 145 CallInterfaceDescriptorData* data) {
148 Register registers[] = {esi, edi, edx}; 146 Register registers[] = {esi, edi, edx};
149 Representation representations[] = {Representation::Tagged(), 147 data->InitializePlatformSpecific(arraysize(registers), registers);
150 Representation::Tagged(),
151 Representation::Smi()};
152 data->Initialize(arraysize(registers), registers, representations);
153 } 148 }
154 149
155 150
156 void CallFunctionWithFeedbackAndVectorDescriptor::Initialize( 151 void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific(
157 CallInterfaceDescriptorData* data) { 152 CallInterfaceDescriptorData* data) {
158 Register registers[] = {esi, edi, edx, ebx}; 153 Register registers[] = {esi, edi, edx, ebx};
159 Representation representations[] = { 154 data->InitializePlatformSpecific(arraysize(registers), registers);
160 Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
161 Representation::Tagged()};
162 data->Initialize(arraysize(registers), registers, representations);
163 } 155 }
164 156
165 157
166 void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { 158 void CallConstructDescriptor::InitializePlatformSpecific(
159 CallInterfaceDescriptorData* data) {
167 // eax : number of arguments 160 // eax : number of arguments
168 // ebx : feedback vector 161 // ebx : feedback vector
169 // edx : (only if ebx is not the megamorphic symbol) slot in feedback 162 // edx : (only if ebx is not the megamorphic symbol) slot in feedback
170 // vector (Smi) 163 // vector (Smi)
171 // edi : constructor function 164 // edi : constructor function
172 // TODO(turbofan): So far we don't gather type feedback and hence skip the 165 // TODO(turbofan): So far we don't gather type feedback and hence skip the
173 // slot parameter, but ArrayConstructStub needs the vector to be undefined. 166 // slot parameter, but ArrayConstructStub needs the vector to be undefined.
174 Register registers[] = {esi, eax, edi, ebx}; 167 Register registers[] = {esi, eax, edi, ebx};
175 data->Initialize(arraysize(registers), registers, NULL); 168 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
176 } 169 }
177 170
178 171
179 void RegExpConstructResultDescriptor::Initialize( 172 void RegExpConstructResultDescriptor::InitializePlatformSpecific(
180 CallInterfaceDescriptorData* data) { 173 CallInterfaceDescriptorData* data) {
181 Register registers[] = {esi, ecx, ebx, eax}; 174 Register registers[] = {esi, ecx, ebx, eax};
182 data->Initialize(arraysize(registers), registers, NULL); 175 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
183 } 176 }
184 177
185 178
186 void TransitionElementsKindDescriptor::Initialize( 179 void TransitionElementsKindDescriptor::InitializePlatformSpecific(
187 CallInterfaceDescriptorData* data) { 180 CallInterfaceDescriptorData* data) {
188 Register registers[] = {esi, eax, ebx}; 181 Register registers[] = {esi, eax, ebx};
189 data->Initialize(arraysize(registers), registers, NULL); 182 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
190 } 183 }
191 184
192 185
193 void AllocateHeapNumberDescriptor::Initialize( 186 void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
194 CallInterfaceDescriptorData* data) { 187 CallInterfaceDescriptorData* data) {
195 // register state 188 // register state
196 // esi -- context 189 // esi -- context
197 Register registers[] = {esi}; 190 Register registers[] = {esi};
198 data->Initialize(arraysize(registers), registers, nullptr); 191 data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
199 } 192 }
200 193
201 194
202 void ArrayConstructorConstantArgCountDescriptor::Initialize( 195 void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific(
203 CallInterfaceDescriptorData* data) { 196 CallInterfaceDescriptorData* data) {
204 // register state 197 // register state
205 // eax -- number of arguments 198 // eax -- number of arguments
206 // edi -- function 199 // edi -- function
207 // ebx -- allocation site with elements kind 200 // ebx -- allocation site with elements kind
208 Register registers[] = {esi, edi, ebx}; 201 Register registers[] = {esi, edi, ebx};
209 data->Initialize(arraysize(registers), registers, NULL); 202 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
210 } 203 }
211 204
212 205
213 void ArrayConstructorDescriptor::Initialize(CallInterfaceDescriptorData* data) { 206 void ArrayConstructorDescriptor::InitializePlatformSpecific(
207 CallInterfaceDescriptorData* data) {
214 // stack param count needs (constructor pointer, and single argument) 208 // stack param count needs (constructor pointer, and single argument)
215 Register registers[] = {esi, edi, ebx, eax}; 209 Register registers[] = {esi, edi, ebx, eax};
216 Representation representations[] = { 210 data->InitializePlatformSpecific(arraysize(registers), registers);
217 Representation::Tagged(), Representation::Tagged(),
218 Representation::Tagged(), Representation::Integer32()};
219 data->Initialize(arraysize(registers), registers, representations);
220 } 211 }
221 212
222 213
223 void InternalArrayConstructorConstantArgCountDescriptor::Initialize( 214 void InternalArrayConstructorConstantArgCountDescriptor::
224 CallInterfaceDescriptorData* data) { 215 InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
225 // register state 216 // register state
226 // eax -- number of arguments 217 // eax -- number of arguments
227 // edi -- function 218 // edi -- function
228 Register registers[] = {esi, edi}; 219 Register registers[] = {esi, edi};
229 data->Initialize(arraysize(registers), registers, NULL); 220 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
230 } 221 }
231 222
232 223
233 void InternalArrayConstructorDescriptor::Initialize( 224 void InternalArrayConstructorDescriptor::InitializePlatformSpecific(
234 CallInterfaceDescriptorData* data) { 225 CallInterfaceDescriptorData* data) {
235 // stack param count needs (constructor pointer, and single argument) 226 // stack param count needs (constructor pointer, and single argument)
236 Register registers[] = {esi, edi, eax}; 227 Register registers[] = {esi, edi, eax};
237 Representation representations[] = {Representation::Tagged(), 228 data->InitializePlatformSpecific(arraysize(registers), registers);
238 Representation::Tagged(),
239 Representation::Integer32()};
240 data->Initialize(arraysize(registers), registers, representations);
241 } 229 }
242 230
243 231
244 void CompareDescriptor::Initialize(CallInterfaceDescriptorData* data) { 232 void CompareDescriptor::InitializePlatformSpecific(
233 CallInterfaceDescriptorData* data) {
245 Register registers[] = {esi, edx, eax}; 234 Register registers[] = {esi, edx, eax};
246 data->Initialize(arraysize(registers), registers, NULL); 235 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
247 } 236 }
248 237
249 238
250 void CompareNilDescriptor::Initialize(CallInterfaceDescriptorData* data) { 239 void CompareNilDescriptor::InitializePlatformSpecific(
240 CallInterfaceDescriptorData* data) {
251 Register registers[] = {esi, eax}; 241 Register registers[] = {esi, eax};
252 data->Initialize(arraysize(registers), registers, NULL); 242 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
253 } 243 }
254 244
255 245
256 void ToBooleanDescriptor::Initialize(CallInterfaceDescriptorData* data) { 246 void ToBooleanDescriptor::InitializePlatformSpecific(
247 CallInterfaceDescriptorData* data) {
257 Register registers[] = {esi, eax}; 248 Register registers[] = {esi, eax};
258 data->Initialize(arraysize(registers), registers, NULL); 249 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
259 } 250 }
260 251
261 252
262 void BinaryOpDescriptor::Initialize(CallInterfaceDescriptorData* data) { 253 void BinaryOpDescriptor::InitializePlatformSpecific(
254 CallInterfaceDescriptorData* data) {
263 Register registers[] = {esi, edx, eax}; 255 Register registers[] = {esi, edx, eax};
264 data->Initialize(arraysize(registers), registers, NULL); 256 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
265 } 257 }
266 258
267 259
268 void BinaryOpWithAllocationSiteDescriptor::Initialize( 260 void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
269 CallInterfaceDescriptorData* data) { 261 CallInterfaceDescriptorData* data) {
270 Register registers[] = {esi, ecx, edx, eax}; 262 Register registers[] = {esi, ecx, edx, eax};
271 data->Initialize(arraysize(registers), registers, NULL); 263 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
272 } 264 }
273 265
274 266
275 void StringAddDescriptor::Initialize(CallInterfaceDescriptorData* data) { 267 void StringAddDescriptor::InitializePlatformSpecific(
268 CallInterfaceDescriptorData* data) {
276 Register registers[] = {esi, edx, eax}; 269 Register registers[] = {esi, edx, eax};
277 data->Initialize(arraysize(registers), registers, NULL); 270 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
278 } 271 }
279 272
280 273
281 void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) { 274 void KeyedDescriptor::InitializePlatformSpecific(
275 CallInterfaceDescriptorData* data) {
282 Register registers[] = { 276 Register registers[] = {
283 esi, // context 277 esi, // context
284 ecx, // key 278 ecx, // key
285 }; 279 };
286 Representation representations[] = { 280 data->InitializePlatformSpecific(arraysize(registers), registers);
287 Representation::Tagged(), // context
288 Representation::Tagged(), // key
289 };
290 data->Initialize(arraysize(registers), registers, representations);
291 } 281 }
292 282
293 283
294 void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) { 284 void NamedDescriptor::InitializePlatformSpecific(
285 CallInterfaceDescriptorData* data) {
295 Register registers[] = { 286 Register registers[] = {
296 esi, // context 287 esi, // context
297 ecx, // name 288 ecx, // name
298 }; 289 };
299 Representation representations[] = { 290 data->InitializePlatformSpecific(arraysize(registers), registers);
300 Representation::Tagged(), // context
301 Representation::Tagged(), // name
302 };
303 data->Initialize(arraysize(registers), registers, representations);
304 } 291 }
305 292
306 293
307 void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) { 294 void CallHandlerDescriptor::InitializePlatformSpecific(
295 CallInterfaceDescriptorData* data) {
308 Register registers[] = { 296 Register registers[] = {
309 esi, // context 297 esi, // context
310 edx, // name 298 edx, // name
311 }; 299 };
312 Representation representations[] = { 300 data->InitializePlatformSpecific(arraysize(registers), registers);
313 Representation::Tagged(), // context
314 Representation::Tagged(), // receiver
315 };
316 data->Initialize(arraysize(registers), registers, representations);
317 } 301 }
318 302
319 303
320 void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) { 304 void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
305 CallInterfaceDescriptorData* data) {
321 Register registers[] = { 306 Register registers[] = {
322 esi, // context 307 esi, // context
323 edi, // JSFunction 308 edi, // JSFunction
324 eax, // actual number of arguments 309 eax, // actual number of arguments
325 ebx, // expected number of arguments 310 ebx, // expected number of arguments
326 }; 311 };
327 Representation representations[] = { 312 data->InitializePlatformSpecific(arraysize(registers), registers);
328 Representation::Tagged(), // context
329 Representation::Tagged(), // JSFunction
330 Representation::Integer32(), // actual number of arguments
331 Representation::Integer32(), // expected number of arguments
332 };
333 data->Initialize(arraysize(registers), registers, representations);
334 } 313 }
335 314
336 315
337 void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) { 316 void ApiFunctionDescriptor::InitializePlatformSpecific(
317 CallInterfaceDescriptorData* data) {
338 Register registers[] = { 318 Register registers[] = {
339 esi, // context 319 esi, // context
340 edi, // callee 320 edi, // callee
341 ebx, // call_data 321 ebx, // call_data
342 ecx, // holder 322 ecx, // holder
343 edx, // api_function_address 323 edx, // api_function_address
344 eax, // actual number of arguments 324 eax, // actual number of arguments
345 }; 325 };
346 Representation representations[] = { 326 data->InitializePlatformSpecific(arraysize(registers), registers);
347 Representation::Tagged(), // context
348 Representation::Tagged(), // callee
349 Representation::Tagged(), // call_data
350 Representation::Tagged(), // holder
351 Representation::External(), // api_function_address
352 Representation::Integer32(), // actual number of arguments
353 };
354 data->Initialize(arraysize(registers), registers, representations);
355 } 327 }
356 328
357 329
358 void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { 330 void ApiAccessorDescriptor::InitializePlatformSpecific(
331 CallInterfaceDescriptorData* data) {
359 Register registers[] = { 332 Register registers[] = {
360 esi, // context 333 esi, // context
361 edi, // callee 334 edi, // callee
362 ebx, // call_data 335 ebx, // call_data
363 ecx, // holder 336 ecx, // holder
364 edx, // api_function_address 337 edx, // api_function_address
365 }; 338 };
366 Representation representations[] = { 339 data->InitializePlatformSpecific(arraysize(registers), registers);
367 Representation::Tagged(), // context
368 Representation::Tagged(), // callee
369 Representation::Tagged(), // call_data
370 Representation::Tagged(), // holder
371 Representation::External(), // api_function_address
372 };
373 data->Initialize(arraysize(registers), registers, representations);
374 } 340 }
375 341
376 342
377 void MathRoundVariantDescriptor::Initialize(CallInterfaceDescriptorData* data) { 343 void MathRoundVariantDescriptor::InitializePlatformSpecific(
344 CallInterfaceDescriptorData* data) {
378 Register registers[] = { 345 Register registers[] = {
379 esi, // context 346 esi, // context
380 edi, // math rounding function 347 edi, // math rounding function
381 edx, // vector slot id 348 edx, // vector slot id
382 }; 349 };
383 Representation representations[] = { 350 data->InitializePlatformSpecific(arraysize(registers), registers);
384 Representation::Tagged(), //
385 Representation::Tagged(), //
386 Representation::Tagged(), //
387 };
388 data->Initialize(arraysize(registers), registers, representations);
389 } 351 }
390 } // namespace internal 352 } // namespace internal
391 } // namespace v8 353 } // namespace v8
392 354
393 #endif // V8_TARGET_ARCH_IA32 355 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/interface-descriptors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698