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

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

Issue 2172223002: [stubs] Call interface descriptors cleanup. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@store-ic-tf
Patch Set: Addressing comments Created 4 years, 4 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/ic/ic.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 <memory> 8 #include <memory>
9 9
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ 278 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
279 protected: \ 279 protected: \
280 FunctionType* BuildCallInterfaceDescriptorFunctionType( \ 280 FunctionType* BuildCallInterfaceDescriptorFunctionType( \
281 Isolate* isolate, int register_param_count) override { \ 281 Isolate* isolate, int register_param_count) override { \
282 return BuildCallInterfaceDescriptorFunctionTypeWithArg( \ 282 return BuildCallInterfaceDescriptorFunctionTypeWithArg( \
283 isolate, register_param_count, arg); \ 283 isolate, register_param_count, arg); \
284 } \ 284 } \
285 \ 285 \
286 public: 286 public:
287 287
288 #define DEFINE_PARAMETERS(...) \
289 enum ParameterIndices { \
290 __VA_ARGS__, \
291 \
292 kParameterCount, \
293 kContext = kParameterCount /* implicit parameter */ \
294 };
295
288 class VoidDescriptor : public CallInterfaceDescriptor { 296 class VoidDescriptor : public CallInterfaceDescriptor {
289 public: 297 public:
290 DECLARE_DESCRIPTOR(VoidDescriptor, CallInterfaceDescriptor) 298 DECLARE_DESCRIPTOR(VoidDescriptor, CallInterfaceDescriptor)
291 }; 299 };
292 300
293 class ContextOnlyDescriptor : public CallInterfaceDescriptor { 301 class ContextOnlyDescriptor : public CallInterfaceDescriptor {
294 public: 302 public:
295 DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor) 303 DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor)
296 }; 304 };
297 305
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 class OnStackWith7ArgsDescriptor : public OnStackArgsDescriptorBase { 366 class OnStackWith7ArgsDescriptor : public OnStackArgsDescriptorBase {
359 public: 367 public:
360 DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(OnStackWith7ArgsDescriptor, 368 DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(OnStackWith7ArgsDescriptor,
361 OnStackArgsDescriptorBase, 369 OnStackArgsDescriptorBase,
362 7) 370 7)
363 }; 371 };
364 372
365 // LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs. 373 // LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs.
366 class LoadDescriptor : public CallInterfaceDescriptor { 374 class LoadDescriptor : public CallInterfaceDescriptor {
367 public: 375 public:
376 DEFINE_PARAMETERS(kReceiver, kName, kSlot)
368 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadDescriptor, 377 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadDescriptor,
369 CallInterfaceDescriptor) 378 CallInterfaceDescriptor)
370 379
371 enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex };
372 static const Register ReceiverRegister(); 380 static const Register ReceiverRegister();
373 static const Register NameRegister(); 381 static const Register NameRegister();
374 static const Register SlotRegister(); 382 static const Register SlotRegister();
375 }; 383 };
376 384
377 class LoadGlobalDescriptor : public CallInterfaceDescriptor { 385 class LoadGlobalDescriptor : public CallInterfaceDescriptor {
378 public: 386 public:
387 DEFINE_PARAMETERS(kSlot)
379 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadGlobalDescriptor, 388 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadGlobalDescriptor,
380 CallInterfaceDescriptor) 389 CallInterfaceDescriptor)
381 390
382 enum ParameterIndices { kSlotIndex };
383
384 static const Register SlotRegister() { 391 static const Register SlotRegister() {
385 return LoadDescriptor::SlotRegister(); 392 return LoadDescriptor::SlotRegister();
386 } 393 }
387 }; 394 };
388 395
389 class StoreDescriptor : public CallInterfaceDescriptor { 396 class StoreDescriptor : public CallInterfaceDescriptor {
390 public: 397 public:
398 DEFINE_PARAMETERS(kReceiver, kName, kValue, kSlot)
391 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreDescriptor, 399 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreDescriptor,
392 CallInterfaceDescriptor) 400 CallInterfaceDescriptor)
393 401
394 enum ParameterIndices { kReceiverIndex, kNameIndex, kValueIndex, kSlotIndex };
395
396 static const Register ReceiverRegister(); 402 static const Register ReceiverRegister();
397 static const Register NameRegister(); 403 static const Register NameRegister();
398 static const Register ValueRegister(); 404 static const Register ValueRegister();
399 static const Register SlotRegister(); 405 static const Register SlotRegister();
400 }; 406 };
401 407
402 408
403 class StoreTransitionDescriptor : public StoreDescriptor { 409 class StoreTransitionDescriptor : public StoreDescriptor {
404 public: 410 public:
411 DEFINE_PARAMETERS(kReceiver, kName, kValue, kMap)
405 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreTransitionDescriptor, 412 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreTransitionDescriptor,
406 StoreDescriptor) 413 StoreDescriptor)
407 414
408 // Extends StoreDescriptor with Map parameter.
409 enum ParameterIndices {
410 kReceiverIndex,
411 kNameIndex,
412 kValueIndex,
413 kMapIndex,
414 kParameterCount
415 };
416
417 static const Register MapRegister(); 415 static const Register MapRegister();
418 }; 416 };
419 417
420 418
421 class VectorStoreTransitionDescriptor : public StoreDescriptor { 419 class VectorStoreTransitionDescriptor : public StoreDescriptor {
422 public: 420 public:
423 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(VectorStoreTransitionDescriptor, 421 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(VectorStoreTransitionDescriptor,
424 StoreDescriptor) 422 StoreDescriptor)
425 423
424 // TODO(ishell): use DEFINE_PARAMETERS macro here
426 // Extends StoreDescriptor with Map parameter. 425 // Extends StoreDescriptor with Map parameter.
427 enum ParameterIndices { 426 enum ParameterIndices {
428 kReceiverIndex = 0, 427 kReceiver = 0,
429 kNameIndex = 1, 428 kName = 1,
430 kValueIndex = 2, 429 kValue = 2,
431 430
432 kMapIndex = 3, 431 kMap = 3,
433 432
434 kSlotIndex = 4, // not present on ia32. 433 kSlot = 4, // not present on ia32.
435 kVirtualSlotVectorIndex = 4, 434 kVirtualSlotVector = 4,
436 435
437 kVectorIndex = 5 436 kVector = 5
438 }; 437 };
439 438
440 static const Register MapRegister(); 439 static const Register MapRegister();
441 static const Register SlotRegister(); 440 static const Register SlotRegister();
442 static const Register VectorRegister(); 441 static const Register VectorRegister();
443 }; 442 };
444 443
445 class StoreWithVectorDescriptor : public StoreDescriptor { 444 class StoreWithVectorDescriptor : public StoreDescriptor {
446 public: 445 public:
446 DEFINE_PARAMETERS(kReceiver, kName, kValue, kSlot, kVector)
447 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreWithVectorDescriptor, 447 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreWithVectorDescriptor,
448 StoreDescriptor) 448 StoreDescriptor)
449 449
450 enum ParameterIndices {
451 kReceiverIndex,
452 kNameIndex,
453 kValueIndex,
454 kSlotIndex,
455 kVectorIndex
456 };
457
458 static const Register VectorRegister(); 450 static const Register VectorRegister();
459 }; 451 };
460 452
461
462 class LoadWithVectorDescriptor : public LoadDescriptor { 453 class LoadWithVectorDescriptor : public LoadDescriptor {
463 public: 454 public:
455 DEFINE_PARAMETERS(kReceiver, kName, kSlot, kVector)
464 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadWithVectorDescriptor, 456 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadWithVectorDescriptor,
465 LoadDescriptor) 457 LoadDescriptor)
466 458
467 enum ParameterIndices {
468 kReceiverIndex,
469 kNameIndex,
470 kSlotIndex,
471 kVectorIndex
472 };
473
474 static const Register VectorRegister(); 459 static const Register VectorRegister();
475 }; 460 };
476 461
477 class LoadGlobalWithVectorDescriptor : public LoadGlobalDescriptor { 462 class LoadGlobalWithVectorDescriptor : public LoadGlobalDescriptor {
478 public: 463 public:
464 DEFINE_PARAMETERS(kSlot, kVector)
479 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadGlobalWithVectorDescriptor, 465 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadGlobalWithVectorDescriptor,
480 LoadGlobalDescriptor) 466 LoadGlobalDescriptor)
481 467
482 enum ParameterIndices { kSlotIndex, kVectorIndex };
483
484 static const Register VectorRegister() { 468 static const Register VectorRegister() {
485 return LoadWithVectorDescriptor::VectorRegister(); 469 return LoadWithVectorDescriptor::VectorRegister();
486 } 470 }
487 }; 471 };
488 472
489 class FastNewClosureDescriptor : public CallInterfaceDescriptor { 473 class FastNewClosureDescriptor : public CallInterfaceDescriptor {
490 public: 474 public:
491 DECLARE_DESCRIPTOR(FastNewClosureDescriptor, CallInterfaceDescriptor) 475 DECLARE_DESCRIPTOR(FastNewClosureDescriptor, CallInterfaceDescriptor)
492 }; 476 };
493 477
494 class FastNewFunctionContextDescriptor : public CallInterfaceDescriptor { 478 class FastNewFunctionContextDescriptor : public CallInterfaceDescriptor {
495 public: 479 public:
480 DEFINE_PARAMETERS(kFunction)
496 DECLARE_DESCRIPTOR(FastNewFunctionContextDescriptor, CallInterfaceDescriptor) 481 DECLARE_DESCRIPTOR(FastNewFunctionContextDescriptor, CallInterfaceDescriptor)
497 enum ParameterIndices { kFunctionIndex, kContextIndex };
498 }; 482 };
499 483
500 class FastNewObjectDescriptor : public CallInterfaceDescriptor { 484 class FastNewObjectDescriptor : public CallInterfaceDescriptor {
501 public: 485 public:
502 DECLARE_DESCRIPTOR(FastNewObjectDescriptor, CallInterfaceDescriptor) 486 DECLARE_DESCRIPTOR(FastNewObjectDescriptor, CallInterfaceDescriptor)
503 }; 487 };
504 488
505 class FastNewRestParameterDescriptor : public CallInterfaceDescriptor { 489 class FastNewRestParameterDescriptor : public CallInterfaceDescriptor {
506 public: 490 public:
507 DECLARE_DESCRIPTOR(FastNewRestParameterDescriptor, CallInterfaceDescriptor) 491 DECLARE_DESCRIPTOR(FastNewRestParameterDescriptor, CallInterfaceDescriptor)
508 }; 492 };
509 493
510 class FastNewSloppyArgumentsDescriptor : public CallInterfaceDescriptor { 494 class FastNewSloppyArgumentsDescriptor : public CallInterfaceDescriptor {
511 public: 495 public:
512 DECLARE_DESCRIPTOR(FastNewSloppyArgumentsDescriptor, 496 DECLARE_DESCRIPTOR(FastNewSloppyArgumentsDescriptor,
513 CallInterfaceDescriptor) 497 CallInterfaceDescriptor)
514 }; 498 };
515 499
516 class FastNewStrictArgumentsDescriptor : public CallInterfaceDescriptor { 500 class FastNewStrictArgumentsDescriptor : public CallInterfaceDescriptor {
517 public: 501 public:
518 DECLARE_DESCRIPTOR(FastNewStrictArgumentsDescriptor, 502 DECLARE_DESCRIPTOR(FastNewStrictArgumentsDescriptor,
519 CallInterfaceDescriptor) 503 CallInterfaceDescriptor)
520 }; 504 };
521 505
522 class TypeConversionDescriptor final : public CallInterfaceDescriptor { 506 class TypeConversionDescriptor final : public CallInterfaceDescriptor {
523 public: 507 public:
524 enum ParameterIndices { kArgumentIndex }; 508 DEFINE_PARAMETERS(kArgument)
525
526 DECLARE_DESCRIPTOR(TypeConversionDescriptor, CallInterfaceDescriptor) 509 DECLARE_DESCRIPTOR(TypeConversionDescriptor, CallInterfaceDescriptor)
527 510
528 static const Register ArgumentRegister(); 511 static const Register ArgumentRegister();
529 }; 512 };
530 513
531 class HasPropertyDescriptor final : public CallInterfaceDescriptor { 514 class HasPropertyDescriptor final : public CallInterfaceDescriptor {
532 public: 515 public:
533 enum ParameterIndices { kKeyIndex, kObjectIndex }; 516 DEFINE_PARAMETERS(kKey, kObject)
534 517 DECLARE_DEFAULT_DESCRIPTOR(HasPropertyDescriptor, CallInterfaceDescriptor,
535 DECLARE_DEFAULT_DESCRIPTOR(HasPropertyDescriptor, CallInterfaceDescriptor, 2) 518 kParameterCount)
536 }; 519 };
537 520
538 class ForInFilterDescriptor final : public CallInterfaceDescriptor { 521 class ForInFilterDescriptor final : public CallInterfaceDescriptor {
539 public: 522 public:
540 enum ParameterIndices { kKeyIndex, kObjectIndex }; 523 DEFINE_PARAMETERS(kKey, kObject)
541 524 DECLARE_DEFAULT_DESCRIPTOR(ForInFilterDescriptor, CallInterfaceDescriptor,
542 DECLARE_DEFAULT_DESCRIPTOR(ForInFilterDescriptor, CallInterfaceDescriptor, 2) 525 kParameterCount)
543 }; 526 };
544 527
545 class GetPropertyDescriptor final : public CallInterfaceDescriptor { 528 class GetPropertyDescriptor final : public CallInterfaceDescriptor {
546 public: 529 public:
547 enum ParameterIndices { kObjectIndex, kKeyIndex }; 530 DEFINE_PARAMETERS(kObject, kKey)
548 531 DECLARE_DEFAULT_DESCRIPTOR(GetPropertyDescriptor, CallInterfaceDescriptor,
549 DECLARE_DEFAULT_DESCRIPTOR(GetPropertyDescriptor, CallInterfaceDescriptor, 2) 532 kParameterCount)
550 }; 533 };
551 534
552 class TypeofDescriptor : public CallInterfaceDescriptor { 535 class TypeofDescriptor : public CallInterfaceDescriptor {
553 public: 536 public:
537 DEFINE_PARAMETERS(kObject)
554 DECLARE_DESCRIPTOR(TypeofDescriptor, CallInterfaceDescriptor) 538 DECLARE_DESCRIPTOR(TypeofDescriptor, CallInterfaceDescriptor)
555 }; 539 };
556 540
557 541
558 class FastCloneRegExpDescriptor : public CallInterfaceDescriptor { 542 class FastCloneRegExpDescriptor : public CallInterfaceDescriptor {
559 public: 543 public:
544 DEFINE_PARAMETERS(kClosure, kLiteralIndex, kPattern, kFlags)
560 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneRegExpDescriptor, 545 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneRegExpDescriptor,
561 CallInterfaceDescriptor) 546 CallInterfaceDescriptor)
562 }; 547 };
563 548
564 549
565 class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor { 550 class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor {
566 public: 551 public:
552 DEFINE_PARAMETERS(kClosure, kLiteralIndex, kConstantElements)
567 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneShallowArrayDescriptor, 553 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneShallowArrayDescriptor,
568 CallInterfaceDescriptor) 554 CallInterfaceDescriptor)
569 }; 555 };
570 556
571 557
572 class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor { 558 class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor {
573 public: 559 public:
574 DECLARE_DESCRIPTOR(FastCloneShallowObjectDescriptor, CallInterfaceDescriptor) 560 DECLARE_DESCRIPTOR(FastCloneShallowObjectDescriptor, CallInterfaceDescriptor)
575 }; 561 };
576 562
577 563
578 class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor { 564 class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor {
579 public: 565 public:
566 DEFINE_PARAMETERS(kVector, kSlot)
580 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateAllocationSiteDescriptor, 567 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateAllocationSiteDescriptor,
581 CallInterfaceDescriptor) 568 CallInterfaceDescriptor)
582 }; 569 };
583 570
584 571
585 class CreateWeakCellDescriptor : public CallInterfaceDescriptor { 572 class CreateWeakCellDescriptor : public CallInterfaceDescriptor {
586 public: 573 public:
587 enum ParameterIndices { 574 DEFINE_PARAMETERS(kVector, kSlot, kValue)
588 kVectorIndex,
589 kSlotIndex,
590 kValueIndex,
591 kParameterCount
592 };
593
594 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateWeakCellDescriptor, 575 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateWeakCellDescriptor,
595 CallInterfaceDescriptor) 576 CallInterfaceDescriptor)
596 }; 577 };
597 578
598 579
599 class CallTrampolineDescriptor : public CallInterfaceDescriptor { 580 class CallTrampolineDescriptor : public CallInterfaceDescriptor {
600 public: 581 public:
582 DEFINE_PARAMETERS(kFunction, kActualArgumentsCount)
601 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CallTrampolineDescriptor, 583 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CallTrampolineDescriptor,
602 CallInterfaceDescriptor) 584 CallInterfaceDescriptor)
603 }; 585 };
604 586
605 587
606 class ConstructStubDescriptor : public CallInterfaceDescriptor { 588 class ConstructStubDescriptor : public CallInterfaceDescriptor {
607 public: 589 public:
590 DEFINE_PARAMETERS(kFunction, kNewTarget, kActualArgumentsCount,
591 kAllocationSite)
608 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ConstructStubDescriptor, 592 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ConstructStubDescriptor,
609 CallInterfaceDescriptor) 593 CallInterfaceDescriptor)
610 }; 594 };
611 595
612 596
613 class ConstructTrampolineDescriptor : public CallInterfaceDescriptor { 597 class ConstructTrampolineDescriptor : public CallInterfaceDescriptor {
614 public: 598 public:
599 DEFINE_PARAMETERS(kFunction, kNewTarget, kActualArgumentsCount)
615 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ConstructTrampolineDescriptor, 600 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ConstructTrampolineDescriptor,
616 CallInterfaceDescriptor) 601 CallInterfaceDescriptor)
617 }; 602 };
618 603
619 604
620 class CallFunctionDescriptor : public CallInterfaceDescriptor { 605 class CallFunctionDescriptor : public CallInterfaceDescriptor {
621 public: 606 public:
622 DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor) 607 DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor)
623 }; 608 };
624 609
625 610
626 class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor { 611 class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor {
627 public: 612 public:
613 DEFINE_PARAMETERS(kFunction, kSlot)
628 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( 614 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
629 CallFunctionWithFeedbackDescriptor, CallInterfaceDescriptor) 615 CallFunctionWithFeedbackDescriptor, CallInterfaceDescriptor)
630 }; 616 };
631 617
632 618
633 class CallFunctionWithFeedbackAndVectorDescriptor 619 class CallFunctionWithFeedbackAndVectorDescriptor
634 : public CallInterfaceDescriptor { 620 : public CallInterfaceDescriptor {
635 public: 621 public:
622 DEFINE_PARAMETERS(kFunction, kSlot, kVector)
636 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( 623 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
637 CallFunctionWithFeedbackAndVectorDescriptor, CallInterfaceDescriptor) 624 CallFunctionWithFeedbackAndVectorDescriptor, CallInterfaceDescriptor)
638 }; 625 };
639 626
640 627
641 class CallConstructDescriptor : public CallInterfaceDescriptor { 628 class CallConstructDescriptor : public CallInterfaceDescriptor {
642 public: 629 public:
643 DECLARE_DESCRIPTOR(CallConstructDescriptor, CallInterfaceDescriptor) 630 DECLARE_DESCRIPTOR(CallConstructDescriptor, CallInterfaceDescriptor)
644 }; 631 };
645 632
646 633
647 class RegExpConstructResultDescriptor : public CallInterfaceDescriptor { 634 class RegExpConstructResultDescriptor : public CallInterfaceDescriptor {
648 public: 635 public:
636 DEFINE_PARAMETERS(kLength, kIndex, kInput)
649 DECLARE_DESCRIPTOR(RegExpConstructResultDescriptor, CallInterfaceDescriptor) 637 DECLARE_DESCRIPTOR(RegExpConstructResultDescriptor, CallInterfaceDescriptor)
650 }; 638 };
651 639
652 640
653 class StoreGlobalViaContextDescriptor : public CallInterfaceDescriptor { 641 class StoreGlobalViaContextDescriptor : public CallInterfaceDescriptor {
654 public: 642 public:
643 DEFINE_PARAMETERS(kSlot, kValue)
655 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreGlobalViaContextDescriptor, 644 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreGlobalViaContextDescriptor,
656 CallInterfaceDescriptor) 645 CallInterfaceDescriptor)
657 646
658 static const Register SlotRegister(); 647 static const Register SlotRegister();
659 static const Register ValueRegister(); 648 static const Register ValueRegister();
660 }; 649 };
661 650
662 651
663 class TransitionElementsKindDescriptor : public CallInterfaceDescriptor { 652 class TransitionElementsKindDescriptor : public CallInterfaceDescriptor {
664 public: 653 public:
654 DEFINE_PARAMETERS(kObject, kMap)
665 DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor, CallInterfaceDescriptor) 655 DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor, CallInterfaceDescriptor)
666 }; 656 };
667 657
668 658
669 class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor { 659 class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor {
670 public: 660 public:
671 DECLARE_DESCRIPTOR(AllocateHeapNumberDescriptor, CallInterfaceDescriptor) 661 DECLARE_DESCRIPTOR(AllocateHeapNumberDescriptor, CallInterfaceDescriptor)
672 }; 662 };
673 663
674 #define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \ 664 #define SIMD128_ALLOC_DESC(TYPE, Type, type, lane_count, lane_type) \
675 class Allocate##Type##Descriptor : public CallInterfaceDescriptor { \ 665 class Allocate##Type##Descriptor : public CallInterfaceDescriptor { \
676 public: \ 666 public: \
677 DECLARE_DESCRIPTOR(Allocate##Type##Descriptor, CallInterfaceDescriptor) \ 667 DECLARE_DESCRIPTOR(Allocate##Type##Descriptor, CallInterfaceDescriptor) \
678 }; 668 };
679 SIMD128_TYPES(SIMD128_ALLOC_DESC) 669 SIMD128_TYPES(SIMD128_ALLOC_DESC)
680 #undef SIMD128_ALLOC_DESC 670 #undef SIMD128_ALLOC_DESC
681 671
682 class ArrayNoArgumentConstructorDescriptor : public CallInterfaceDescriptor { 672 class ArrayNoArgumentConstructorDescriptor : public CallInterfaceDescriptor {
683 public: 673 public:
674 DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount,
675 kFunctionParameter)
684 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( 676 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
685 ArrayNoArgumentConstructorDescriptor, CallInterfaceDescriptor) 677 ArrayNoArgumentConstructorDescriptor, CallInterfaceDescriptor)
686 enum ParameterIndices {
687 kFunctionIndex,
688 kAllocationSiteIndex,
689 kArgumentCountIndex,
690 kFunctionParameterIndex,
691 kContextIndex
692 };
693 }; 678 };
694 679
695 class ArraySingleArgumentConstructorDescriptor 680 class ArraySingleArgumentConstructorDescriptor
696 : public CallInterfaceDescriptor { 681 : public CallInterfaceDescriptor {
697 public: 682 public:
683 DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount,
684 kFunctionParameter, kArraySizeSmiParameter)
698 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( 685 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
699 ArraySingleArgumentConstructorDescriptor, CallInterfaceDescriptor) 686 ArraySingleArgumentConstructorDescriptor, CallInterfaceDescriptor)
700 enum ParameterIndices {
701 kFunctionIndex,
702 kAllocationSiteIndex,
703 kArgumentCountIndex,
704 kFunctionParameterIndex,
705 kArraySizeSmiParameterIndex,
706 kContextIndex
707 };
708 }; 687 };
709 688
710 class ArrayNArgumentsConstructorDescriptor : public CallInterfaceDescriptor { 689 class ArrayNArgumentsConstructorDescriptor : public CallInterfaceDescriptor {
711 public: 690 public:
691 DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount)
712 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE( 692 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
713 ArrayNArgumentsConstructorDescriptor, CallInterfaceDescriptor) 693 ArrayNArgumentsConstructorDescriptor, CallInterfaceDescriptor)
714 enum ParameterIndices {
715 kFunctionIndex,
716 kAllocationSiteIndex,
717 kArgumentCountIndex,
718 kContextIndex
719 };
720 }; 694 };
721 695
722 696
723 class CompareDescriptor : public CallInterfaceDescriptor { 697 class CompareDescriptor : public CallInterfaceDescriptor {
724 public: 698 public:
699 DEFINE_PARAMETERS(kLeft, kRight)
725 DECLARE_DESCRIPTOR(CompareDescriptor, CallInterfaceDescriptor) 700 DECLARE_DESCRIPTOR(CompareDescriptor, CallInterfaceDescriptor)
726 }; 701 };
727 702
728 703
729 class BinaryOpDescriptor : public CallInterfaceDescriptor { 704 class BinaryOpDescriptor : public CallInterfaceDescriptor {
730 public: 705 public:
706 DEFINE_PARAMETERS(kLeft, kRight)
731 DECLARE_DESCRIPTOR(BinaryOpDescriptor, CallInterfaceDescriptor) 707 DECLARE_DESCRIPTOR(BinaryOpDescriptor, CallInterfaceDescriptor)
732 }; 708 };
733 709
734 710
735 class BinaryOpWithAllocationSiteDescriptor : public CallInterfaceDescriptor { 711 class BinaryOpWithAllocationSiteDescriptor : public CallInterfaceDescriptor {
736 public: 712 public:
713 DEFINE_PARAMETERS(kAllocationSite, kLeft, kRight)
737 DECLARE_DESCRIPTOR(BinaryOpWithAllocationSiteDescriptor, 714 DECLARE_DESCRIPTOR(BinaryOpWithAllocationSiteDescriptor,
738 CallInterfaceDescriptor) 715 CallInterfaceDescriptor)
739 }; 716 };
740 717
741 class CountOpDescriptor final : public CallInterfaceDescriptor { 718 class CountOpDescriptor final : public CallInterfaceDescriptor {
742 public: 719 public:
743 DECLARE_DESCRIPTOR(CountOpDescriptor, CallInterfaceDescriptor) 720 DECLARE_DESCRIPTOR(CountOpDescriptor, CallInterfaceDescriptor)
744 }; 721 };
745 722
746 class StringAddDescriptor : public CallInterfaceDescriptor { 723 class StringAddDescriptor : public CallInterfaceDescriptor {
747 public: 724 public:
725 DEFINE_PARAMETERS(kLeft, kRight)
748 DECLARE_DESCRIPTOR(StringAddDescriptor, CallInterfaceDescriptor) 726 DECLARE_DESCRIPTOR(StringAddDescriptor, CallInterfaceDescriptor)
749 }; 727 };
750 728
751 729
752 class StringCompareDescriptor : public CallInterfaceDescriptor { 730 class StringCompareDescriptor : public CallInterfaceDescriptor {
753 public: 731 public:
732 DEFINE_PARAMETERS(kLeft, kRight)
754 DECLARE_DESCRIPTOR(StringCompareDescriptor, CallInterfaceDescriptor) 733 DECLARE_DESCRIPTOR(StringCompareDescriptor, CallInterfaceDescriptor)
755 734
756 enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
757 static const Register LeftRegister(); 735 static const Register LeftRegister();
758 static const Register RightRegister(); 736 static const Register RightRegister();
759 }; 737 };
760 738
761 739 // TODO(ishell): not used, remove.
762 class KeyedDescriptor : public CallInterfaceDescriptor { 740 class KeyedDescriptor : public CallInterfaceDescriptor {
763 public: 741 public:
764 DECLARE_DESCRIPTOR(KeyedDescriptor, CallInterfaceDescriptor) 742 DECLARE_DESCRIPTOR(KeyedDescriptor, CallInterfaceDescriptor)
765 }; 743 };
766 744
767 745 // TODO(ishell): not used, remove
768 class NamedDescriptor : public CallInterfaceDescriptor { 746 class NamedDescriptor : public CallInterfaceDescriptor {
769 public: 747 public:
770 DECLARE_DESCRIPTOR(NamedDescriptor, CallInterfaceDescriptor) 748 DECLARE_DESCRIPTOR(NamedDescriptor, CallInterfaceDescriptor)
771 }; 749 };
772 750
773 751 // TODO(ishell): not used, remove.
774 class CallHandlerDescriptor : public CallInterfaceDescriptor { 752 class CallHandlerDescriptor : public CallInterfaceDescriptor {
775 public: 753 public:
776 DECLARE_DESCRIPTOR(CallHandlerDescriptor, CallInterfaceDescriptor) 754 DECLARE_DESCRIPTOR(CallHandlerDescriptor, CallInterfaceDescriptor)
777 }; 755 };
778 756
779 757
780 class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor { 758 class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor {
781 public: 759 public:
760 DEFINE_PARAMETERS(kFunction, kNewTarget, kActualArgumentsCount,
761 kExpectedArgumentsCount)
782 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentAdaptorDescriptor, 762 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentAdaptorDescriptor,
783 CallInterfaceDescriptor) 763 CallInterfaceDescriptor)
784 }; 764 };
785 765
786 // The ApiCallback*Descriptors have a lot of boilerplate. The superclass 766 // The ApiCallback*Descriptors have a lot of boilerplate. The superclass
787 // ApiCallbackDescriptorBase contains all the logic, and the 767 // ApiCallbackDescriptorBase contains all the logic, and the
788 // ApiCallbackWith*ArgsDescriptor merely instantiate these with a 768 // ApiCallbackWith*ArgsDescriptor merely instantiate these with a
789 // parameter for the number of args. 769 // parameter for the number of args.
790 // 770 //
791 // The base class is not meant to be instantiated directly and has no 771 // The base class is not meant to be instantiated directly and has no
792 // public constructors to ensure this is so. 772 // public constructors to ensure this is so.
793 // 773 //
794 // The simplest usage for all the ApiCallback*Descriptors is probably 774 // The simplest usage for all the ApiCallback*Descriptors is probably
795 // ApiCallbackDescriptorBase::ForArgs(isolate, argc) 775 // ApiCallbackDescriptorBase::ForArgs(isolate, argc)
796 // 776 //
797 class ApiCallbackDescriptorBase : public CallInterfaceDescriptor { 777 class ApiCallbackDescriptorBase : public CallInterfaceDescriptor {
798 public: 778 public:
779 DEFINE_PARAMETERS(kFunction, kCallData, kHolder, kApiFunctionAddress)
799 static CallInterfaceDescriptor ForArgs(Isolate* isolate, int argc); 780 static CallInterfaceDescriptor ForArgs(Isolate* isolate, int argc);
800 781
801 protected: 782 protected:
802 ApiCallbackDescriptorBase(Isolate* isolate, CallDescriptors::Key key) 783 ApiCallbackDescriptorBase(Isolate* isolate, CallDescriptors::Key key)
803 : CallInterfaceDescriptor(isolate, key) {} 784 : CallInterfaceDescriptor(isolate, key) {}
804 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; 785 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override;
805 FunctionType* BuildCallInterfaceDescriptorFunctionTypeWithArg( 786 FunctionType* BuildCallInterfaceDescriptorFunctionTypeWithArg(
806 Isolate* isolate, int parameter_count, int argc); 787 Isolate* isolate, int parameter_count, int argc);
807 }; 788 };
808 789
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 831
851 class ApiCallbackWith7ArgsDescriptor : public ApiCallbackDescriptorBase { 832 class ApiCallbackWith7ArgsDescriptor : public ApiCallbackDescriptorBase {
852 public: 833 public:
853 DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG( 834 DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG(
854 ApiCallbackWith7ArgsDescriptor, ApiCallbackDescriptorBase, 7) 835 ApiCallbackWith7ArgsDescriptor, ApiCallbackDescriptorBase, 7)
855 }; 836 };
856 837
857 838
858 class ApiGetterDescriptor : public CallInterfaceDescriptor { 839 class ApiGetterDescriptor : public CallInterfaceDescriptor {
859 public: 840 public:
841 DEFINE_PARAMETERS(kReceiver, kHolder, kCallback)
860 DECLARE_DESCRIPTOR(ApiGetterDescriptor, CallInterfaceDescriptor) 842 DECLARE_DESCRIPTOR(ApiGetterDescriptor, CallInterfaceDescriptor)
861 843
862 static const Register ReceiverRegister(); 844 static const Register ReceiverRegister();
863 static const Register HolderRegister(); 845 static const Register HolderRegister();
864 static const Register CallbackRegister(); 846 static const Register CallbackRegister();
865 }; 847 };
866 848
867 class MathPowTaggedDescriptor : public CallInterfaceDescriptor { 849 class MathPowTaggedDescriptor : public CallInterfaceDescriptor {
868 public: 850 public:
851 DEFINE_PARAMETERS(kExponent)
869 DECLARE_DESCRIPTOR(MathPowTaggedDescriptor, CallInterfaceDescriptor) 852 DECLARE_DESCRIPTOR(MathPowTaggedDescriptor, CallInterfaceDescriptor)
870 853
871 static const Register exponent(); 854 static const Register exponent();
872 }; 855 };
873 856
874 class MathPowIntegerDescriptor : public CallInterfaceDescriptor { 857 class MathPowIntegerDescriptor : public CallInterfaceDescriptor {
875 public: 858 public:
859 DEFINE_PARAMETERS(kExponent)
876 DECLARE_DESCRIPTOR(MathPowIntegerDescriptor, CallInterfaceDescriptor) 860 DECLARE_DESCRIPTOR(MathPowIntegerDescriptor, CallInterfaceDescriptor)
877 861
878 static const Register exponent(); 862 static const Register exponent();
879 }; 863 };
880 864
881 class VarArgFunctionDescriptor : public CallInterfaceDescriptor { 865 class VarArgFunctionDescriptor : public CallInterfaceDescriptor {
882 public: 866 public:
867 DEFINE_PARAMETERS(kActualArgumentsCount)
883 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(VarArgFunctionDescriptor, 868 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(VarArgFunctionDescriptor,
884 CallInterfaceDescriptor) 869 CallInterfaceDescriptor)
885 }; 870 };
886 871
887 class GrowArrayElementsDescriptor : public CallInterfaceDescriptor { 872 class GrowArrayElementsDescriptor : public CallInterfaceDescriptor {
888 public: 873 public:
874 DEFINE_PARAMETERS(kObject, kKey)
889 DECLARE_DESCRIPTOR(GrowArrayElementsDescriptor, CallInterfaceDescriptor) 875 DECLARE_DESCRIPTOR(GrowArrayElementsDescriptor, CallInterfaceDescriptor)
890 876
891 enum RegisterInfo { kObjectIndex, kKeyIndex };
892 static const Register ObjectRegister(); 877 static const Register ObjectRegister();
893 static const Register KeyRegister(); 878 static const Register KeyRegister();
894 }; 879 };
895 880
896 class InterpreterDispatchDescriptor : public CallInterfaceDescriptor { 881 class InterpreterDispatchDescriptor : public CallInterfaceDescriptor {
897 public: 882 public:
883 DEFINE_PARAMETERS(kAccumulator, kBytecodeOffset, kBytecodeArray,
884 kDispatchTable)
898 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(InterpreterDispatchDescriptor, 885 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(InterpreterDispatchDescriptor,
899 CallInterfaceDescriptor) 886 CallInterfaceDescriptor)
900
901 static const int kAccumulatorParameter = 0;
902 static const int kBytecodeOffsetParameter = 1;
903 static const int kBytecodeArrayParameter = 2;
904 static const int kDispatchTableParameter = 3;
905 }; 887 };
906 888
907 class InterpreterPushArgsAndCallDescriptor : public CallInterfaceDescriptor { 889 class InterpreterPushArgsAndCallDescriptor : public CallInterfaceDescriptor {
908 public: 890 public:
909 DECLARE_DESCRIPTOR(InterpreterPushArgsAndCallDescriptor, 891 DECLARE_DESCRIPTOR(InterpreterPushArgsAndCallDescriptor,
910 CallInterfaceDescriptor) 892 CallInterfaceDescriptor)
911 }; 893 };
912 894
913 895
914 class InterpreterPushArgsAndConstructDescriptor 896 class InterpreterPushArgsAndConstructDescriptor
(...skipping 11 matching lines...) Expand all
926 908
927 class ResumeGeneratorDescriptor final : public CallInterfaceDescriptor { 909 class ResumeGeneratorDescriptor final : public CallInterfaceDescriptor {
928 public: 910 public:
929 DECLARE_DESCRIPTOR(ResumeGeneratorDescriptor, CallInterfaceDescriptor) 911 DECLARE_DESCRIPTOR(ResumeGeneratorDescriptor, CallInterfaceDescriptor)
930 }; 912 };
931 913
932 #undef DECLARE_DESCRIPTOR_WITH_BASE 914 #undef DECLARE_DESCRIPTOR_WITH_BASE
933 #undef DECLARE_DESCRIPTOR 915 #undef DECLARE_DESCRIPTOR
934 #undef DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE 916 #undef DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE
935 #undef DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG 917 #undef DECLARE_DESCRIPTOR_WITH_BASE_AND_FUNCTION_TYPE_ARG
918 #undef DEFINE_PARAMETERS
936 919
937 // We define the association between CallDescriptors::Key and the specialized 920 // We define the association between CallDescriptors::Key and the specialized
938 // descriptor here to reduce boilerplate and mistakes. 921 // descriptor here to reduce boilerplate and mistakes.
939 #define DEF_KEY(name) \ 922 #define DEF_KEY(name) \
940 CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; } 923 CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; }
941 INTERFACE_DESCRIPTOR_LIST(DEF_KEY) 924 INTERFACE_DESCRIPTOR_LIST(DEF_KEY)
942 #undef DEF_KEY 925 #undef DEF_KEY
943 } // namespace internal 926 } // namespace internal
944 } // namespace v8 927 } // namespace v8
945 928
946 929
947 #if V8_TARGET_ARCH_ARM64 930 #if V8_TARGET_ARCH_ARM64
948 #include "src/arm64/interface-descriptors-arm64.h" 931 #include "src/arm64/interface-descriptors-arm64.h"
949 #elif V8_TARGET_ARCH_ARM 932 #elif V8_TARGET_ARCH_ARM
950 #include "src/arm/interface-descriptors-arm.h" 933 #include "src/arm/interface-descriptors-arm.h"
951 #endif 934 #endif
952 935
953 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ 936 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | src/interface-descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698