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

Side by Side Diff: src/interface-descriptors.h

Issue 551043005: Added CallInterfaceDescriptors to all code stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/interface-descriptors.cc » ('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 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 #ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_ 5 #ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_
6 #define V8_CALL_INTERFACE_DESCRIPTOR_H_ 6 #define V8_CALL_INTERFACE_DESCRIPTOR_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/macro-assembler.h" 9 #include "src/macro-assembler.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 13
14 class PlatformInterfaceDescriptor; 14 class PlatformInterfaceDescriptor;
15 15
16 #define INTERFACE_DESCRIPTOR_LIST(V) \ 16 #define INTERFACE_DESCRIPTOR_LIST(V) \
17 V(Load) \ 17 V(Load) \
18 V(Store) \ 18 V(Store) \
19 V(ElementTransitionAndStore) \ 19 V(ElementTransitionAndStore) \
20 V(Instanceof) \ 20 V(Instanceof) \
21 V(VectorLoadICTrampoline) \
21 V(VectorLoadIC) \ 22 V(VectorLoadIC) \
22 V(FastNewClosure) \ 23 V(FastNewClosure) \
23 V(FastNewContext) \ 24 V(FastNewContext) \
24 V(ToNumber) \ 25 V(ToNumber) \
25 V(NumberToString) \ 26 V(NumberToString) \
26 V(FastCloneShallowArray) \ 27 V(FastCloneShallowArray) \
27 V(FastCloneShallowObject) \ 28 V(FastCloneShallowObject) \
28 V(CreateAllocationSite) \ 29 V(CreateAllocationSite) \
29 V(CallFunction) \ 30 V(CallFunction) \
31 V(CallFunctionWithFeedback) \
30 V(CallConstruct) \ 32 V(CallConstruct) \
31 V(RegExpConstructResult) \ 33 V(RegExpConstructResult) \
32 V(TransitionElementsKind) \ 34 V(TransitionElementsKind) \
33 V(ArrayConstructorConstantArgCount) \ 35 V(ArrayConstructorConstantArgCount) \
34 V(ArrayConstructor) \ 36 V(ArrayConstructor) \
35 V(InternalArrayConstructorConstantArgCount) \ 37 V(InternalArrayConstructorConstantArgCount) \
36 V(InternalArrayConstructor) \ 38 V(InternalArrayConstructor) \
37 V(CompareNil) \ 39 V(CompareNil) \
38 V(ToBoolean) \ 40 V(ToBoolean) \
39 V(BinaryOp) \ 41 V(BinaryOp) \
40 V(BinaryOpWithAllocationSite) \ 42 V(BinaryOpWithAllocationSite) \
41 V(StringAdd) \ 43 V(StringAdd) \
42 V(Keyed) \ 44 V(Keyed) \
43 V(Named) \ 45 V(Named) \
44 V(CallHandler) \ 46 V(CallHandler) \
45 V(ArgumentAdaptor) \ 47 V(ArgumentAdaptor) \
46 V(ApiFunction) 48 V(ApiGetter) \
49 V(ApiFunction) \
50 V(ArgumentsAccessRead) \
51 V(StoreArrayLiteralElement) \
52 V(MathPowTagged) \
53 V(MathPowInteger) \
54 V(ContextOnly)
47 55
48 56
49 class CallInterfaceDescriptorData { 57 class CallInterfaceDescriptorData {
50 public: 58 public:
51 CallInterfaceDescriptorData() : register_param_count_(-1) {} 59 CallInterfaceDescriptorData() : register_param_count_(-1) {}
52 60
53 // A copy of the passed in registers and param_representations is made 61 // A copy of the passed in registers and param_representations is made
54 // and owned by the CallInterfaceDescriptorData. 62 // and owned by the CallInterfaceDescriptorData.
55 63
56 // TODO(mvstanton): Instead of taking parallel arrays register and 64 // TODO(mvstanton): Instead of taking parallel arrays register and
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 const char* DebugName(Isolate* isolate); 165 const char* DebugName(Isolate* isolate);
158 166
159 protected: 167 protected:
160 const CallInterfaceDescriptorData* data() const { return data_; } 168 const CallInterfaceDescriptorData* data() const { return data_; }
161 169
162 private: 170 private:
163 const CallInterfaceDescriptorData* data_; 171 const CallInterfaceDescriptorData* data_;
164 }; 172 };
165 173
166 174
167 #define DECLARE_DESCRIPTOR(name) \ 175 #define DECLARE_DESCRIPTOR(name, base) \
168 explicit name(Isolate* isolate) : CallInterfaceDescriptor(isolate, key()) { \ 176 explicit name(Isolate* isolate) : base(isolate, key()) { \
169 if (!data()->IsInitialized()) \ 177 if (!data()->IsInitialized()) \
170 Initialize(isolate->call_descriptor_data(key())); \ 178 Initialize(isolate->call_descriptor_data(key())); \
171 } \ 179 } \
172 static inline CallDescriptors::Key key(); \ 180 \
173 void Initialize(CallInterfaceDescriptorData* data); 181 protected: \
182 void Initialize(CallInterfaceDescriptorData* data); \
183 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \
184 \
185 public: \
186 static inline CallDescriptors::Key key();
174 187
175 188
189 // LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs.
176 class LoadDescriptor : public CallInterfaceDescriptor { 190 class LoadDescriptor : public CallInterfaceDescriptor {
177 public: 191 public:
178 DECLARE_DESCRIPTOR(LoadDescriptor) 192 DECLARE_DESCRIPTOR(LoadDescriptor, CallInterfaceDescriptor)
179 193
180 enum ParameterIndices { kReceiverIndex, kNameIndex }; 194 enum ParameterIndices { kReceiverIndex, kNameIndex };
181 static const Register ReceiverRegister(); 195 static const Register ReceiverRegister();
182 static const Register NameRegister(); 196 static const Register NameRegister();
183 }; 197 };
184 198
185 199
186 class StoreDescriptor : public CallInterfaceDescriptor { 200 class StoreDescriptor : public CallInterfaceDescriptor {
187 public: 201 public:
188 DECLARE_DESCRIPTOR(StoreDescriptor) 202 DECLARE_DESCRIPTOR(StoreDescriptor, CallInterfaceDescriptor)
189 203
190 enum ParameterIndices { 204 enum ParameterIndices {
191 kReceiverIndex, 205 kReceiverIndex,
192 kNameIndex, 206 kNameIndex,
193 kValueIndex, 207 kValueIndex,
194 kParameterCount 208 kParameterCount
195 }; 209 };
196 static const Register ReceiverRegister(); 210 static const Register ReceiverRegister();
197 static const Register NameRegister(); 211 static const Register NameRegister();
198 static const Register ValueRegister(); 212 static const Register ValueRegister();
199 }; 213 };
200 214
201 215
202 class ElementTransitionAndStoreDescriptor : public CallInterfaceDescriptor { 216 class ElementTransitionAndStoreDescriptor : public StoreDescriptor {
203 public: 217 public:
204 DECLARE_DESCRIPTOR(ElementTransitionAndStoreDescriptor) 218 DECLARE_DESCRIPTOR(ElementTransitionAndStoreDescriptor, StoreDescriptor)
205 219
206 static const Register ReceiverRegister();
207 static const Register NameRegister();
208 static const Register ValueRegister();
209 static const Register MapRegister(); 220 static const Register MapRegister();
210 }; 221 };
211 222
212 223
213 class InstanceofDescriptor : public CallInterfaceDescriptor { 224 class InstanceofDescriptor : public CallInterfaceDescriptor {
214 public: 225 public:
215 DECLARE_DESCRIPTOR(InstanceofDescriptor) 226 DECLARE_DESCRIPTOR(InstanceofDescriptor, CallInterfaceDescriptor)
216 227
217 enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount }; 228 enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
218 static const Register left(); 229 static const Register left();
219 static const Register right(); 230 static const Register right();
220 }; 231 };
221 232
222 233
223 class VectorLoadICDescriptor : public CallInterfaceDescriptor { 234 class VectorLoadICTrampolineDescriptor : public LoadDescriptor {
224 public: 235 public:
225 DECLARE_DESCRIPTOR(VectorLoadICDescriptor) 236 DECLARE_DESCRIPTOR(VectorLoadICTrampolineDescriptor, LoadDescriptor)
237
238 enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex };
239
240 static const Register SlotRegister();
241 };
242
243
244 class VectorLoadICDescriptor : public VectorLoadICTrampolineDescriptor {
245 public:
246 DECLARE_DESCRIPTOR(VectorLoadICDescriptor, VectorLoadICTrampolineDescriptor)
226 247
227 enum ParameterIndices { 248 enum ParameterIndices {
228 kReceiverIndex, 249 kReceiverIndex,
229 kNameIndex, 250 kNameIndex,
230 kSlotIndex, 251 kSlotIndex,
231 kVectorIndex, 252 kVectorIndex
232 kParameterCount
233 }; 253 };
234 254
235 static const Register ReceiverRegister();
236 static const Register NameRegister();
237 static const Register SlotRegister();
238 static const Register VectorRegister(); 255 static const Register VectorRegister();
239 }; 256 };
240 257
241 258
242 class FastNewClosureDescriptor : public CallInterfaceDescriptor { 259 class FastNewClosureDescriptor : public CallInterfaceDescriptor {
243 public: 260 public:
244 DECLARE_DESCRIPTOR(FastNewClosureDescriptor) 261 DECLARE_DESCRIPTOR(FastNewClosureDescriptor, CallInterfaceDescriptor)
245 }; 262 };
246 263
247 264
248 class FastNewContextDescriptor : public CallInterfaceDescriptor { 265 class FastNewContextDescriptor : public CallInterfaceDescriptor {
249 public: 266 public:
250 DECLARE_DESCRIPTOR(FastNewContextDescriptor) 267 DECLARE_DESCRIPTOR(FastNewContextDescriptor, CallInterfaceDescriptor)
251 }; 268 };
252 269
253 270
254 class ToNumberDescriptor : public CallInterfaceDescriptor { 271 class ToNumberDescriptor : public CallInterfaceDescriptor {
255 public: 272 public:
256 DECLARE_DESCRIPTOR(ToNumberDescriptor) 273 DECLARE_DESCRIPTOR(ToNumberDescriptor, CallInterfaceDescriptor)
257 }; 274 };
258 275
259 276
260 class NumberToStringDescriptor : public CallInterfaceDescriptor { 277 class NumberToStringDescriptor : public CallInterfaceDescriptor {
261 public: 278 public:
262 DECLARE_DESCRIPTOR(NumberToStringDescriptor) 279 DECLARE_DESCRIPTOR(NumberToStringDescriptor, CallInterfaceDescriptor)
263 }; 280 };
264 281
265 282
266 class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor { 283 class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor {
267 public: 284 public:
268 DECLARE_DESCRIPTOR(FastCloneShallowArrayDescriptor) 285 DECLARE_DESCRIPTOR(FastCloneShallowArrayDescriptor, CallInterfaceDescriptor)
269 }; 286 };
270 287
271 288
272 class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor { 289 class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor {
273 public: 290 public:
274 DECLARE_DESCRIPTOR(FastCloneShallowObjectDescriptor) 291 DECLARE_DESCRIPTOR(FastCloneShallowObjectDescriptor, CallInterfaceDescriptor)
275 }; 292 };
276 293
277 294
278 class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor { 295 class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor {
279 public: 296 public:
280 DECLARE_DESCRIPTOR(CreateAllocationSiteDescriptor) 297 DECLARE_DESCRIPTOR(CreateAllocationSiteDescriptor, CallInterfaceDescriptor)
281 }; 298 };
282 299
283 300
284 class CallFunctionDescriptor : public CallInterfaceDescriptor { 301 class CallFunctionDescriptor : public CallInterfaceDescriptor {
285 public: 302 public:
286 DECLARE_DESCRIPTOR(CallFunctionDescriptor) 303 DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor)
304 };
305
306
307 class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor {
308 public:
309 DECLARE_DESCRIPTOR(CallFunctionWithFeedbackDescriptor,
310 CallInterfaceDescriptor)
287 }; 311 };
288 312
289 313
290 class CallConstructDescriptor : public CallInterfaceDescriptor { 314 class CallConstructDescriptor : public CallInterfaceDescriptor {
291 public: 315 public:
292 DECLARE_DESCRIPTOR(CallConstructDescriptor) 316 DECLARE_DESCRIPTOR(CallConstructDescriptor, CallInterfaceDescriptor)
293 }; 317 };
294 318
295 319
296 class RegExpConstructResultDescriptor : public CallInterfaceDescriptor { 320 class RegExpConstructResultDescriptor : public CallInterfaceDescriptor {
297 public: 321 public:
298 DECLARE_DESCRIPTOR(RegExpConstructResultDescriptor) 322 DECLARE_DESCRIPTOR(RegExpConstructResultDescriptor, CallInterfaceDescriptor)
299 }; 323 };
300 324
301 325
302 class TransitionElementsKindDescriptor : public CallInterfaceDescriptor { 326 class TransitionElementsKindDescriptor : public CallInterfaceDescriptor {
303 public: 327 public:
304 DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor) 328 DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor, CallInterfaceDescriptor)
305 }; 329 };
306 330
307 331
308 class ArrayConstructorConstantArgCountDescriptor 332 class ArrayConstructorConstantArgCountDescriptor
309 : public CallInterfaceDescriptor { 333 : public CallInterfaceDescriptor {
310 public: 334 public:
311 DECLARE_DESCRIPTOR(ArrayConstructorConstantArgCountDescriptor) 335 DECLARE_DESCRIPTOR(ArrayConstructorConstantArgCountDescriptor,
336 CallInterfaceDescriptor)
312 }; 337 };
313 338
314 339
315 class ArrayConstructorDescriptor : public CallInterfaceDescriptor { 340 class ArrayConstructorDescriptor : public CallInterfaceDescriptor {
316 public: 341 public:
317 DECLARE_DESCRIPTOR(ArrayConstructorDescriptor) 342 DECLARE_DESCRIPTOR(ArrayConstructorDescriptor, CallInterfaceDescriptor)
318 }; 343 };
319 344
320 345
321 class InternalArrayConstructorConstantArgCountDescriptor 346 class InternalArrayConstructorConstantArgCountDescriptor
322 : public CallInterfaceDescriptor { 347 : public CallInterfaceDescriptor {
323 public: 348 public:
324 DECLARE_DESCRIPTOR(InternalArrayConstructorConstantArgCountDescriptor) 349 DECLARE_DESCRIPTOR(InternalArrayConstructorConstantArgCountDescriptor,
350 CallInterfaceDescriptor)
325 }; 351 };
326 352
327 353
328 class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor { 354 class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor {
329 public: 355 public:
330 DECLARE_DESCRIPTOR(InternalArrayConstructorDescriptor) 356 DECLARE_DESCRIPTOR(InternalArrayConstructorDescriptor,
357 CallInterfaceDescriptor)
331 }; 358 };
332 359
333 360
334 class CompareNilDescriptor : public CallInterfaceDescriptor { 361 class CompareNilDescriptor : public CallInterfaceDescriptor {
335 public: 362 public:
336 DECLARE_DESCRIPTOR(CompareNilDescriptor) 363 DECLARE_DESCRIPTOR(CompareNilDescriptor, CallInterfaceDescriptor)
337 }; 364 };
338 365
339 366
340 class ToBooleanDescriptor : public CallInterfaceDescriptor { 367 class ToBooleanDescriptor : public CallInterfaceDescriptor {
341 public: 368 public:
342 DECLARE_DESCRIPTOR(ToBooleanDescriptor) 369 DECLARE_DESCRIPTOR(ToBooleanDescriptor, CallInterfaceDescriptor)
343 }; 370 };
344 371
345 372
346 class BinaryOpDescriptor : public CallInterfaceDescriptor { 373 class BinaryOpDescriptor : public CallInterfaceDescriptor {
347 public: 374 public:
348 DECLARE_DESCRIPTOR(BinaryOpDescriptor) 375 DECLARE_DESCRIPTOR(BinaryOpDescriptor, CallInterfaceDescriptor)
349 }; 376 };
350 377
351 378
352 class BinaryOpWithAllocationSiteDescriptor : public CallInterfaceDescriptor { 379 class BinaryOpWithAllocationSiteDescriptor : public CallInterfaceDescriptor {
353 public: 380 public:
354 DECLARE_DESCRIPTOR(BinaryOpWithAllocationSiteDescriptor) 381 DECLARE_DESCRIPTOR(BinaryOpWithAllocationSiteDescriptor,
382 CallInterfaceDescriptor)
355 }; 383 };
356 384
357 385
358 class StringAddDescriptor : public CallInterfaceDescriptor { 386 class StringAddDescriptor : public CallInterfaceDescriptor {
359 public: 387 public:
360 DECLARE_DESCRIPTOR(StringAddDescriptor) 388 DECLARE_DESCRIPTOR(StringAddDescriptor, CallInterfaceDescriptor)
361 }; 389 };
362 390
363 391
364 class KeyedDescriptor : public CallInterfaceDescriptor { 392 class KeyedDescriptor : public CallInterfaceDescriptor {
365 public: 393 public:
366 DECLARE_DESCRIPTOR(KeyedDescriptor) 394 DECLARE_DESCRIPTOR(KeyedDescriptor, CallInterfaceDescriptor)
367 }; 395 };
368 396
369 397
370 class NamedDescriptor : public CallInterfaceDescriptor { 398 class NamedDescriptor : public CallInterfaceDescriptor {
371 public: 399 public:
372 DECLARE_DESCRIPTOR(NamedDescriptor) 400 DECLARE_DESCRIPTOR(NamedDescriptor, CallInterfaceDescriptor)
373 }; 401 };
374 402
375 403
376 class CallHandlerDescriptor : public CallInterfaceDescriptor { 404 class CallHandlerDescriptor : public CallInterfaceDescriptor {
377 public: 405 public:
378 DECLARE_DESCRIPTOR(CallHandlerDescriptor) 406 DECLARE_DESCRIPTOR(CallHandlerDescriptor, CallInterfaceDescriptor)
379 }; 407 };
380 408
381 409
382 class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor { 410 class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor {
383 public: 411 public:
384 DECLARE_DESCRIPTOR(ArgumentAdaptorDescriptor) 412 DECLARE_DESCRIPTOR(ArgumentAdaptorDescriptor, CallInterfaceDescriptor)
385 }; 413 };
386 414
387 415
388 class ApiFunctionDescriptor : public CallInterfaceDescriptor { 416 class ApiFunctionDescriptor : public CallInterfaceDescriptor {
389 public: 417 public:
390 DECLARE_DESCRIPTOR(ApiFunctionDescriptor) 418 DECLARE_DESCRIPTOR(ApiFunctionDescriptor, CallInterfaceDescriptor)
419 };
420
421
422 class ApiGetterDescriptor : public CallInterfaceDescriptor {
423 public:
424 DECLARE_DESCRIPTOR(ApiGetterDescriptor, CallInterfaceDescriptor)
425
426 static const Register function_address();
427 };
428
429
430 class ArgumentsAccessReadDescriptor : public CallInterfaceDescriptor {
431 public:
432 DECLARE_DESCRIPTOR(ArgumentsAccessReadDescriptor, CallInterfaceDescriptor)
433
434 static const Register index();
435 static const Register parameter_count();
436 };
437
438
439 class StoreArrayLiteralElementDescriptor : public CallInterfaceDescriptor {
440 public:
441 DECLARE_DESCRIPTOR(StoreArrayLiteralElementDescriptor,
442 CallInterfaceDescriptor)
443 };
444
445
446 class MathPowTaggedDescriptor : public CallInterfaceDescriptor {
447 public:
448 DECLARE_DESCRIPTOR(MathPowTaggedDescriptor, CallInterfaceDescriptor)
449
450 static const Register exponent();
451 };
452
453
454 class MathPowIntegerDescriptor : public CallInterfaceDescriptor {
455 public:
456 DECLARE_DESCRIPTOR(MathPowIntegerDescriptor, CallInterfaceDescriptor)
457
458 static const Register exponent();
459 };
460
461
462 class ContextOnlyDescriptor : public CallInterfaceDescriptor {
463 public:
464 DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor)
391 }; 465 };
392 466
393 #undef DECLARE_DESCRIPTOR 467 #undef DECLARE_DESCRIPTOR
394 468
395 469
396 // We define the association between CallDescriptors::Key and the specialized 470 // We define the association between CallDescriptors::Key and the specialized
397 // descriptor here to reduce boilerplate and mistakes. 471 // descriptor here to reduce boilerplate and mistakes.
398 #define DEF_KEY(name) \ 472 #define DEF_KEY(name) \
399 CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; } 473 CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; }
400 INTERFACE_DESCRIPTOR_LIST(DEF_KEY) 474 INTERFACE_DESCRIPTOR_LIST(DEF_KEY)
401 #undef DEF_KEY 475 #undef DEF_KEY
402 } 476 }
403 } // namespace v8::internal 477 } // namespace v8::internal
404 478
405 479
406 #if V8_TARGET_ARCH_ARM64 480 #if V8_TARGET_ARCH_ARM64
407 #include "src/arm64/interface-descriptors-arm64.h" 481 #include "src/arm64/interface-descriptors-arm64.h"
408 #elif V8_TARGET_ARCH_ARM 482 #elif V8_TARGET_ARCH_ARM
409 #include "src/arm/interface-descriptors-arm.h" 483 #include "src/arm/interface-descriptors-arm.h"
410 #endif 484 #endif
411 485
412 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ 486 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_
OLDNEW
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/interface-descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698