OLD | NEW |
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 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
11 #include "src/globals.h" | 11 #include "src/globals.h" |
12 #include "src/ic/ic.h" | 12 #include "src/ic/ic.h" |
13 #include "src/interface-descriptors.h" | 13 #include "src/interface-descriptors.h" |
14 #include "src/macro-assembler.h" | 14 #include "src/macro-assembler.h" |
15 #include "src/ostreams.h" | 15 #include "src/ostreams.h" |
16 | 16 |
17 namespace v8 { | 17 namespace v8 { |
18 namespace internal { | 18 namespace internal { |
19 | 19 |
20 // List of code stubs used on all platforms. | 20 // List of code stubs used on all platforms. |
21 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ | 21 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ |
| 22 /* PlatformCodeStubs */ \ |
| 23 V(ArgumentsAccess) \ |
| 24 V(ArrayConstructor) \ |
| 25 V(BinaryOpICWithAllocationSite) \ |
| 26 V(CallApiFunction) \ |
| 27 V(CallApiGetter) \ |
| 28 V(CallConstruct) \ |
22 V(CallFunction) \ | 29 V(CallFunction) \ |
23 V(CallConstruct) \ | |
24 V(BinaryOpIC) \ | |
25 V(BinaryOpICWithAllocationSite) \ | |
26 V(BinaryOpWithAllocationSite) \ | |
27 V(StringAdd) \ | |
28 V(SubString) \ | |
29 V(StringCompare) \ | |
30 V(Compare) \ | |
31 V(CompareIC) \ | |
32 V(CompareNilIC) \ | |
33 V(MathPow) \ | |
34 V(CallIC) \ | 30 V(CallIC) \ |
35 V(CallIC_Array) \ | 31 V(CallIC_Array) \ |
| 32 V(CEntry) \ |
| 33 V(CompareIC) \ |
| 34 V(DoubleToI) \ |
36 V(FunctionPrototype) \ | 35 V(FunctionPrototype) \ |
| 36 V(Instanceof) \ |
| 37 V(InternalArrayConstructor) \ |
| 38 V(JSEntry) \ |
| 39 V(KeyedLoadICTrampoline) \ |
| 40 V(LoadICTrampoline) \ |
| 41 V(MathPow) \ |
| 42 V(ProfileEntryHook) \ |
37 V(RecordWrite) \ | 43 V(RecordWrite) \ |
| 44 V(RegExpExec) \ |
| 45 V(StoreArrayLiteralElement) \ |
38 V(StoreBufferOverflow) \ | 46 V(StoreBufferOverflow) \ |
39 V(RegExpExec) \ | 47 V(StoreElement) \ |
40 V(Instanceof) \ | 48 V(StringCompare) \ |
41 V(ConvertToDouble) \ | 49 V(StubFailureTrampoline) \ |
42 V(WriteInt32ToHeapNumber) \ | 50 V(SubString) \ |
43 V(StackCheck) \ | 51 /* HydrogenCodeStubs */ \ |
44 V(Interrupt) \ | 52 V(ArrayNArgumentsConstructor) \ |
| 53 V(ArrayNoArgumentConstructor) \ |
| 54 V(ArraySingleArgumentConstructor) \ |
| 55 V(BinaryOpIC) \ |
| 56 V(BinaryOpWithAllocationSite) \ |
| 57 V(CompareNilIC) \ |
| 58 V(CreateAllocationSite) \ |
| 59 V(ElementsTransitionAndStore) \ |
| 60 V(FastCloneShallowArray) \ |
| 61 V(FastCloneShallowObject) \ |
45 V(FastNewClosure) \ | 62 V(FastNewClosure) \ |
46 V(FastNewContext) \ | 63 V(FastNewContext) \ |
47 V(FastCloneShallowArray) \ | 64 V(InternalArrayNArgumentsConstructor) \ |
48 V(FastCloneShallowObject) \ | 65 V(InternalArrayNoArgumentConstructor) \ |
49 V(CreateAllocationSite) \ | 66 V(InternalArraySingleArgumentConstructor) \ |
| 67 V(KeyedLoadGeneric) \ |
| 68 V(LoadDictionaryElement) \ |
| 69 V(LoadFastElement) \ |
| 70 V(NameDictionaryLookup) \ |
| 71 V(NumberToString) \ |
| 72 V(RegExpConstructResult) \ |
| 73 V(StoreFastElement) \ |
| 74 V(StringAdd) \ |
50 V(ToBoolean) \ | 75 V(ToBoolean) \ |
51 V(ToNumber) \ | 76 V(ToNumber) \ |
52 V(ArgumentsAccess) \ | |
53 V(RegExpConstructResult) \ | |
54 V(NumberToString) \ | |
55 V(DoubleToI) \ | |
56 V(CEntry) \ | |
57 V(JSEntry) \ | |
58 V(LoadElement) \ | |
59 V(KeyedLoadGeneric) \ | |
60 V(ArrayNoArgumentConstructor) \ | |
61 V(ArraySingleArgumentConstructor) \ | |
62 V(ArrayNArgumentsConstructor) \ | |
63 V(InternalArrayNoArgumentConstructor) \ | |
64 V(InternalArraySingleArgumentConstructor) \ | |
65 V(InternalArrayNArgumentsConstructor) \ | |
66 V(StoreElement) \ | |
67 V(DebuggerStatement) \ | |
68 V(NameDictionaryLookup) \ | |
69 V(ElementsTransitionAndStore) \ | |
70 V(TransitionElementsKind) \ | 77 V(TransitionElementsKind) \ |
71 V(StoreArrayLiteralElement) \ | 78 V(VectorKeyedLoad) \ |
72 V(StubFailureTrampoline) \ | |
73 V(ArrayConstructor) \ | |
74 V(InternalArrayConstructor) \ | |
75 V(ProfileEntryHook) \ | |
76 V(StoreGlobal) \ | |
77 V(CallApiFunction) \ | |
78 V(CallApiGetter) \ | |
79 V(LoadICTrampoline) \ | |
80 V(VectorLoad) \ | 79 V(VectorLoad) \ |
81 V(KeyedLoadICTrampoline) \ | |
82 V(VectorKeyedLoad) \ | |
83 /* IC Handler stubs */ \ | 80 /* IC Handler stubs */ \ |
| 81 V(LoadConstant) \ |
84 V(LoadField) \ | 82 V(LoadField) \ |
85 V(StoreField) \ | 83 V(StoreField) \ |
86 V(LoadConstant) \ | 84 V(StoreGlobal) \ |
87 V(StringLength) | 85 V(StringLength) |
88 | 86 |
89 // List of code stubs only used on ARM 32 bits platforms. | 87 // List of code stubs only used on ARM 32 bits platforms. |
90 #if V8_TARGET_ARCH_ARM | 88 #if V8_TARGET_ARCH_ARM |
91 #define CODE_STUB_LIST_ARM(V) \ | 89 #define CODE_STUB_LIST_ARM(V) \ |
92 V(GetProperty) \ | 90 V(DirectCEntry) \ |
93 V(SetProperty) \ | 91 V(WriteInt32ToHeapNumber) |
94 V(InvokeBuiltin) \ | 92 |
95 V(DirectCEntry) | |
96 #else | 93 #else |
97 #define CODE_STUB_LIST_ARM(V) | 94 #define CODE_STUB_LIST_ARM(V) |
98 #endif | 95 #endif |
99 | 96 |
100 // List of code stubs only used on ARM 64 bits platforms. | 97 // List of code stubs only used on ARM 64 bits platforms. |
101 #if V8_TARGET_ARCH_ARM64 | 98 #if V8_TARGET_ARCH_ARM64 |
102 #define CODE_STUB_LIST_ARM64(V) \ | 99 #define CODE_STUB_LIST_ARM64(V) \ |
103 V(GetProperty) \ | 100 V(DirectCEntry) \ |
104 V(SetProperty) \ | 101 V(RestoreRegistersState) \ |
105 V(InvokeBuiltin) \ | 102 V(StoreRegistersState) |
106 V(DirectCEntry) \ | 103 |
107 V(StoreRegistersState) \ | |
108 V(RestoreRegistersState) | |
109 #else | 104 #else |
110 #define CODE_STUB_LIST_ARM64(V) | 105 #define CODE_STUB_LIST_ARM64(V) |
111 #endif | 106 #endif |
112 | 107 |
113 // List of code stubs only used on MIPS platforms. | 108 // List of code stubs only used on MIPS platforms. |
114 #if V8_TARGET_ARCH_MIPS | 109 #if V8_TARGET_ARCH_MIPS |
115 #define CODE_STUB_LIST_MIPS(V) \ | 110 #define CODE_STUB_LIST_MIPS(V) \ |
116 V(RegExpCEntry) \ | 111 V(RegExpCEntry) \ |
117 V(DirectCEntry) \ | 112 V(DirectCEntry) \ |
118 V(StoreRegistersState) \ | 113 V(StoreRegistersState) \ |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 virtual void InitializeInterfaceDescriptor( | 514 virtual void InitializeInterfaceDescriptor( |
520 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 515 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
521 | 516 |
522 static void InstallDescriptors(Isolate* isolate) { | 517 static void InstallDescriptors(Isolate* isolate) { |
523 ToNumberStub stub(isolate); | 518 ToNumberStub stub(isolate); |
524 stub.InitializeInterfaceDescriptor( | 519 stub.InitializeInterfaceDescriptor( |
525 isolate->code_stub_interface_descriptor(CodeStub::ToNumber)); | 520 isolate->code_stub_interface_descriptor(CodeStub::ToNumber)); |
526 } | 521 } |
527 | 522 |
528 private: | 523 private: |
529 virtual Major MajorKey() const OVERRIDE { return ToNumber; } | 524 virtual inline Major MajorKey() const FINAL OVERRIDE; |
| 525 |
| 526 DISALLOW_COPY_AND_ASSIGN(ToNumberStub); |
530 }; | 527 }; |
531 | 528 |
532 | 529 |
533 class NumberToStringStub FINAL : public HydrogenCodeStub { | 530 class NumberToStringStub FINAL : public HydrogenCodeStub { |
534 public: | 531 public: |
535 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 532 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
536 | 533 |
537 virtual Handle<Code> GenerateCode() OVERRIDE; | 534 virtual Handle<Code> GenerateCode() OVERRIDE; |
538 | 535 |
539 virtual void InitializeInterfaceDescriptor( | 536 virtual void InitializeInterfaceDescriptor( |
540 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 537 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
541 | 538 |
542 static void InstallDescriptors(Isolate* isolate); | 539 static void InstallDescriptors(Isolate* isolate); |
543 | 540 |
544 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 541 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
545 static const int kNumber = 0; | 542 static const int kNumber = 0; |
546 | 543 |
547 private: | 544 private: |
548 virtual Major MajorKey() const OVERRIDE { return NumberToString; } | 545 virtual inline Major MajorKey() const FINAL OVERRIDE; |
| 546 |
| 547 DISALLOW_COPY_AND_ASSIGN(NumberToStringStub); |
549 }; | 548 }; |
550 | 549 |
551 | 550 |
552 class FastNewClosureStub : public HydrogenCodeStub { | 551 class FastNewClosureStub : public HydrogenCodeStub { |
553 public: | 552 public: |
554 FastNewClosureStub(Isolate* isolate, StrictMode strict_mode, | 553 FastNewClosureStub(Isolate* isolate, StrictMode strict_mode, |
555 bool is_generator) | 554 bool is_generator) |
556 : HydrogenCodeStub(isolate) { | 555 : HydrogenCodeStub(isolate) { |
557 set_sub_minor_key(StrictModeBits::encode(strict_mode) | | 556 set_sub_minor_key(StrictModeBits::encode(strict_mode) | |
558 IsGeneratorBits::encode(is_generator)); | 557 IsGeneratorBits::encode(is_generator)); |
559 } | 558 } |
560 | 559 |
561 virtual Handle<Code> GenerateCode() OVERRIDE; | 560 virtual Handle<Code> GenerateCode() OVERRIDE; |
562 | 561 |
563 virtual void InitializeInterfaceDescriptor( | 562 virtual void InitializeInterfaceDescriptor( |
564 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 563 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
565 | 564 |
566 static void InstallDescriptors(Isolate* isolate); | 565 static void InstallDescriptors(Isolate* isolate); |
567 | 566 |
568 StrictMode strict_mode() const { | 567 StrictMode strict_mode() const { |
569 return StrictModeBits::decode(sub_minor_key()); | 568 return StrictModeBits::decode(sub_minor_key()); |
570 } | 569 } |
571 | 570 |
572 bool is_generator() const { return IsGeneratorBits::decode(sub_minor_key()); } | 571 bool is_generator() const { return IsGeneratorBits::decode(sub_minor_key()); } |
573 | 572 |
574 private: | 573 private: |
575 virtual Major MajorKey() const OVERRIDE { return FastNewClosure; } | 574 virtual inline Major MajorKey() const FINAL OVERRIDE; |
576 | 575 |
577 class StrictModeBits : public BitField<StrictMode, 0, 1> {}; | 576 class StrictModeBits : public BitField<StrictMode, 0, 1> {}; |
578 class IsGeneratorBits : public BitField<bool, 1, 1> {}; | 577 class IsGeneratorBits : public BitField<bool, 1, 1> {}; |
579 | 578 |
580 DISALLOW_COPY_AND_ASSIGN(FastNewClosureStub); | 579 DISALLOW_COPY_AND_ASSIGN(FastNewClosureStub); |
581 }; | 580 }; |
582 | 581 |
583 | 582 |
584 class FastNewContextStub FINAL : public HydrogenCodeStub { | 583 class FastNewContextStub FINAL : public HydrogenCodeStub { |
585 public: | 584 public: |
(...skipping 10 matching lines...) Expand all Loading... |
596 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 595 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
597 | 596 |
598 static void InstallDescriptors(Isolate* isolate); | 597 static void InstallDescriptors(Isolate* isolate); |
599 | 598 |
600 int slots() const { return SlotsBits::decode(sub_minor_key()); } | 599 int slots() const { return SlotsBits::decode(sub_minor_key()); } |
601 | 600 |
602 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 601 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
603 static const int kFunction = 0; | 602 static const int kFunction = 0; |
604 | 603 |
605 private: | 604 private: |
606 virtual Major MajorKey() const OVERRIDE { return FastNewContext; } | 605 virtual inline Major MajorKey() const FINAL OVERRIDE; |
607 | 606 |
608 class SlotsBits : public BitField<int, 0, 8> {}; | 607 class SlotsBits : public BitField<int, 0, 8> {}; |
609 | 608 |
610 DISALLOW_COPY_AND_ASSIGN(FastNewContextStub); | 609 DISALLOW_COPY_AND_ASSIGN(FastNewContextStub); |
611 }; | 610 }; |
612 | 611 |
613 | 612 |
614 class FastCloneShallowArrayStub : public HydrogenCodeStub { | 613 class FastCloneShallowArrayStub : public HydrogenCodeStub { |
615 public: | 614 public: |
616 FastCloneShallowArrayStub(Isolate* isolate, | 615 FastCloneShallowArrayStub(Isolate* isolate, |
617 AllocationSiteMode allocation_site_mode) | 616 AllocationSiteMode allocation_site_mode) |
618 : HydrogenCodeStub(isolate) { | 617 : HydrogenCodeStub(isolate) { |
619 set_sub_minor_key(AllocationSiteModeBits::encode(allocation_site_mode)); | 618 set_sub_minor_key(AllocationSiteModeBits::encode(allocation_site_mode)); |
620 } | 619 } |
621 | 620 |
622 AllocationSiteMode allocation_site_mode() const { | 621 AllocationSiteMode allocation_site_mode() const { |
623 return AllocationSiteModeBits::decode(sub_minor_key()); | 622 return AllocationSiteModeBits::decode(sub_minor_key()); |
624 } | 623 } |
625 | 624 |
626 virtual Handle<Code> GenerateCode(); | 625 virtual Handle<Code> GenerateCode(); |
627 | 626 |
628 virtual void InitializeInterfaceDescriptor( | 627 virtual void InitializeInterfaceDescriptor( |
629 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 628 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
630 | 629 |
631 static void InstallDescriptors(Isolate* isolate); | 630 static void InstallDescriptors(Isolate* isolate); |
632 | 631 |
633 private: | 632 private: |
634 virtual Major MajorKey() const OVERRIDE { return FastCloneShallowArray; } | 633 virtual inline Major MajorKey() const FINAL OVERRIDE; |
635 | 634 |
636 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; | 635 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
637 | 636 |
638 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowArrayStub); | 637 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowArrayStub); |
639 }; | 638 }; |
640 | 639 |
641 | 640 |
642 class FastCloneShallowObjectStub : public HydrogenCodeStub { | 641 class FastCloneShallowObjectStub : public HydrogenCodeStub { |
643 public: | 642 public: |
644 // Maximum number of properties in copied object. | 643 // Maximum number of properties in copied object. |
645 static const int kMaximumClonedProperties = 6; | 644 static const int kMaximumClonedProperties = 6; |
646 | 645 |
647 FastCloneShallowObjectStub(Isolate* isolate, int length) | 646 FastCloneShallowObjectStub(Isolate* isolate, int length) |
648 : HydrogenCodeStub(isolate) { | 647 : HydrogenCodeStub(isolate) { |
649 DCHECK_GE(length, 0); | 648 DCHECK_GE(length, 0); |
650 DCHECK_LE(length, kMaximumClonedProperties); | 649 DCHECK_LE(length, kMaximumClonedProperties); |
651 set_sub_minor_key(LengthBits::encode(length)); | 650 set_sub_minor_key(LengthBits::encode(length)); |
652 } | 651 } |
653 | 652 |
654 int length() const { return LengthBits::decode(sub_minor_key()); } | 653 int length() const { return LengthBits::decode(sub_minor_key()); } |
655 | 654 |
656 virtual Handle<Code> GenerateCode() OVERRIDE; | 655 virtual Handle<Code> GenerateCode() OVERRIDE; |
657 | 656 |
658 virtual void InitializeInterfaceDescriptor( | 657 virtual void InitializeInterfaceDescriptor( |
659 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 658 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
660 | 659 |
661 private: | 660 private: |
662 virtual Major MajorKey() const OVERRIDE { return FastCloneShallowObject; } | 661 virtual inline Major MajorKey() const FINAL OVERRIDE; |
663 | 662 |
664 class LengthBits : public BitField<int, 0, 4> {}; | 663 class LengthBits : public BitField<int, 0, 4> {}; |
665 | 664 |
666 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); | 665 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); |
667 }; | 666 }; |
668 | 667 |
669 | 668 |
670 class CreateAllocationSiteStub : public HydrogenCodeStub { | 669 class CreateAllocationSiteStub : public HydrogenCodeStub { |
671 public: | 670 public: |
672 explicit CreateAllocationSiteStub(Isolate* isolate) | 671 explicit CreateAllocationSiteStub(Isolate* isolate) |
673 : HydrogenCodeStub(isolate) { } | 672 : HydrogenCodeStub(isolate) { } |
674 | 673 |
675 virtual Handle<Code> GenerateCode() OVERRIDE; | 674 virtual Handle<Code> GenerateCode() OVERRIDE; |
676 | 675 |
677 static void GenerateAheadOfTime(Isolate* isolate); | 676 static void GenerateAheadOfTime(Isolate* isolate); |
678 | 677 |
679 virtual void InitializeInterfaceDescriptor( | 678 virtual void InitializeInterfaceDescriptor( |
680 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 679 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
681 | 680 |
682 private: | 681 private: |
683 virtual Major MajorKey() const OVERRIDE { return CreateAllocationSite; } | 682 virtual inline Major MajorKey() const FINAL OVERRIDE; |
684 | 683 |
685 DISALLOW_COPY_AND_ASSIGN(CreateAllocationSiteStub); | 684 DISALLOW_COPY_AND_ASSIGN(CreateAllocationSiteStub); |
686 }; | 685 }; |
687 | 686 |
688 | 687 |
689 class InstanceofStub: public PlatformCodeStub { | 688 class InstanceofStub: public PlatformCodeStub { |
690 public: | 689 public: |
691 enum Flags { | 690 enum Flags { |
692 kNoFlags = 0, | 691 kNoFlags = 0, |
693 kArgsInRegisters = 1 << 0, | 692 kArgsInRegisters = 1 << 0, |
694 kCallSiteInlineCheck = 1 << 1, | 693 kCallSiteInlineCheck = 1 << 1, |
695 kReturnTrueFalseObject = 1 << 2 | 694 kReturnTrueFalseObject = 1 << 2 |
696 }; | 695 }; |
697 | 696 |
698 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { | 697 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { |
699 minor_key_ = FlagBits::encode(flags); | 698 minor_key_ = FlagBits::encode(flags); |
700 } | 699 } |
701 | 700 |
702 void Generate(MacroAssembler* masm); | 701 void Generate(MacroAssembler* masm); |
703 | 702 |
704 static Register left() { return InstanceofDescriptor::left(); } | 703 static Register left() { return InstanceofDescriptor::left(); } |
705 static Register right() { return InstanceofDescriptor::right(); } | 704 static Register right() { return InstanceofDescriptor::right(); } |
706 | 705 |
707 virtual void InitializeInterfaceDescriptor( | 706 virtual void InitializeInterfaceDescriptor( |
708 CodeStubInterfaceDescriptor* descriptor); | 707 CodeStubInterfaceDescriptor* descriptor); |
709 | 708 |
710 private: | 709 private: |
711 virtual Major MajorKey() const OVERRIDE { return Instanceof; } | 710 virtual inline Major MajorKey() const FINAL OVERRIDE; |
712 | 711 |
713 Flags flags() const { return FlagBits::decode(minor_key_); } | 712 Flags flags() const { return FlagBits::decode(minor_key_); } |
714 | 713 |
715 bool HasArgsInRegisters() const { return (flags() & kArgsInRegisters) != 0; } | 714 bool HasArgsInRegisters() const { return (flags() & kArgsInRegisters) != 0; } |
716 | 715 |
717 bool HasCallSiteInlineCheck() const { | 716 bool HasCallSiteInlineCheck() const { |
718 return (flags() & kCallSiteInlineCheck) != 0; | 717 return (flags() & kCallSiteInlineCheck) != 0; |
719 } | 718 } |
720 | 719 |
721 bool ReturnTrueFalseObject() const { | 720 bool ReturnTrueFalseObject() const { |
(...skipping 18 matching lines...) Expand all Loading... |
740 class ArrayConstructorStub: public PlatformCodeStub { | 739 class ArrayConstructorStub: public PlatformCodeStub { |
741 public: | 740 public: |
742 enum ArgumentCountKey { ANY, NONE, ONE, MORE_THAN_ONE }; | 741 enum ArgumentCountKey { ANY, NONE, ONE, MORE_THAN_ONE }; |
743 ArrayConstructorStub(Isolate* isolate, int argument_count); | 742 ArrayConstructorStub(Isolate* isolate, int argument_count); |
744 | 743 |
745 explicit ArrayConstructorStub(Isolate* isolate); | 744 explicit ArrayConstructorStub(Isolate* isolate); |
746 | 745 |
747 void Generate(MacroAssembler* masm); | 746 void Generate(MacroAssembler* masm); |
748 | 747 |
749 private: | 748 private: |
750 virtual Major MajorKey() const OVERRIDE { return ArrayConstructor; } | 749 virtual inline Major MajorKey() const FINAL OVERRIDE; |
751 | 750 |
752 ArgumentCountKey argument_count() const { | 751 ArgumentCountKey argument_count() const { |
753 return ArgumentCountBits::decode(minor_key_); | 752 return ArgumentCountBits::decode(minor_key_); |
754 } | 753 } |
755 | 754 |
756 void GenerateDispatchToArrayStub(MacroAssembler* masm, | 755 void GenerateDispatchToArrayStub(MacroAssembler* masm, |
757 AllocationSiteOverrideMode mode); | 756 AllocationSiteOverrideMode mode); |
758 | 757 |
759 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT | 758 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT |
760 | 759 |
761 class ArgumentCountBits : public BitField<ArgumentCountKey, 0, 2> {}; | 760 class ArgumentCountBits : public BitField<ArgumentCountKey, 0, 2> {}; |
762 | 761 |
763 DISALLOW_COPY_AND_ASSIGN(ArrayConstructorStub); | 762 DISALLOW_COPY_AND_ASSIGN(ArrayConstructorStub); |
764 }; | 763 }; |
765 | 764 |
766 | 765 |
767 class InternalArrayConstructorStub: public PlatformCodeStub { | 766 class InternalArrayConstructorStub: public PlatformCodeStub { |
768 public: | 767 public: |
769 explicit InternalArrayConstructorStub(Isolate* isolate); | 768 explicit InternalArrayConstructorStub(Isolate* isolate); |
770 | 769 |
771 void Generate(MacroAssembler* masm); | 770 void Generate(MacroAssembler* masm); |
772 | 771 |
773 private: | 772 private: |
774 virtual Major MajorKey() const OVERRIDE { | 773 virtual inline Major MajorKey() const FINAL OVERRIDE; |
775 return InternalArrayConstructor; | |
776 } | |
777 | 774 |
778 void GenerateCase(MacroAssembler* masm, ElementsKind kind); | 775 void GenerateCase(MacroAssembler* masm, ElementsKind kind); |
779 | 776 |
780 DISALLOW_COPY_AND_ASSIGN(InternalArrayConstructorStub); | 777 DISALLOW_COPY_AND_ASSIGN(InternalArrayConstructorStub); |
781 }; | 778 }; |
782 | 779 |
783 | 780 |
784 class MathPowStub: public PlatformCodeStub { | 781 class MathPowStub: public PlatformCodeStub { |
785 public: | 782 public: |
786 enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK }; | 783 enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK }; |
787 | 784 |
788 MathPowStub(Isolate* isolate, ExponentType exponent_type) | 785 MathPowStub(Isolate* isolate, ExponentType exponent_type) |
789 : PlatformCodeStub(isolate) { | 786 : PlatformCodeStub(isolate) { |
790 minor_key_ = ExponentTypeBits::encode(exponent_type); | 787 minor_key_ = ExponentTypeBits::encode(exponent_type); |
791 } | 788 } |
792 | 789 |
793 virtual void Generate(MacroAssembler* masm); | 790 virtual void Generate(MacroAssembler* masm); |
794 | 791 |
795 private: | 792 private: |
796 virtual Major MajorKey() const OVERRIDE { return MathPow; } | 793 virtual inline Major MajorKey() const FINAL OVERRIDE; |
797 | 794 |
798 ExponentType exponent_type() const { | 795 ExponentType exponent_type() const { |
799 return ExponentTypeBits::decode(minor_key_); | 796 return ExponentTypeBits::decode(minor_key_); |
800 } | 797 } |
801 | 798 |
802 class ExponentTypeBits : public BitField<ExponentType, 0, 2> {}; | 799 class ExponentTypeBits : public BitField<ExponentType, 0, 2> {}; |
803 | 800 |
804 DISALLOW_COPY_AND_ASSIGN(MathPowStub); | 801 DISALLOW_COPY_AND_ASSIGN(MathPowStub); |
805 }; | 802 }; |
806 | 803 |
(...skipping 26 matching lines...) Expand all Loading... |
833 int arg_count() const { return state().arg_count(); } | 830 int arg_count() const { return state().arg_count(); } |
834 | 831 |
835 CallIC::State state() const { | 832 CallIC::State state() const { |
836 return CallIC::State(static_cast<ExtraICState>(minor_key_)); | 833 return CallIC::State(static_cast<ExtraICState>(minor_key_)); |
837 } | 834 } |
838 | 835 |
839 // Code generation helpers. | 836 // Code generation helpers. |
840 void GenerateMiss(MacroAssembler* masm, IC::UtilityId id); | 837 void GenerateMiss(MacroAssembler* masm, IC::UtilityId id); |
841 | 838 |
842 private: | 839 private: |
843 virtual Major MajorKey() const OVERRIDE { return CallIC; } | 840 virtual inline Major MajorKey() const FINAL OVERRIDE; |
844 | 841 |
845 virtual void PrintState(OStream& os) const OVERRIDE; // NOLINT | 842 virtual void PrintState(OStream& os) const OVERRIDE; // NOLINT |
846 | 843 |
847 DISALLOW_COPY_AND_ASSIGN(CallICStub); | 844 DISALLOW_COPY_AND_ASSIGN(CallICStub); |
848 }; | 845 }; |
849 | 846 |
850 | 847 |
851 class CallIC_ArrayStub: public CallICStub { | 848 class CallIC_ArrayStub: public CallICStub { |
852 public: | 849 public: |
853 CallIC_ArrayStub(Isolate* isolate, const CallIC::State& state_in) | 850 CallIC_ArrayStub(Isolate* isolate, const CallIC::State& state_in) |
854 : CallICStub(isolate, state_in) {} | 851 : CallICStub(isolate, state_in) {} |
855 | 852 |
856 virtual void Generate(MacroAssembler* masm); | 853 virtual void Generate(MacroAssembler* masm); |
857 | 854 |
858 virtual InlineCacheState GetICState() const FINAL OVERRIDE { | 855 virtual InlineCacheState GetICState() const FINAL OVERRIDE { |
859 return MONOMORPHIC; | 856 return MONOMORPHIC; |
860 } | 857 } |
861 | 858 |
862 private: | 859 private: |
| 860 virtual inline Major MajorKey() const FINAL OVERRIDE; |
| 861 |
863 virtual void PrintState(OStream& os) const OVERRIDE; // NOLINT | 862 virtual void PrintState(OStream& os) const OVERRIDE; // NOLINT |
864 | 863 |
865 virtual Major MajorKey() const OVERRIDE { return CallIC_Array; } | |
866 | |
867 DISALLOW_COPY_AND_ASSIGN(CallIC_ArrayStub); | 864 DISALLOW_COPY_AND_ASSIGN(CallIC_ArrayStub); |
868 }; | 865 }; |
869 | 866 |
870 | 867 |
871 // TODO(verwaest): Translate to hydrogen code stub. | 868 // TODO(verwaest): Translate to hydrogen code stub. |
872 class FunctionPrototypeStub : public PlatformCodeStub { | 869 class FunctionPrototypeStub : public PlatformCodeStub { |
873 public: | 870 public: |
874 explicit FunctionPrototypeStub(Isolate* isolate) | 871 explicit FunctionPrototypeStub(Isolate* isolate) |
875 : PlatformCodeStub(isolate) {} | 872 : PlatformCodeStub(isolate) {} |
876 virtual void Generate(MacroAssembler* masm); | 873 virtual void Generate(MacroAssembler* masm); |
877 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } | 874 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } |
878 | 875 |
879 private: | 876 private: |
880 virtual Major MajorKey() const OVERRIDE { return FunctionPrototype; } | 877 virtual inline Major MajorKey() const FINAL OVERRIDE; |
881 | 878 |
882 DISALLOW_COPY_AND_ASSIGN(FunctionPrototypeStub); | 879 DISALLOW_COPY_AND_ASSIGN(FunctionPrototypeStub); |
883 }; | 880 }; |
884 | 881 |
885 | 882 |
886 class HandlerStub : public HydrogenCodeStub { | 883 class HandlerStub : public HydrogenCodeStub { |
887 public: | 884 public: |
888 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } | 885 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } |
889 virtual ExtraICState GetExtraICState() const { return kind(); } | 886 virtual ExtraICState GetExtraICState() const { return kind(); } |
890 virtual InlineCacheState GetICState() const { return MONOMORPHIC; } | 887 virtual InlineCacheState GetICState() const { return MONOMORPHIC; } |
(...skipping 23 matching lines...) Expand all Loading... |
914 int property_index_key = LoadFieldByIndexBits::decode(sub_minor_key()); | 911 int property_index_key = LoadFieldByIndexBits::decode(sub_minor_key()); |
915 return FieldIndex::FromFieldAccessStubKey(property_index_key); | 912 return FieldIndex::FromFieldAccessStubKey(property_index_key); |
916 } | 913 } |
917 | 914 |
918 protected: | 915 protected: |
919 explicit LoadFieldStub(Isolate* isolate); | 916 explicit LoadFieldStub(Isolate* isolate); |
920 virtual Code::Kind kind() const { return Code::LOAD_IC; } | 917 virtual Code::Kind kind() const { return Code::LOAD_IC; } |
921 virtual Code::StubType GetStubType() { return Code::FAST; } | 918 virtual Code::StubType GetStubType() { return Code::FAST; } |
922 | 919 |
923 private: | 920 private: |
924 virtual Major MajorKey() const OVERRIDE { return LoadField; } | 921 virtual inline Major MajorKey() const FINAL OVERRIDE; |
925 | 922 |
926 class LoadFieldByIndexBits : public BitField<int, 0, 13> {}; | 923 class LoadFieldByIndexBits : public BitField<int, 0, 13> {}; |
927 | 924 |
928 DISALLOW_COPY_AND_ASSIGN(LoadFieldStub); | 925 DISALLOW_COPY_AND_ASSIGN(LoadFieldStub); |
929 }; | 926 }; |
930 | 927 |
931 | 928 |
932 class LoadConstantStub : public HandlerStub { | 929 class LoadConstantStub : public HandlerStub { |
933 public: | 930 public: |
934 LoadConstantStub(Isolate* isolate, int constant_index) | 931 LoadConstantStub(Isolate* isolate, int constant_index) |
935 : HandlerStub(isolate) { | 932 : HandlerStub(isolate) { |
936 set_sub_minor_key(ConstantIndexBits::encode(constant_index)); | 933 set_sub_minor_key(ConstantIndexBits::encode(constant_index)); |
937 } | 934 } |
938 | 935 |
939 virtual Handle<Code> GenerateCode() OVERRIDE; | 936 virtual Handle<Code> GenerateCode() OVERRIDE; |
940 | 937 |
941 int constant_index() const { | 938 int constant_index() const { |
942 return ConstantIndexBits::decode(sub_minor_key()); | 939 return ConstantIndexBits::decode(sub_minor_key()); |
943 } | 940 } |
944 | 941 |
945 protected: | 942 protected: |
946 explicit LoadConstantStub(Isolate* isolate); | 943 explicit LoadConstantStub(Isolate* isolate); |
947 virtual Code::Kind kind() const { return Code::LOAD_IC; } | 944 virtual Code::Kind kind() const { return Code::LOAD_IC; } |
948 virtual Code::StubType GetStubType() { return Code::FAST; } | 945 virtual Code::StubType GetStubType() { return Code::FAST; } |
949 | 946 |
950 private: | 947 private: |
951 virtual Major MajorKey() const OVERRIDE { return LoadConstant; } | 948 virtual inline Major MajorKey() const FINAL OVERRIDE; |
952 | 949 |
953 class ConstantIndexBits : public BitField<int, 0, kSubMinorKeyBits> {}; | 950 class ConstantIndexBits : public BitField<int, 0, kSubMinorKeyBits> {}; |
954 | 951 |
955 DISALLOW_COPY_AND_ASSIGN(LoadConstantStub); | 952 DISALLOW_COPY_AND_ASSIGN(LoadConstantStub); |
956 }; | 953 }; |
957 | 954 |
958 | 955 |
959 class StringLengthStub: public HandlerStub { | 956 class StringLengthStub: public HandlerStub { |
960 public: | 957 public: |
961 explicit StringLengthStub(Isolate* isolate) : HandlerStub(isolate) {} | 958 explicit StringLengthStub(Isolate* isolate) : HandlerStub(isolate) {} |
962 virtual Handle<Code> GenerateCode() OVERRIDE; | 959 virtual Handle<Code> GenerateCode() OVERRIDE; |
963 | 960 |
964 protected: | 961 protected: |
965 virtual Code::Kind kind() const { return Code::LOAD_IC; } | 962 virtual Code::Kind kind() const { return Code::LOAD_IC; } |
966 virtual Code::StubType GetStubType() { return Code::FAST; } | 963 virtual Code::StubType GetStubType() { return Code::FAST; } |
967 | 964 |
968 private: | 965 private: |
969 virtual Major MajorKey() const OVERRIDE { return StringLength; } | 966 virtual inline Major MajorKey() const FINAL OVERRIDE; |
970 | 967 |
971 DISALLOW_COPY_AND_ASSIGN(StringLengthStub); | 968 DISALLOW_COPY_AND_ASSIGN(StringLengthStub); |
972 }; | 969 }; |
973 | 970 |
974 | 971 |
975 class StoreFieldStub : public HandlerStub { | 972 class StoreFieldStub : public HandlerStub { |
976 public: | 973 public: |
977 StoreFieldStub(Isolate* isolate, FieldIndex index, | 974 StoreFieldStub(Isolate* isolate, FieldIndex index, |
978 Representation representation) | 975 Representation representation) |
979 : HandlerStub(isolate) { | 976 : HandlerStub(isolate) { |
(...skipping 16 matching lines...) Expand all Loading... |
996 } | 993 } |
997 | 994 |
998 static void InstallDescriptors(Isolate* isolate); | 995 static void InstallDescriptors(Isolate* isolate); |
999 | 996 |
1000 protected: | 997 protected: |
1001 explicit StoreFieldStub(Isolate* isolate); | 998 explicit StoreFieldStub(Isolate* isolate); |
1002 virtual Code::Kind kind() const { return Code::STORE_IC; } | 999 virtual Code::Kind kind() const { return Code::STORE_IC; } |
1003 virtual Code::StubType GetStubType() { return Code::FAST; } | 1000 virtual Code::StubType GetStubType() { return Code::FAST; } |
1004 | 1001 |
1005 private: | 1002 private: |
1006 virtual Major MajorKey() const OVERRIDE { return StoreField; } | 1003 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1007 | 1004 |
1008 class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; | 1005 class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; |
1009 class RepresentationBits : public BitField<uint8_t, 13, 4> {}; | 1006 class RepresentationBits : public BitField<uint8_t, 13, 4> {}; |
1010 | 1007 |
1011 DISALLOW_COPY_AND_ASSIGN(StoreFieldStub); | 1008 DISALLOW_COPY_AND_ASSIGN(StoreFieldStub); |
1012 }; | 1009 }; |
1013 | 1010 |
1014 | 1011 |
1015 class StoreGlobalStub : public HandlerStub { | 1012 class StoreGlobalStub : public HandlerStub { |
1016 public: | 1013 public: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 Representation representation() { | 1051 Representation representation() { |
1055 return Representation::FromKind( | 1052 return Representation::FromKind( |
1056 RepresentationBits::decode(sub_minor_key())); | 1053 RepresentationBits::decode(sub_minor_key())); |
1057 } | 1054 } |
1058 | 1055 |
1059 void set_representation(Representation r) { | 1056 void set_representation(Representation r) { |
1060 set_sub_minor_key(RepresentationBits::update(sub_minor_key(), r.kind())); | 1057 set_sub_minor_key(RepresentationBits::update(sub_minor_key(), r.kind())); |
1061 } | 1058 } |
1062 | 1059 |
1063 private: | 1060 private: |
1064 virtual Major MajorKey() const OVERRIDE { return StoreGlobal; } | 1061 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1065 | 1062 |
1066 class IsConstantBits: public BitField<bool, 0, 1> {}; | 1063 class IsConstantBits: public BitField<bool, 0, 1> {}; |
1067 class RepresentationBits: public BitField<Representation::Kind, 1, 8> {}; | 1064 class RepresentationBits: public BitField<Representation::Kind, 1, 8> {}; |
1068 class CheckGlobalBits: public BitField<bool, 9, 1> {}; | 1065 class CheckGlobalBits: public BitField<bool, 9, 1> {}; |
1069 | 1066 |
1070 DISALLOW_COPY_AND_ASSIGN(StoreGlobalStub); | 1067 DISALLOW_COPY_AND_ASSIGN(StoreGlobalStub); |
1071 }; | 1068 }; |
1072 | 1069 |
1073 | 1070 |
1074 class CallApiFunctionStub : public PlatformCodeStub { | 1071 class CallApiFunctionStub : public PlatformCodeStub { |
1075 public: | 1072 public: |
1076 CallApiFunctionStub(Isolate* isolate, | 1073 CallApiFunctionStub(Isolate* isolate, |
1077 bool is_store, | 1074 bool is_store, |
1078 bool call_data_undefined, | 1075 bool call_data_undefined, |
1079 int argc) : PlatformCodeStub(isolate) { | 1076 int argc) : PlatformCodeStub(isolate) { |
1080 minor_key_ = IsStoreBits::encode(is_store) | | 1077 minor_key_ = IsStoreBits::encode(is_store) | |
1081 CallDataUndefinedBits::encode(call_data_undefined) | | 1078 CallDataUndefinedBits::encode(call_data_undefined) | |
1082 ArgumentBits::encode(argc); | 1079 ArgumentBits::encode(argc); |
1083 DCHECK(!is_store || argc == 1); | 1080 DCHECK(!is_store || argc == 1); |
1084 } | 1081 } |
1085 | 1082 |
1086 private: | 1083 private: |
| 1084 virtual inline Major MajorKey() const FINAL OVERRIDE; |
| 1085 |
1087 virtual void Generate(MacroAssembler* masm) OVERRIDE; | 1086 virtual void Generate(MacroAssembler* masm) OVERRIDE; |
1088 virtual Major MajorKey() const OVERRIDE { return CallApiFunction; } | |
1089 | 1087 |
1090 bool is_store() const { return IsStoreBits::decode(minor_key_); } | 1088 bool is_store() const { return IsStoreBits::decode(minor_key_); } |
1091 bool call_data_undefined() const { | 1089 bool call_data_undefined() const { |
1092 return CallDataUndefinedBits::decode(minor_key_); | 1090 return CallDataUndefinedBits::decode(minor_key_); |
1093 } | 1091 } |
1094 int argc() const { return ArgumentBits::decode(minor_key_); } | 1092 int argc() const { return ArgumentBits::decode(minor_key_); } |
1095 | 1093 |
1096 class IsStoreBits: public BitField<bool, 0, 1> {}; | 1094 class IsStoreBits: public BitField<bool, 0, 1> {}; |
1097 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; | 1095 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; |
1098 class ArgumentBits: public BitField<int, 2, Code::kArgumentsBits> {}; | 1096 class ArgumentBits: public BitField<int, 2, Code::kArgumentsBits> {}; |
1099 STATIC_ASSERT(Code::kArgumentsBits + 2 <= kStubMinorKeyBits); | 1097 STATIC_ASSERT(Code::kArgumentsBits + 2 <= kStubMinorKeyBits); |
1100 | 1098 |
1101 DISALLOW_COPY_AND_ASSIGN(CallApiFunctionStub); | 1099 DISALLOW_COPY_AND_ASSIGN(CallApiFunctionStub); |
1102 }; | 1100 }; |
1103 | 1101 |
1104 | 1102 |
1105 class CallApiGetterStub : public PlatformCodeStub { | 1103 class CallApiGetterStub : public PlatformCodeStub { |
1106 public: | 1104 public: |
1107 explicit CallApiGetterStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 1105 explicit CallApiGetterStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
1108 | 1106 |
1109 private: | 1107 private: |
1110 virtual void Generate(MacroAssembler* masm) OVERRIDE; | 1108 virtual void Generate(MacroAssembler* masm) OVERRIDE; |
1111 virtual Major MajorKey() const OVERRIDE { return CallApiGetter; } | 1109 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1112 | 1110 |
1113 DISALLOW_COPY_AND_ASSIGN(CallApiGetterStub); | 1111 DISALLOW_COPY_AND_ASSIGN(CallApiGetterStub); |
1114 }; | 1112 }; |
1115 | 1113 |
1116 | 1114 |
1117 class BinaryOpICStub : public HydrogenCodeStub { | 1115 class BinaryOpICStub : public HydrogenCodeStub { |
1118 public: | 1116 public: |
1119 BinaryOpICStub(Isolate* isolate, Token::Value op, | 1117 BinaryOpICStub(Isolate* isolate, Token::Value op, |
1120 OverwriteMode mode = NO_OVERWRITE) | 1118 OverwriteMode mode = NO_OVERWRITE) |
1121 : HydrogenCodeStub(isolate, UNINITIALIZED) { | 1119 : HydrogenCodeStub(isolate, UNINITIALIZED) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 return BinaryOpIC::State(isolate(), GetExtraICState()); | 1151 return BinaryOpIC::State(isolate(), GetExtraICState()); |
1154 } | 1152 } |
1155 | 1153 |
1156 virtual void PrintState(OStream& os) const FINAL OVERRIDE; // NOLINT | 1154 virtual void PrintState(OStream& os) const FINAL OVERRIDE; // NOLINT |
1157 | 1155 |
1158 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1156 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1159 static const int kLeft = 0; | 1157 static const int kLeft = 0; |
1160 static const int kRight = 1; | 1158 static const int kRight = 1; |
1161 | 1159 |
1162 private: | 1160 private: |
1163 virtual Major MajorKey() const OVERRIDE { return BinaryOpIC; } | 1161 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1164 | 1162 |
1165 static void GenerateAheadOfTime(Isolate* isolate, | 1163 static void GenerateAheadOfTime(Isolate* isolate, |
1166 const BinaryOpIC::State& state); | 1164 const BinaryOpIC::State& state); |
1167 | 1165 |
1168 DISALLOW_COPY_AND_ASSIGN(BinaryOpICStub); | 1166 DISALLOW_COPY_AND_ASSIGN(BinaryOpICStub); |
1169 }; | 1167 }; |
1170 | 1168 |
1171 | 1169 |
1172 // TODO(bmeurer): Merge this into the BinaryOpICStub once we have proper tail | 1170 // TODO(bmeurer): Merge this into the BinaryOpICStub once we have proper tail |
1173 // call support for stubs in Hydrogen. | 1171 // call support for stubs in Hydrogen. |
(...skipping 22 matching lines...) Expand all Loading... |
1196 } | 1194 } |
1197 | 1195 |
1198 virtual ExtraICState GetExtraICState() const OVERRIDE { | 1196 virtual ExtraICState GetExtraICState() const OVERRIDE { |
1199 return static_cast<ExtraICState>(minor_key_); | 1197 return static_cast<ExtraICState>(minor_key_); |
1200 } | 1198 } |
1201 | 1199 |
1202 virtual void Generate(MacroAssembler* masm) OVERRIDE; | 1200 virtual void Generate(MacroAssembler* masm) OVERRIDE; |
1203 | 1201 |
1204 virtual void PrintState(OStream& os) const OVERRIDE; // NOLINT | 1202 virtual void PrintState(OStream& os) const OVERRIDE; // NOLINT |
1205 | 1203 |
1206 virtual Major MajorKey() const OVERRIDE { | 1204 private: |
1207 return BinaryOpICWithAllocationSite; | 1205 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1208 } | |
1209 | 1206 |
1210 private: | |
1211 BinaryOpIC::State state() const { | 1207 BinaryOpIC::State state() const { |
1212 return BinaryOpIC::State(isolate(), static_cast<ExtraICState>(minor_key_)); | 1208 return BinaryOpIC::State(isolate(), static_cast<ExtraICState>(minor_key_)); |
1213 } | 1209 } |
1214 | 1210 |
1215 static void GenerateAheadOfTime(Isolate* isolate, | 1211 static void GenerateAheadOfTime(Isolate* isolate, |
1216 const BinaryOpIC::State& state); | 1212 const BinaryOpIC::State& state); |
1217 | 1213 |
1218 DISALLOW_COPY_AND_ASSIGN(BinaryOpICWithAllocationSiteStub); | 1214 DISALLOW_COPY_AND_ASSIGN(BinaryOpICWithAllocationSiteStub); |
1219 }; | 1215 }; |
1220 | 1216 |
(...skipping 13 matching lines...) Expand all Loading... |
1234 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 1230 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
1235 | 1231 |
1236 static void InstallDescriptors(Isolate* isolate); | 1232 static void InstallDescriptors(Isolate* isolate); |
1237 | 1233 |
1238 virtual Code::Kind GetCodeKind() const FINAL OVERRIDE { | 1234 virtual Code::Kind GetCodeKind() const FINAL OVERRIDE { |
1239 return Code::STUB; | 1235 return Code::STUB; |
1240 } | 1236 } |
1241 | 1237 |
1242 virtual Handle<Code> GenerateCode() OVERRIDE; | 1238 virtual Handle<Code> GenerateCode() OVERRIDE; |
1243 | 1239 |
1244 virtual Major MajorKey() const OVERRIDE { | 1240 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1245 return BinaryOpWithAllocationSite; | |
1246 } | |
1247 | 1241 |
1248 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1242 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1249 static const int kAllocationSite = 0; | 1243 static const int kAllocationSite = 0; |
1250 static const int kLeft = 1; | 1244 static const int kLeft = 1; |
1251 static const int kRight = 2; | 1245 static const int kRight = 2; |
1252 }; | 1246 }; |
1253 | 1247 |
1254 | 1248 |
1255 enum StringAddFlags { | 1249 enum StringAddFlags { |
1256 // Omit both parameter checks. | 1250 // Omit both parameter checks. |
(...skipping 29 matching lines...) Expand all Loading... |
1286 virtual void InitializeInterfaceDescriptor( | 1280 virtual void InitializeInterfaceDescriptor( |
1287 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 1281 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
1288 | 1282 |
1289 static void InstallDescriptors(Isolate* isolate); | 1283 static void InstallDescriptors(Isolate* isolate); |
1290 | 1284 |
1291 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1285 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1292 static const int kLeft = 0; | 1286 static const int kLeft = 0; |
1293 static const int kRight = 1; | 1287 static const int kRight = 1; |
1294 | 1288 |
1295 private: | 1289 private: |
1296 virtual Major MajorKey() const OVERRIDE { return StringAdd; } | 1290 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1297 | 1291 |
1298 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; | 1292 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; |
1299 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; | 1293 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; |
1300 | 1294 |
1301 virtual void PrintBaseName(OStream& os) const OVERRIDE; // NOLINT | 1295 virtual void PrintBaseName(OStream& os) const OVERRIDE; // NOLINT |
1302 | 1296 |
1303 DISALLOW_COPY_AND_ASSIGN(StringAddStub); | 1297 DISALLOW_COPY_AND_ASSIGN(StringAddStub); |
1304 }; | 1298 }; |
1305 | 1299 |
1306 | 1300 |
1307 class ICCompareStub: public PlatformCodeStub { | 1301 class CompareICStub : public PlatformCodeStub { |
1308 public: | 1302 public: |
1309 ICCompareStub(Isolate* isolate, Token::Value op, CompareIC::State left, | 1303 CompareICStub(Isolate* isolate, Token::Value op, CompareIC::State left, |
1310 CompareIC::State right, CompareIC::State state) | 1304 CompareIC::State right, CompareIC::State state) |
1311 : PlatformCodeStub(isolate) { | 1305 : PlatformCodeStub(isolate) { |
1312 DCHECK(Token::IsCompareOp(op)); | 1306 DCHECK(Token::IsCompareOp(op)); |
1313 minor_key_ = OpBits::encode(op - Token::EQ) | LeftStateBits::encode(left) | | 1307 minor_key_ = OpBits::encode(op - Token::EQ) | LeftStateBits::encode(left) | |
1314 RightStateBits::encode(right) | StateBits::encode(state); | 1308 RightStateBits::encode(right) | StateBits::encode(state); |
1315 } | 1309 } |
1316 | 1310 |
1317 virtual void Generate(MacroAssembler* masm); | 1311 virtual void Generate(MacroAssembler* masm); |
1318 | 1312 |
1319 void set_known_map(Handle<Map> map) { known_map_ = map; } | 1313 void set_known_map(Handle<Map> map) { known_map_ = map; } |
1320 | 1314 |
1321 explicit ICCompareStub(uint32_t stub_key) : PlatformCodeStub(stub_key) { | 1315 explicit CompareICStub(uint32_t stub_key) : PlatformCodeStub(stub_key) { |
1322 DCHECK_EQ(MajorKeyFromKey(stub_key), MajorKey()); | 1316 DCHECK_EQ(MajorKeyFromKey(stub_key), MajorKey()); |
1323 } | 1317 } |
1324 | 1318 |
1325 virtual InlineCacheState GetICState() const; | 1319 virtual InlineCacheState GetICState() const; |
1326 | 1320 |
1327 Token::Value op() const { | 1321 Token::Value op() const { |
1328 return static_cast<Token::Value>(Token::EQ + OpBits::decode(minor_key_)); | 1322 return static_cast<Token::Value>(Token::EQ + OpBits::decode(minor_key_)); |
1329 } | 1323 } |
1330 | 1324 |
1331 CompareIC::State left() const { return LeftStateBits::decode(minor_key_); } | 1325 CompareIC::State left() const { return LeftStateBits::decode(minor_key_); } |
1332 CompareIC::State right() const { return RightStateBits::decode(minor_key_); } | 1326 CompareIC::State right() const { return RightStateBits::decode(minor_key_); } |
1333 CompareIC::State state() const { return StateBits::decode(minor_key_); } | 1327 CompareIC::State state() const { return StateBits::decode(minor_key_); } |
1334 | 1328 |
1335 private: | 1329 private: |
1336 virtual Major MajorKey() const OVERRIDE { return CompareIC; } | 1330 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1337 | 1331 |
1338 virtual Code::Kind GetCodeKind() const { return Code::COMPARE_IC; } | 1332 virtual Code::Kind GetCodeKind() const { return Code::COMPARE_IC; } |
1339 | 1333 |
1340 void GenerateSmis(MacroAssembler* masm); | 1334 void GenerateSmis(MacroAssembler* masm); |
1341 void GenerateNumbers(MacroAssembler* masm); | 1335 void GenerateNumbers(MacroAssembler* masm); |
1342 void GenerateInternalizedStrings(MacroAssembler* masm); | 1336 void GenerateInternalizedStrings(MacroAssembler* masm); |
1343 void GenerateStrings(MacroAssembler* masm); | 1337 void GenerateStrings(MacroAssembler* masm); |
1344 void GenerateUniqueNames(MacroAssembler* masm); | 1338 void GenerateUniqueNames(MacroAssembler* masm); |
1345 void GenerateObjects(MacroAssembler* masm); | 1339 void GenerateObjects(MacroAssembler* masm); |
1346 void GenerateMiss(MacroAssembler* masm); | 1340 void GenerateMiss(MacroAssembler* masm); |
1347 void GenerateKnownObjects(MacroAssembler* masm); | 1341 void GenerateKnownObjects(MacroAssembler* masm); |
1348 void GenerateGeneric(MacroAssembler* masm); | 1342 void GenerateGeneric(MacroAssembler* masm); |
1349 | 1343 |
1350 bool strict() const { return op() == Token::EQ_STRICT; } | 1344 bool strict() const { return op() == Token::EQ_STRICT; } |
1351 Condition GetCondition() const { return CompareIC::ComputeCondition(op()); } | 1345 Condition GetCondition() const { return CompareIC::ComputeCondition(op()); } |
1352 | 1346 |
1353 virtual void AddToSpecialCache(Handle<Code> new_object); | 1347 virtual void AddToSpecialCache(Handle<Code> new_object); |
1354 virtual bool FindCodeInSpecialCache(Code** code_out); | 1348 virtual bool FindCodeInSpecialCache(Code** code_out); |
1355 virtual bool UseSpecialCache() { return state() == CompareIC::KNOWN_OBJECT; } | 1349 virtual bool UseSpecialCache() { return state() == CompareIC::KNOWN_OBJECT; } |
1356 | 1350 |
1357 class OpBits : public BitField<int, 0, 3> {}; | 1351 class OpBits : public BitField<int, 0, 3> {}; |
1358 class LeftStateBits : public BitField<CompareIC::State, 3, 4> {}; | 1352 class LeftStateBits : public BitField<CompareIC::State, 3, 4> {}; |
1359 class RightStateBits : public BitField<CompareIC::State, 7, 4> {}; | 1353 class RightStateBits : public BitField<CompareIC::State, 7, 4> {}; |
1360 class StateBits : public BitField<CompareIC::State, 11, 4> {}; | 1354 class StateBits : public BitField<CompareIC::State, 11, 4> {}; |
1361 | 1355 |
1362 Handle<Map> known_map_; | 1356 Handle<Map> known_map_; |
1363 | 1357 |
1364 DISALLOW_COPY_AND_ASSIGN(ICCompareStub); | 1358 DISALLOW_COPY_AND_ASSIGN(CompareICStub); |
1365 }; | 1359 }; |
1366 | 1360 |
1367 | 1361 |
1368 class CompareNilICStub : public HydrogenCodeStub { | 1362 class CompareNilICStub : public HydrogenCodeStub { |
1369 public: | 1363 public: |
1370 Type* GetType(Zone* zone, Handle<Map> map = Handle<Map>()); | 1364 Type* GetType(Zone* zone, Handle<Map> map = Handle<Map>()); |
1371 Type* GetInputType(Zone* zone, Handle<Map> map); | 1365 Type* GetInputType(Zone* zone, Handle<Map> map); |
1372 | 1366 |
1373 CompareNilICStub(Isolate* isolate, NilValue nil) : HydrogenCodeStub(isolate) { | 1367 CompareNilICStub(Isolate* isolate, NilValue nil) : HydrogenCodeStub(isolate) { |
1374 set_sub_minor_key(NilValueBits::encode(nil)); | 1368 set_sub_minor_key(NilValueBits::encode(nil)); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 virtual void PrintState(OStream& os) const OVERRIDE; // NOLINT | 1418 virtual void PrintState(OStream& os) const OVERRIDE; // NOLINT |
1425 virtual void PrintBaseName(OStream& os) const OVERRIDE; // NOLINT | 1419 virtual void PrintBaseName(OStream& os) const OVERRIDE; // NOLINT |
1426 | 1420 |
1427 private: | 1421 private: |
1428 CompareNilICStub(Isolate* isolate, NilValue nil, | 1422 CompareNilICStub(Isolate* isolate, NilValue nil, |
1429 InitializationState init_state) | 1423 InitializationState init_state) |
1430 : HydrogenCodeStub(isolate, init_state) { | 1424 : HydrogenCodeStub(isolate, init_state) { |
1431 set_sub_minor_key(NilValueBits::encode(nil)); | 1425 set_sub_minor_key(NilValueBits::encode(nil)); |
1432 } | 1426 } |
1433 | 1427 |
1434 virtual Major MajorKey() const OVERRIDE { return CompareNilIC; } | 1428 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1435 | 1429 |
1436 enum CompareNilType { | 1430 enum CompareNilType { |
1437 UNDEFINED, | 1431 UNDEFINED, |
1438 NULL_TYPE, | 1432 NULL_TYPE, |
1439 MONOMORPHIC_MAP, | 1433 MONOMORPHIC_MAP, |
1440 GENERIC, | 1434 GENERIC, |
1441 NUMBER_OF_TYPES | 1435 NUMBER_OF_TYPES |
1442 }; | 1436 }; |
1443 | 1437 |
1444 // At most 6 different types can be distinguished, because the Code object | 1438 // At most 6 different types can be distinguished, because the Code object |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 | 1475 |
1482 void Generate(MacroAssembler* masm); | 1476 void Generate(MacroAssembler* masm); |
1483 | 1477 |
1484 // The version of this stub that doesn't save doubles is generated ahead of | 1478 // The version of this stub that doesn't save doubles is generated ahead of |
1485 // time, so it's OK to call it from other stubs that can't cope with GC during | 1479 // time, so it's OK to call it from other stubs that can't cope with GC during |
1486 // their code generation. On machines that always have gp registers (x64) we | 1480 // their code generation. On machines that always have gp registers (x64) we |
1487 // can generate both variants ahead of time. | 1481 // can generate both variants ahead of time. |
1488 static void GenerateAheadOfTime(Isolate* isolate); | 1482 static void GenerateAheadOfTime(Isolate* isolate); |
1489 | 1483 |
1490 private: | 1484 private: |
1491 virtual Major MajorKey() const OVERRIDE { return CEntry; } | 1485 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1492 | 1486 |
1493 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } | 1487 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } |
1494 #ifdef _WIN64 | 1488 #ifdef _WIN64 |
1495 int result_size() const { return ResultSizeBits::decode(minor_key_); } | 1489 int result_size() const { return ResultSizeBits::decode(minor_key_); } |
1496 #endif // _WIN64 | 1490 #endif // _WIN64 |
1497 | 1491 |
1498 bool NeedsImmovableCode(); | 1492 bool NeedsImmovableCode(); |
1499 | 1493 |
1500 class SaveDoublesBits : public BitField<bool, 0, 1> {}; | 1494 class SaveDoublesBits : public BitField<bool, 0, 1> {}; |
1501 class ResultSizeBits : public BitField<int, 1, 3> {}; | 1495 class ResultSizeBits : public BitField<int, 1, 3> {}; |
1502 | 1496 |
1503 DISALLOW_COPY_AND_ASSIGN(CEntryStub); | 1497 DISALLOW_COPY_AND_ASSIGN(CEntryStub); |
1504 }; | 1498 }; |
1505 | 1499 |
1506 | 1500 |
1507 class JSEntryStub : public PlatformCodeStub { | 1501 class JSEntryStub : public PlatformCodeStub { |
1508 public: | 1502 public: |
1509 explicit JSEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 1503 explicit JSEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
1510 | 1504 |
1511 void Generate(MacroAssembler* masm) { GenerateBody(masm, false); } | 1505 void Generate(MacroAssembler* masm) { GenerateBody(masm, false); } |
1512 | 1506 |
1513 protected: | 1507 protected: |
1514 void GenerateBody(MacroAssembler* masm, bool is_construct); | 1508 void GenerateBody(MacroAssembler* masm, bool is_construct); |
1515 | 1509 |
1516 private: | 1510 private: |
1517 virtual Major MajorKey() const OVERRIDE { return JSEntry; } | 1511 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1518 | 1512 |
1519 virtual void FinishCode(Handle<Code> code); | 1513 virtual void FinishCode(Handle<Code> code); |
1520 | 1514 |
1521 int handler_offset_; | 1515 int handler_offset_; |
1522 | 1516 |
1523 DISALLOW_COPY_AND_ASSIGN(JSEntryStub); | 1517 DISALLOW_COPY_AND_ASSIGN(JSEntryStub); |
1524 }; | 1518 }; |
1525 | 1519 |
1526 | 1520 |
1527 class JSConstructEntryStub : public JSEntryStub { | 1521 class JSConstructEntryStub : public JSEntryStub { |
(...skipping 20 matching lines...) Expand all Loading... |
1548 NEW_SLOPPY_FAST, | 1542 NEW_SLOPPY_FAST, |
1549 NEW_SLOPPY_SLOW, | 1543 NEW_SLOPPY_SLOW, |
1550 NEW_STRICT | 1544 NEW_STRICT |
1551 }; | 1545 }; |
1552 | 1546 |
1553 ArgumentsAccessStub(Isolate* isolate, Type type) : PlatformCodeStub(isolate) { | 1547 ArgumentsAccessStub(Isolate* isolate, Type type) : PlatformCodeStub(isolate) { |
1554 minor_key_ = TypeBits::encode(type); | 1548 minor_key_ = TypeBits::encode(type); |
1555 } | 1549 } |
1556 | 1550 |
1557 private: | 1551 private: |
1558 virtual Major MajorKey() const OVERRIDE { return ArgumentsAccess; } | 1552 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1559 | 1553 |
1560 Type type() const { return TypeBits::decode(minor_key_); } | 1554 Type type() const { return TypeBits::decode(minor_key_); } |
1561 | 1555 |
1562 void Generate(MacroAssembler* masm); | 1556 void Generate(MacroAssembler* masm); |
1563 void GenerateReadElement(MacroAssembler* masm); | 1557 void GenerateReadElement(MacroAssembler* masm); |
1564 void GenerateNewStrict(MacroAssembler* masm); | 1558 void GenerateNewStrict(MacroAssembler* masm); |
1565 void GenerateNewSloppyFast(MacroAssembler* masm); | 1559 void GenerateNewSloppyFast(MacroAssembler* masm); |
1566 void GenerateNewSloppySlow(MacroAssembler* masm); | 1560 void GenerateNewSloppySlow(MacroAssembler* masm); |
1567 | 1561 |
1568 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT | 1562 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT |
1569 | 1563 |
1570 class TypeBits : public BitField<Type, 0, 2> {}; | 1564 class TypeBits : public BitField<Type, 0, 2> {}; |
1571 | 1565 |
1572 DISALLOW_COPY_AND_ASSIGN(ArgumentsAccessStub); | 1566 DISALLOW_COPY_AND_ASSIGN(ArgumentsAccessStub); |
1573 }; | 1567 }; |
1574 | 1568 |
1575 | 1569 |
1576 class RegExpExecStub: public PlatformCodeStub { | 1570 class RegExpExecStub: public PlatformCodeStub { |
1577 public: | 1571 public: |
1578 explicit RegExpExecStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 1572 explicit RegExpExecStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
1579 | 1573 |
1580 private: | 1574 private: |
1581 virtual Major MajorKey() const OVERRIDE { return RegExpExec; } | 1575 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1582 | 1576 |
1583 void Generate(MacroAssembler* masm); | 1577 void Generate(MacroAssembler* masm); |
1584 | 1578 |
1585 DISALLOW_COPY_AND_ASSIGN(RegExpExecStub); | 1579 DISALLOW_COPY_AND_ASSIGN(RegExpExecStub); |
1586 }; | 1580 }; |
1587 | 1581 |
1588 | 1582 |
1589 class RegExpConstructResultStub FINAL : public HydrogenCodeStub { | 1583 class RegExpConstructResultStub FINAL : public HydrogenCodeStub { |
1590 public: | 1584 public: |
1591 explicit RegExpConstructResultStub(Isolate* isolate) | 1585 explicit RegExpConstructResultStub(Isolate* isolate) |
1592 : HydrogenCodeStub(isolate) { } | 1586 : HydrogenCodeStub(isolate) { } |
1593 | 1587 |
1594 virtual Handle<Code> GenerateCode() OVERRIDE; | 1588 virtual Handle<Code> GenerateCode() OVERRIDE; |
1595 | 1589 |
1596 virtual void InitializeInterfaceDescriptor( | 1590 virtual void InitializeInterfaceDescriptor( |
1597 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 1591 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
1598 | 1592 |
1599 virtual Major MajorKey() const OVERRIDE { return RegExpConstructResult; } | 1593 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1600 | 1594 |
1601 static void InstallDescriptors(Isolate* isolate); | 1595 static void InstallDescriptors(Isolate* isolate); |
1602 | 1596 |
1603 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1597 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1604 static const int kLength = 0; | 1598 static const int kLength = 0; |
1605 static const int kIndex = 1; | 1599 static const int kIndex = 1; |
1606 static const int kInput = 2; | 1600 static const int kInput = 2; |
1607 | 1601 |
1608 private: | 1602 private: |
1609 DISALLOW_COPY_AND_ASSIGN(RegExpConstructResultStub); | 1603 DISALLOW_COPY_AND_ASSIGN(RegExpConstructResultStub); |
(...skipping 11 matching lines...) Expand all Loading... |
1621 void Generate(MacroAssembler* masm); | 1615 void Generate(MacroAssembler* masm); |
1622 | 1616 |
1623 static int ExtractArgcFromMinorKey(int minor_key) { | 1617 static int ExtractArgcFromMinorKey(int minor_key) { |
1624 return ArgcBits::decode(minor_key); | 1618 return ArgcBits::decode(minor_key); |
1625 } | 1619 } |
1626 | 1620 |
1627 virtual void InitializeInterfaceDescriptor( | 1621 virtual void InitializeInterfaceDescriptor( |
1628 CodeStubInterfaceDescriptor* descriptor); | 1622 CodeStubInterfaceDescriptor* descriptor); |
1629 | 1623 |
1630 private: | 1624 private: |
1631 virtual Major MajorKey() const OVERRIDE { return CallFunction; } | 1625 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1632 | 1626 |
1633 int argc() const { return ArgcBits::decode(minor_key_); } | 1627 int argc() const { return ArgcBits::decode(minor_key_); } |
1634 int flags() const { return FlagBits::decode(minor_key_); } | 1628 int flags() const { return FlagBits::decode(minor_key_); } |
1635 | 1629 |
1636 bool CallAsMethod() const { | 1630 bool CallAsMethod() const { |
1637 return flags() == CALL_AS_METHOD || flags() == WRAP_AND_CALL; | 1631 return flags() == CALL_AS_METHOD || flags() == WRAP_AND_CALL; |
1638 } | 1632 } |
1639 | 1633 |
1640 bool NeedsChecks() const { return flags() != WRAP_AND_CALL; } | 1634 bool NeedsChecks() const { return flags() != WRAP_AND_CALL; } |
1641 | 1635 |
(...skipping 18 matching lines...) Expand all Loading... |
1660 void Generate(MacroAssembler* masm); | 1654 void Generate(MacroAssembler* masm); |
1661 | 1655 |
1662 virtual void FinishCode(Handle<Code> code) { | 1656 virtual void FinishCode(Handle<Code> code) { |
1663 code->set_has_function_cache(RecordCallTarget()); | 1657 code->set_has_function_cache(RecordCallTarget()); |
1664 } | 1658 } |
1665 | 1659 |
1666 virtual void InitializeInterfaceDescriptor( | 1660 virtual void InitializeInterfaceDescriptor( |
1667 CodeStubInterfaceDescriptor* descriptor); | 1661 CodeStubInterfaceDescriptor* descriptor); |
1668 | 1662 |
1669 private: | 1663 private: |
1670 virtual Major MajorKey() const OVERRIDE { return CallConstruct; } | 1664 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1671 | 1665 |
1672 CallConstructorFlags flags() const { return FlagBits::decode(minor_key_); } | 1666 CallConstructorFlags flags() const { return FlagBits::decode(minor_key_); } |
1673 | 1667 |
1674 bool RecordCallTarget() const { | 1668 bool RecordCallTarget() const { |
1675 return (flags() & RECORD_CONSTRUCTOR_TARGET) != 0; | 1669 return (flags() & RECORD_CONSTRUCTOR_TARGET) != 0; |
1676 } | 1670 } |
1677 | 1671 |
1678 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT | 1672 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT |
1679 | 1673 |
1680 class FlagBits : public BitField<CallConstructorFlags, 0, 1> {}; | 1674 class FlagBits : public BitField<CallConstructorFlags, 0, 1> {}; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1853 StringCharCodeAtGenerator char_code_at_generator_; | 1847 StringCharCodeAtGenerator char_code_at_generator_; |
1854 StringCharFromCodeGenerator char_from_code_generator_; | 1848 StringCharFromCodeGenerator char_from_code_generator_; |
1855 | 1849 |
1856 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); | 1850 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); |
1857 }; | 1851 }; |
1858 | 1852 |
1859 | 1853 |
1860 class LoadDictionaryElementStub : public HydrogenCodeStub { | 1854 class LoadDictionaryElementStub : public HydrogenCodeStub { |
1861 public: | 1855 public: |
1862 explicit LoadDictionaryElementStub(Isolate* isolate) | 1856 explicit LoadDictionaryElementStub(Isolate* isolate) |
1863 : HydrogenCodeStub(isolate) { | 1857 : HydrogenCodeStub(isolate) {} |
1864 set_sub_minor_key(DICTIONARY_ELEMENTS); | |
1865 } | |
1866 | 1858 |
1867 virtual Handle<Code> GenerateCode() OVERRIDE; | 1859 virtual Handle<Code> GenerateCode() OVERRIDE; |
1868 | 1860 |
1869 virtual void InitializeInterfaceDescriptor( | 1861 virtual void InitializeInterfaceDescriptor( |
1870 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 1862 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
1871 | 1863 |
1872 private: | 1864 private: |
1873 virtual Major MajorKey() const OVERRIDE { return LoadElement; } | 1865 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1874 | 1866 |
1875 DISALLOW_COPY_AND_ASSIGN(LoadDictionaryElementStub); | 1867 DISALLOW_COPY_AND_ASSIGN(LoadDictionaryElementStub); |
1876 }; | 1868 }; |
1877 | 1869 |
1878 | 1870 |
1879 class LoadDictionaryElementPlatformStub : public PlatformCodeStub { | |
1880 public: | |
1881 explicit LoadDictionaryElementPlatformStub(Isolate* isolate) | |
1882 : PlatformCodeStub(isolate) { | |
1883 minor_key_ = DICTIONARY_ELEMENTS; | |
1884 } | |
1885 | |
1886 void Generate(MacroAssembler* masm); | |
1887 | |
1888 private: | |
1889 virtual Major MajorKey() const OVERRIDE { return LoadElement; } | |
1890 | |
1891 DISALLOW_COPY_AND_ASSIGN(LoadDictionaryElementPlatformStub); | |
1892 }; | |
1893 | |
1894 | |
1895 class KeyedLoadGenericStub : public HydrogenCodeStub { | 1871 class KeyedLoadGenericStub : public HydrogenCodeStub { |
1896 public: | 1872 public: |
1897 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 1873 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
1898 | 1874 |
1899 virtual Handle<Code> GenerateCode() OVERRIDE; | 1875 virtual Handle<Code> GenerateCode() OVERRIDE; |
1900 | 1876 |
1901 virtual void InitializeInterfaceDescriptor( | 1877 virtual void InitializeInterfaceDescriptor( |
1902 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 1878 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
1903 | 1879 |
1904 static void InstallDescriptors(Isolate* isolate); | 1880 static void InstallDescriptors(Isolate* isolate); |
1905 | 1881 |
1906 virtual Code::Kind GetCodeKind() const { return Code::KEYED_LOAD_IC; } | 1882 virtual Code::Kind GetCodeKind() const { return Code::KEYED_LOAD_IC; } |
1907 virtual InlineCacheState GetICState() const { return GENERIC; } | 1883 virtual InlineCacheState GetICState() const { return GENERIC; } |
1908 | 1884 |
1909 private: | 1885 private: |
1910 virtual Major MajorKey() const OVERRIDE { return KeyedLoadGeneric; } | 1886 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1911 | 1887 |
1912 DISALLOW_COPY_AND_ASSIGN(KeyedLoadGenericStub); | 1888 DISALLOW_COPY_AND_ASSIGN(KeyedLoadGenericStub); |
1913 }; | 1889 }; |
1914 | 1890 |
1915 | 1891 |
1916 class LoadICTrampolineStub : public PlatformCodeStub { | 1892 class LoadICTrampolineStub : public PlatformCodeStub { |
1917 public: | 1893 public: |
1918 LoadICTrampolineStub(Isolate* isolate, const LoadIC::State& state) | 1894 LoadICTrampolineStub(Isolate* isolate, const LoadIC::State& state) |
1919 : PlatformCodeStub(isolate) { | 1895 : PlatformCodeStub(isolate) { |
1920 minor_key_ = state.GetExtraICState(); | 1896 minor_key_ = state.GetExtraICState(); |
1921 } | 1897 } |
1922 | 1898 |
1923 virtual Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } | 1899 virtual Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } |
1924 | 1900 |
1925 virtual InlineCacheState GetICState() const FINAL OVERRIDE { | 1901 virtual InlineCacheState GetICState() const FINAL OVERRIDE { |
1926 return GENERIC; | 1902 return GENERIC; |
1927 } | 1903 } |
1928 | 1904 |
1929 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { | 1905 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { |
1930 return static_cast<ExtraICState>(minor_key_); | 1906 return static_cast<ExtraICState>(minor_key_); |
1931 } | 1907 } |
1932 | 1908 |
1933 virtual Major MajorKey() const OVERRIDE { return LoadICTrampoline; } | 1909 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1934 | 1910 |
1935 private: | 1911 private: |
1936 LoadIC::State state() const { | 1912 LoadIC::State state() const { |
1937 return LoadIC::State(static_cast<ExtraICState>(minor_key_)); | 1913 return LoadIC::State(static_cast<ExtraICState>(minor_key_)); |
1938 } | 1914 } |
1939 | 1915 |
1940 virtual void Generate(MacroAssembler* masm); | 1916 virtual void Generate(MacroAssembler* masm); |
1941 | 1917 |
1942 DISALLOW_COPY_AND_ASSIGN(LoadICTrampolineStub); | 1918 DISALLOW_COPY_AND_ASSIGN(LoadICTrampolineStub); |
1943 }; | 1919 }; |
1944 | 1920 |
1945 | 1921 |
1946 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { | 1922 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { |
1947 public: | 1923 public: |
1948 explicit KeyedLoadICTrampolineStub(Isolate* isolate) | 1924 explicit KeyedLoadICTrampolineStub(Isolate* isolate) |
1949 : LoadICTrampolineStub(isolate, LoadIC::State(0)) {} | 1925 : LoadICTrampolineStub(isolate, LoadIC::State(0)) {} |
1950 | 1926 |
1951 virtual Code::Kind GetCodeKind() const OVERRIDE { | 1927 virtual Code::Kind GetCodeKind() const OVERRIDE { |
1952 return Code::KEYED_LOAD_IC; | 1928 return Code::KEYED_LOAD_IC; |
1953 } | 1929 } |
1954 | 1930 |
1955 virtual Major MajorKey() const OVERRIDE { return KeyedLoadICTrampoline; } | 1931 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1956 | 1932 |
1957 private: | 1933 private: |
1958 virtual void Generate(MacroAssembler* masm); | 1934 virtual void Generate(MacroAssembler* masm); |
1959 | 1935 |
1960 DISALLOW_COPY_AND_ASSIGN(KeyedLoadICTrampolineStub); | 1936 DISALLOW_COPY_AND_ASSIGN(KeyedLoadICTrampolineStub); |
1961 }; | 1937 }; |
1962 | 1938 |
1963 | 1939 |
1964 class VectorLoadStub : public HydrogenCodeStub { | 1940 class VectorLoadStub : public HydrogenCodeStub { |
1965 public: | 1941 public: |
(...skipping 13 matching lines...) Expand all Loading... |
1979 | 1955 |
1980 virtual InlineCacheState GetICState() const FINAL OVERRIDE { | 1956 virtual InlineCacheState GetICState() const FINAL OVERRIDE { |
1981 return GENERIC; | 1957 return GENERIC; |
1982 } | 1958 } |
1983 | 1959 |
1984 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { | 1960 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { |
1985 return static_cast<ExtraICState>(sub_minor_key()); | 1961 return static_cast<ExtraICState>(sub_minor_key()); |
1986 } | 1962 } |
1987 | 1963 |
1988 private: | 1964 private: |
1989 virtual Major MajorKey() const OVERRIDE { return VectorLoad; } | 1965 virtual inline Major MajorKey() const FINAL OVERRIDE; |
1990 | 1966 |
1991 LoadIC::State state() const { return LoadIC::State(GetExtraICState()); } | 1967 LoadIC::State state() const { return LoadIC::State(GetExtraICState()); } |
1992 | 1968 |
1993 DISALLOW_COPY_AND_ASSIGN(VectorLoadStub); | 1969 DISALLOW_COPY_AND_ASSIGN(VectorLoadStub); |
1994 }; | 1970 }; |
1995 | 1971 |
1996 | 1972 |
1997 class VectorKeyedLoadStub : public VectorLoadStub { | 1973 class VectorKeyedLoadStub : public VectorLoadStub { |
1998 public: | 1974 public: |
1999 explicit VectorKeyedLoadStub(Isolate* isolate) | 1975 explicit VectorKeyedLoadStub(Isolate* isolate) |
2000 : VectorLoadStub(isolate, LoadIC::State(0)) {} | 1976 : VectorLoadStub(isolate, LoadIC::State(0)) {} |
2001 | 1977 |
2002 virtual Handle<Code> GenerateCode() OVERRIDE; | 1978 virtual Handle<Code> GenerateCode() OVERRIDE; |
2003 | 1979 |
2004 virtual void InitializeInterfaceDescriptor( | 1980 virtual void InitializeInterfaceDescriptor( |
2005 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 1981 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2006 | 1982 |
2007 static void InstallDescriptors(Isolate* isolate); | 1983 static void InstallDescriptors(Isolate* isolate); |
2008 | 1984 |
2009 virtual Code::Kind GetCodeKind() const OVERRIDE { | 1985 virtual Code::Kind GetCodeKind() const OVERRIDE { |
2010 return Code::KEYED_LOAD_IC; | 1986 return Code::KEYED_LOAD_IC; |
2011 } | 1987 } |
2012 | 1988 |
2013 virtual Major MajorKey() const OVERRIDE { return VectorKeyedLoad; } | 1989 private: |
| 1990 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2014 | 1991 |
2015 private: | |
2016 DISALLOW_COPY_AND_ASSIGN(VectorKeyedLoadStub); | 1992 DISALLOW_COPY_AND_ASSIGN(VectorKeyedLoadStub); |
2017 }; | 1993 }; |
2018 | 1994 |
2019 | 1995 |
2020 class DoubleToIStub : public PlatformCodeStub { | 1996 class DoubleToIStub : public PlatformCodeStub { |
2021 public: | 1997 public: |
2022 DoubleToIStub(Isolate* isolate, Register source, Register destination, | 1998 DoubleToIStub(Isolate* isolate, Register source, Register destination, |
2023 int offset, bool is_truncating, bool skip_fastpath = false) | 1999 int offset, bool is_truncating, bool skip_fastpath = false) |
2024 : PlatformCodeStub(isolate) { | 2000 : PlatformCodeStub(isolate) { |
2025 minor_key_ = SourceRegisterBits::encode(source.code()) | | 2001 minor_key_ = SourceRegisterBits::encode(source.code()) | |
2026 DestinationRegisterBits::encode(destination.code()) | | 2002 DestinationRegisterBits::encode(destination.code()) | |
2027 OffsetBits::encode(offset) | | 2003 OffsetBits::encode(offset) | |
2028 IsTruncatingBits::encode(is_truncating) | | 2004 IsTruncatingBits::encode(is_truncating) | |
2029 SkipFastPathBits::encode(skip_fastpath) | | 2005 SkipFastPathBits::encode(skip_fastpath) | |
2030 SSE3Bits::encode(CpuFeatures::IsSupported(SSE3) ? 1 : 0); | 2006 SSE3Bits::encode(CpuFeatures::IsSupported(SSE3) ? 1 : 0); |
2031 } | 2007 } |
2032 | 2008 |
2033 void Generate(MacroAssembler* masm); | 2009 void Generate(MacroAssembler* masm); |
2034 | 2010 |
2035 virtual bool SometimesSetsUpAFrame() { return false; } | 2011 virtual bool SometimesSetsUpAFrame() { return false; } |
2036 | 2012 |
2037 private: | 2013 private: |
2038 virtual Major MajorKey() const OVERRIDE { return DoubleToI; } | 2014 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2039 | 2015 |
2040 Register source() const { | 2016 Register source() const { |
2041 return Register::from_code(SourceRegisterBits::decode(minor_key_)); | 2017 return Register::from_code(SourceRegisterBits::decode(minor_key_)); |
2042 } | 2018 } |
2043 Register destination() const { | 2019 Register destination() const { |
2044 return Register::from_code(DestinationRegisterBits::decode(minor_key_)); | 2020 return Register::from_code(DestinationRegisterBits::decode(minor_key_)); |
2045 } | 2021 } |
2046 bool is_truncating() const { return IsTruncatingBits::decode(minor_key_); } | 2022 bool is_truncating() const { return IsTruncatingBits::decode(minor_key_); } |
2047 bool skip_fastpath() const { return SkipFastPathBits::decode(minor_key_); } | 2023 bool skip_fastpath() const { return SkipFastPathBits::decode(minor_key_); } |
2048 int offset() const { return OffsetBits::decode(minor_key_); } | 2024 int offset() const { return OffsetBits::decode(minor_key_); } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2083 } | 2059 } |
2084 | 2060 |
2085 virtual Handle<Code> GenerateCode() OVERRIDE; | 2061 virtual Handle<Code> GenerateCode() OVERRIDE; |
2086 | 2062 |
2087 static void InstallDescriptors(Isolate* isolate); | 2063 static void InstallDescriptors(Isolate* isolate); |
2088 | 2064 |
2089 virtual void InitializeInterfaceDescriptor( | 2065 virtual void InitializeInterfaceDescriptor( |
2090 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 2066 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2091 | 2067 |
2092 private: | 2068 private: |
2093 virtual Major MajorKey() const OVERRIDE { return LoadElement; } | 2069 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2094 | 2070 |
2095 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 2071 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
2096 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 2072 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
2097 | 2073 |
2098 DISALLOW_COPY_AND_ASSIGN(LoadFastElementStub); | 2074 DISALLOW_COPY_AND_ASSIGN(LoadFastElementStub); |
2099 }; | 2075 }; |
2100 | 2076 |
2101 | 2077 |
2102 class StoreFastElementStub : public HydrogenCodeStub { | 2078 class StoreFastElementStub : public HydrogenCodeStub { |
2103 public: | 2079 public: |
(...skipping 14 matching lines...) Expand all Loading... |
2118 KeyedAccessStoreMode store_mode() const { | 2094 KeyedAccessStoreMode store_mode() const { |
2119 return StoreModeBits::decode(sub_minor_key()); | 2095 return StoreModeBits::decode(sub_minor_key()); |
2120 } | 2096 } |
2121 | 2097 |
2122 virtual Handle<Code> GenerateCode() OVERRIDE; | 2098 virtual Handle<Code> GenerateCode() OVERRIDE; |
2123 | 2099 |
2124 virtual void InitializeInterfaceDescriptor( | 2100 virtual void InitializeInterfaceDescriptor( |
2125 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 2101 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2126 | 2102 |
2127 private: | 2103 private: |
2128 virtual Major MajorKey() const OVERRIDE { return StoreElement; } | 2104 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2129 | 2105 |
2130 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 2106 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
2131 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; | 2107 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; |
2132 class IsJSArrayBits: public BitField<bool, 12, 1> {}; | 2108 class IsJSArrayBits: public BitField<bool, 12, 1> {}; |
2133 | 2109 |
2134 DISALLOW_COPY_AND_ASSIGN(StoreFastElementStub); | 2110 DISALLOW_COPY_AND_ASSIGN(StoreFastElementStub); |
2135 }; | 2111 }; |
2136 | 2112 |
2137 | 2113 |
2138 class TransitionElementsKindStub : public HydrogenCodeStub { | 2114 class TransitionElementsKindStub : public HydrogenCodeStub { |
(...skipping 14 matching lines...) Expand all Loading... |
2153 ElementsKind to_kind() const { return ToKindBits::decode(sub_minor_key()); } | 2129 ElementsKind to_kind() const { return ToKindBits::decode(sub_minor_key()); } |
2154 | 2130 |
2155 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | 2131 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
2156 | 2132 |
2157 virtual Handle<Code> GenerateCode() OVERRIDE; | 2133 virtual Handle<Code> GenerateCode() OVERRIDE; |
2158 | 2134 |
2159 virtual void InitializeInterfaceDescriptor( | 2135 virtual void InitializeInterfaceDescriptor( |
2160 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 2136 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2161 | 2137 |
2162 private: | 2138 private: |
2163 virtual Major MajorKey() const OVERRIDE { return TransitionElementsKind; } | 2139 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2164 | 2140 |
2165 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; | 2141 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; |
2166 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; | 2142 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; |
2167 class IsJSArrayBits: public BitField<bool, 16, 1> {}; | 2143 class IsJSArrayBits: public BitField<bool, 16, 1> {}; |
2168 | 2144 |
2169 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); | 2145 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); |
2170 }; | 2146 }; |
2171 | 2147 |
2172 | 2148 |
2173 class ArrayConstructorStubBase : public HydrogenCodeStub { | 2149 class ArrayConstructorStubBase : public HydrogenCodeStub { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 2199 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
2224 : ArrayConstructorStubBase(isolate, kind, override_mode) { | 2200 : ArrayConstructorStubBase(isolate, kind, override_mode) { |
2225 } | 2201 } |
2226 | 2202 |
2227 virtual Handle<Code> GenerateCode() OVERRIDE; | 2203 virtual Handle<Code> GenerateCode() OVERRIDE; |
2228 | 2204 |
2229 virtual void InitializeInterfaceDescriptor( | 2205 virtual void InitializeInterfaceDescriptor( |
2230 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 2206 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2231 | 2207 |
2232 private: | 2208 private: |
2233 virtual Major MajorKey() const OVERRIDE { | 2209 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2234 return ArrayNoArgumentConstructor; | |
2235 } | |
2236 | 2210 |
2237 virtual void PrintName(OStream& os) const OVERRIDE { // NOLINT | 2211 virtual void PrintName(OStream& os) const OVERRIDE { // NOLINT |
2238 BasePrintName(os, "ArrayNoArgumentConstructorStub"); | 2212 BasePrintName(os, "ArrayNoArgumentConstructorStub"); |
2239 } | 2213 } |
2240 | 2214 |
2241 DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub); | 2215 DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub); |
2242 }; | 2216 }; |
2243 | 2217 |
2244 | 2218 |
2245 class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase { | 2219 class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase { |
2246 public: | 2220 public: |
2247 ArraySingleArgumentConstructorStub( | 2221 ArraySingleArgumentConstructorStub( |
2248 Isolate* isolate, | 2222 Isolate* isolate, |
2249 ElementsKind kind, | 2223 ElementsKind kind, |
2250 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 2224 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
2251 : ArrayConstructorStubBase(isolate, kind, override_mode) { | 2225 : ArrayConstructorStubBase(isolate, kind, override_mode) { |
2252 } | 2226 } |
2253 | 2227 |
2254 virtual Handle<Code> GenerateCode() OVERRIDE; | 2228 virtual Handle<Code> GenerateCode() OVERRIDE; |
2255 | 2229 |
2256 virtual void InitializeInterfaceDescriptor( | 2230 virtual void InitializeInterfaceDescriptor( |
2257 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 2231 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2258 | 2232 |
2259 private: | 2233 private: |
2260 virtual Major MajorKey() const OVERRIDE { | 2234 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2261 return ArraySingleArgumentConstructor; | |
2262 } | |
2263 | 2235 |
2264 virtual void PrintName(OStream& os) const { // NOLINT | 2236 virtual void PrintName(OStream& os) const { // NOLINT |
2265 BasePrintName(os, "ArraySingleArgumentConstructorStub"); | 2237 BasePrintName(os, "ArraySingleArgumentConstructorStub"); |
2266 } | 2238 } |
2267 | 2239 |
2268 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); | 2240 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); |
2269 }; | 2241 }; |
2270 | 2242 |
2271 | 2243 |
2272 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { | 2244 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { |
2273 public: | 2245 public: |
2274 ArrayNArgumentsConstructorStub( | 2246 ArrayNArgumentsConstructorStub( |
2275 Isolate* isolate, | 2247 Isolate* isolate, |
2276 ElementsKind kind, | 2248 ElementsKind kind, |
2277 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 2249 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
2278 : ArrayConstructorStubBase(isolate, kind, override_mode) { | 2250 : ArrayConstructorStubBase(isolate, kind, override_mode) { |
2279 } | 2251 } |
2280 | 2252 |
2281 virtual Handle<Code> GenerateCode() OVERRIDE; | 2253 virtual Handle<Code> GenerateCode() OVERRIDE; |
2282 | 2254 |
2283 virtual void InitializeInterfaceDescriptor( | 2255 virtual void InitializeInterfaceDescriptor( |
2284 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 2256 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2285 | 2257 |
2286 private: | 2258 private: |
2287 virtual Major MajorKey() const OVERRIDE { | 2259 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2288 return ArrayNArgumentsConstructor; | |
2289 } | |
2290 | 2260 |
2291 virtual void PrintName(OStream& os) const { // NOLINT | 2261 virtual void PrintName(OStream& os) const { // NOLINT |
2292 BasePrintName(os, "ArrayNArgumentsConstructorStub"); | 2262 BasePrintName(os, "ArrayNArgumentsConstructorStub"); |
2293 } | 2263 } |
2294 | 2264 |
2295 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); | 2265 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); |
2296 }; | 2266 }; |
2297 | 2267 |
2298 | 2268 |
2299 class InternalArrayConstructorStubBase : public HydrogenCodeStub { | 2269 class InternalArrayConstructorStubBase : public HydrogenCodeStub { |
(...skipping 26 matching lines...) Expand all Loading... |
2326 InternalArrayNoArgumentConstructorStub(Isolate* isolate, | 2296 InternalArrayNoArgumentConstructorStub(Isolate* isolate, |
2327 ElementsKind kind) | 2297 ElementsKind kind) |
2328 : InternalArrayConstructorStubBase(isolate, kind) { } | 2298 : InternalArrayConstructorStubBase(isolate, kind) { } |
2329 | 2299 |
2330 virtual Handle<Code> GenerateCode() OVERRIDE; | 2300 virtual Handle<Code> GenerateCode() OVERRIDE; |
2331 | 2301 |
2332 virtual void InitializeInterfaceDescriptor( | 2302 virtual void InitializeInterfaceDescriptor( |
2333 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 2303 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2334 | 2304 |
2335 private: | 2305 private: |
2336 virtual Major MajorKey() const OVERRIDE { | 2306 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2337 return InternalArrayNoArgumentConstructor; | |
2338 } | |
2339 | 2307 |
2340 DISALLOW_COPY_AND_ASSIGN(InternalArrayNoArgumentConstructorStub); | 2308 DISALLOW_COPY_AND_ASSIGN(InternalArrayNoArgumentConstructorStub); |
2341 }; | 2309 }; |
2342 | 2310 |
2343 | 2311 |
2344 class InternalArraySingleArgumentConstructorStub : public | 2312 class InternalArraySingleArgumentConstructorStub : public |
2345 InternalArrayConstructorStubBase { | 2313 InternalArrayConstructorStubBase { |
2346 public: | 2314 public: |
2347 InternalArraySingleArgumentConstructorStub(Isolate* isolate, | 2315 InternalArraySingleArgumentConstructorStub(Isolate* isolate, |
2348 ElementsKind kind) | 2316 ElementsKind kind) |
2349 : InternalArrayConstructorStubBase(isolate, kind) { } | 2317 : InternalArrayConstructorStubBase(isolate, kind) { } |
2350 | 2318 |
2351 virtual Handle<Code> GenerateCode() OVERRIDE; | 2319 virtual Handle<Code> GenerateCode() OVERRIDE; |
2352 | 2320 |
2353 virtual void InitializeInterfaceDescriptor( | 2321 virtual void InitializeInterfaceDescriptor( |
2354 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 2322 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2355 | 2323 |
2356 private: | 2324 private: |
2357 virtual Major MajorKey() const OVERRIDE { | 2325 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2358 return InternalArraySingleArgumentConstructor; | |
2359 } | |
2360 | 2326 |
2361 DISALLOW_COPY_AND_ASSIGN(InternalArraySingleArgumentConstructorStub); | 2327 DISALLOW_COPY_AND_ASSIGN(InternalArraySingleArgumentConstructorStub); |
2362 }; | 2328 }; |
2363 | 2329 |
2364 | 2330 |
2365 class InternalArrayNArgumentsConstructorStub : public | 2331 class InternalArrayNArgumentsConstructorStub : public |
2366 InternalArrayConstructorStubBase { | 2332 InternalArrayConstructorStubBase { |
2367 public: | 2333 public: |
2368 InternalArrayNArgumentsConstructorStub(Isolate* isolate, ElementsKind kind) | 2334 InternalArrayNArgumentsConstructorStub(Isolate* isolate, ElementsKind kind) |
2369 : InternalArrayConstructorStubBase(isolate, kind) { } | 2335 : InternalArrayConstructorStubBase(isolate, kind) { } |
2370 | 2336 |
2371 virtual Handle<Code> GenerateCode() OVERRIDE; | 2337 virtual Handle<Code> GenerateCode() OVERRIDE; |
2372 | 2338 |
2373 virtual void InitializeInterfaceDescriptor( | 2339 virtual void InitializeInterfaceDescriptor( |
2374 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 2340 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; |
2375 | 2341 |
2376 private: | 2342 private: |
2377 virtual Major MajorKey() const OVERRIDE { | 2343 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2378 return InternalArrayNArgumentsConstructor; | |
2379 } | |
2380 | 2344 |
2381 DISALLOW_COPY_AND_ASSIGN(InternalArrayNArgumentsConstructorStub); | 2345 DISALLOW_COPY_AND_ASSIGN(InternalArrayNArgumentsConstructorStub); |
2382 }; | 2346 }; |
2383 | 2347 |
2384 | 2348 |
2385 class StoreElementStub : public PlatformCodeStub { | 2349 class StoreElementStub : public PlatformCodeStub { |
2386 public: | 2350 public: |
2387 StoreElementStub(Isolate* isolate, ElementsKind elements_kind) | 2351 StoreElementStub(Isolate* isolate, ElementsKind elements_kind) |
2388 : PlatformCodeStub(isolate) { | 2352 : PlatformCodeStub(isolate) { |
2389 minor_key_ = ElementsKindBits::encode(elements_kind); | 2353 minor_key_ = ElementsKindBits::encode(elements_kind); |
2390 } | 2354 } |
2391 | 2355 |
2392 void Generate(MacroAssembler* masm); | 2356 void Generate(MacroAssembler* masm); |
2393 | 2357 |
2394 private: | 2358 private: |
2395 virtual Major MajorKey() const OVERRIDE { return StoreElement; } | 2359 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2396 | 2360 |
2397 ElementsKind elements_kind() const { | 2361 ElementsKind elements_kind() const { |
2398 return ElementsKindBits::decode(minor_key_); | 2362 return ElementsKindBits::decode(minor_key_); |
2399 } | 2363 } |
2400 | 2364 |
2401 class ElementsKindBits : public BitField<ElementsKind, 0, 8> {}; | 2365 class ElementsKindBits : public BitField<ElementsKind, 0, 8> {}; |
2402 | 2366 |
2403 DISALLOW_COPY_AND_ASSIGN(StoreElementStub); | 2367 DISALLOW_COPY_AND_ASSIGN(StoreElementStub); |
2404 }; | 2368 }; |
2405 | 2369 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2481 | 2445 |
2482 virtual InlineCacheState GetICState() const { | 2446 virtual InlineCacheState GetICState() const { |
2483 if (types().IsEmpty()) { | 2447 if (types().IsEmpty()) { |
2484 return ::v8::internal::UNINITIALIZED; | 2448 return ::v8::internal::UNINITIALIZED; |
2485 } else { | 2449 } else { |
2486 return MONOMORPHIC; | 2450 return MONOMORPHIC; |
2487 } | 2451 } |
2488 } | 2452 } |
2489 | 2453 |
2490 private: | 2454 private: |
2491 virtual Major MajorKey() const OVERRIDE { return ToBoolean; } | |
2492 | |
2493 ToBooleanStub(Isolate* isolate, InitializationState init_state) | 2455 ToBooleanStub(Isolate* isolate, InitializationState init_state) |
2494 : HydrogenCodeStub(isolate, init_state) { | 2456 : HydrogenCodeStub(isolate, init_state) { |
2495 set_sub_minor_key(ResultModeBits::encode(RESULT_AS_SMI)); | 2457 set_sub_minor_key(ResultModeBits::encode(RESULT_AS_SMI)); |
2496 } | 2458 } |
2497 | 2459 |
| 2460 virtual inline Major MajorKey() const FINAL OVERRIDE; |
| 2461 |
2498 class TypesBits : public BitField<byte, 0, NUMBER_OF_TYPES> {}; | 2462 class TypesBits : public BitField<byte, 0, NUMBER_OF_TYPES> {}; |
2499 class ResultModeBits : public BitField<ResultMode, NUMBER_OF_TYPES, 2> {}; | 2463 class ResultModeBits : public BitField<ResultMode, NUMBER_OF_TYPES, 2> {}; |
2500 | 2464 |
2501 DISALLOW_COPY_AND_ASSIGN(ToBooleanStub); | 2465 DISALLOW_COPY_AND_ASSIGN(ToBooleanStub); |
2502 }; | 2466 }; |
2503 | 2467 |
2504 | 2468 |
2505 OStream& operator<<(OStream& os, const ToBooleanStub::Types& t); | 2469 OStream& operator<<(OStream& os, const ToBooleanStub::Types& t); |
2506 | 2470 |
2507 | 2471 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2544 return ElementTransitionAndStoreDescriptor::MapRegister(); | 2508 return ElementTransitionAndStoreDescriptor::MapRegister(); |
2545 } | 2509 } |
2546 static const Register KeyRegister() { | 2510 static const Register KeyRegister() { |
2547 return ElementTransitionAndStoreDescriptor::NameRegister(); | 2511 return ElementTransitionAndStoreDescriptor::NameRegister(); |
2548 } | 2512 } |
2549 static const Register ObjectRegister() { | 2513 static const Register ObjectRegister() { |
2550 return ElementTransitionAndStoreDescriptor::ReceiverRegister(); | 2514 return ElementTransitionAndStoreDescriptor::ReceiverRegister(); |
2551 } | 2515 } |
2552 | 2516 |
2553 private: | 2517 private: |
2554 virtual Major MajorKey() const OVERRIDE { | 2518 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2555 return ElementsTransitionAndStore; | |
2556 } | |
2557 | 2519 |
2558 class FromBits : public BitField<ElementsKind, 0, 8> {}; | 2520 class FromBits : public BitField<ElementsKind, 0, 8> {}; |
2559 class ToBits : public BitField<ElementsKind, 8, 8> {}; | 2521 class ToBits : public BitField<ElementsKind, 8, 8> {}; |
2560 class IsJSArrayBits : public BitField<bool, 16, 1> {}; | 2522 class IsJSArrayBits : public BitField<bool, 16, 1> {}; |
2561 class StoreModeBits : public BitField<KeyedAccessStoreMode, 17, 4> {}; | 2523 class StoreModeBits : public BitField<KeyedAccessStoreMode, 17, 4> {}; |
2562 | 2524 |
2563 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); | 2525 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); |
2564 }; | 2526 }; |
2565 | 2527 |
2566 | 2528 |
2567 class StoreArrayLiteralElementStub : public PlatformCodeStub { | 2529 class StoreArrayLiteralElementStub : public PlatformCodeStub { |
2568 public: | 2530 public: |
2569 explicit StoreArrayLiteralElementStub(Isolate* isolate) | 2531 explicit StoreArrayLiteralElementStub(Isolate* isolate) |
2570 : PlatformCodeStub(isolate) { } | 2532 : PlatformCodeStub(isolate) { } |
2571 | 2533 |
2572 private: | 2534 private: |
2573 virtual Major MajorKey() const OVERRIDE { | 2535 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2574 return StoreArrayLiteralElement; | |
2575 } | |
2576 | 2536 |
2577 void Generate(MacroAssembler* masm); | 2537 void Generate(MacroAssembler* masm); |
2578 | 2538 |
2579 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub); | 2539 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub); |
2580 }; | 2540 }; |
2581 | 2541 |
2582 | 2542 |
2583 class StubFailureTrampolineStub : public PlatformCodeStub { | 2543 class StubFailureTrampolineStub : public PlatformCodeStub { |
2584 public: | 2544 public: |
2585 StubFailureTrampolineStub(Isolate* isolate, StubFunctionMode function_mode) | 2545 StubFailureTrampolineStub(Isolate* isolate, StubFunctionMode function_mode) |
2586 : PlatformCodeStub(isolate) { | 2546 : PlatformCodeStub(isolate) { |
2587 minor_key_ = FunctionModeField::encode(function_mode); | 2547 minor_key_ = FunctionModeField::encode(function_mode); |
2588 } | 2548 } |
2589 | 2549 |
2590 static void GenerateAheadOfTime(Isolate* isolate); | 2550 static void GenerateAheadOfTime(Isolate* isolate); |
2591 | 2551 |
2592 private: | 2552 private: |
2593 virtual Major MajorKey() const OVERRIDE { return StubFailureTrampoline; } | 2553 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2594 | 2554 |
2595 StubFunctionMode function_mode() const { | 2555 StubFunctionMode function_mode() const { |
2596 return FunctionModeField::decode(minor_key_); | 2556 return FunctionModeField::decode(minor_key_); |
2597 } | 2557 } |
2598 | 2558 |
2599 void Generate(MacroAssembler* masm); | 2559 void Generate(MacroAssembler* masm); |
2600 | 2560 |
2601 class FunctionModeField : public BitField<StubFunctionMode, 0, 1> {}; | 2561 class FunctionModeField : public BitField<StubFunctionMode, 0, 1> {}; |
2602 | 2562 |
2603 DISALLOW_COPY_AND_ASSIGN(StubFailureTrampolineStub); | 2563 DISALLOW_COPY_AND_ASSIGN(StubFailureTrampolineStub); |
2604 }; | 2564 }; |
2605 | 2565 |
2606 | 2566 |
2607 class ProfileEntryHookStub : public PlatformCodeStub { | 2567 class ProfileEntryHookStub : public PlatformCodeStub { |
2608 public: | 2568 public: |
2609 explicit ProfileEntryHookStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2569 explicit ProfileEntryHookStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
2610 | 2570 |
2611 // The profile entry hook function is not allowed to cause a GC. | 2571 // The profile entry hook function is not allowed to cause a GC. |
2612 virtual bool SometimesSetsUpAFrame() { return false; } | 2572 virtual bool SometimesSetsUpAFrame() { return false; } |
2613 | 2573 |
2614 // Generates a call to the entry hook if it's enabled. | 2574 // Generates a call to the entry hook if it's enabled. |
2615 static void MaybeCallEntryHook(MacroAssembler* masm); | 2575 static void MaybeCallEntryHook(MacroAssembler* masm); |
2616 | 2576 |
2617 private: | 2577 private: |
2618 static void EntryHookTrampoline(intptr_t function, | 2578 static void EntryHookTrampoline(intptr_t function, |
2619 intptr_t stack_pointer, | 2579 intptr_t stack_pointer, |
2620 Isolate* isolate); | 2580 Isolate* isolate); |
2621 | 2581 |
2622 virtual Major MajorKey() const OVERRIDE { return ProfileEntryHook; } | 2582 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2623 | 2583 |
2624 void Generate(MacroAssembler* masm); | 2584 void Generate(MacroAssembler* masm); |
2625 | 2585 |
2626 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2586 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
2627 }; | 2587 }; |
2628 | 2588 |
2629 | 2589 |
2630 class StoreBufferOverflowStub : public PlatformCodeStub { | 2590 class StoreBufferOverflowStub : public PlatformCodeStub { |
2631 public: | 2591 public: |
2632 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp) | 2592 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp) |
2633 : PlatformCodeStub(isolate) { | 2593 : PlatformCodeStub(isolate) { |
2634 minor_key_ = SaveDoublesBits::encode(save_fp == kSaveFPRegs); | 2594 minor_key_ = SaveDoublesBits::encode(save_fp == kSaveFPRegs); |
2635 } | 2595 } |
2636 | 2596 |
2637 void Generate(MacroAssembler* masm); | 2597 void Generate(MacroAssembler* masm); |
2638 | 2598 |
2639 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 2599 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
2640 virtual bool SometimesSetsUpAFrame() { return false; } | 2600 virtual bool SometimesSetsUpAFrame() { return false; } |
2641 | 2601 |
2642 private: | 2602 private: |
2643 Major MajorKey() const OVERRIDE { return StoreBufferOverflow; } | 2603 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2644 | 2604 |
2645 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } | 2605 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } |
2646 | 2606 |
2647 class SaveDoublesBits : public BitField<bool, 0, 1> {}; | 2607 class SaveDoublesBits : public BitField<bool, 0, 1> {}; |
2648 | 2608 |
2649 DISALLOW_COPY_AND_ASSIGN(StoreBufferOverflowStub); | 2609 DISALLOW_COPY_AND_ASSIGN(StoreBufferOverflowStub); |
2650 }; | 2610 }; |
2651 | 2611 |
2652 | 2612 |
2653 class SubStringStub : public PlatformCodeStub { | 2613 class SubStringStub : public PlatformCodeStub { |
2654 public: | 2614 public: |
2655 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2615 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
2656 | 2616 |
2657 private: | 2617 private: |
2658 Major MajorKey() const OVERRIDE { return SubString; } | 2618 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2659 | 2619 |
2660 void Generate(MacroAssembler* masm); | 2620 void Generate(MacroAssembler* masm); |
2661 | 2621 |
2662 DISALLOW_COPY_AND_ASSIGN(SubStringStub); | 2622 DISALLOW_COPY_AND_ASSIGN(SubStringStub); |
2663 }; | 2623 }; |
2664 | 2624 |
2665 | 2625 |
2666 class StringCompareStub : public PlatformCodeStub { | 2626 class StringCompareStub : public PlatformCodeStub { |
2667 public: | 2627 public: |
2668 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2628 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
2669 | 2629 |
2670 private: | 2630 private: |
2671 virtual Major MajorKey() const { return StringCompare; } | 2631 virtual inline Major MajorKey() const FINAL OVERRIDE; |
2672 | 2632 |
2673 virtual void Generate(MacroAssembler* masm); | 2633 virtual void Generate(MacroAssembler* masm); |
2674 | 2634 |
2675 DISALLOW_COPY_AND_ASSIGN(StringCompareStub); | 2635 DISALLOW_COPY_AND_ASSIGN(StringCompareStub); |
2676 }; | 2636 }; |
| 2637 |
| 2638 |
| 2639 #define DEFINE_MAJOR_KEY(NAME) \ |
| 2640 CodeStub::Major NAME##Stub::MajorKey() const { return NAME; } |
| 2641 |
| 2642 CODE_STUB_LIST(DEFINE_MAJOR_KEY) |
| 2643 |
| 2644 #undef DEFINE_MAJOR_KEY |
2677 } } // namespace v8::internal | 2645 } } // namespace v8::internal |
2678 | 2646 |
2679 #endif // V8_CODE_STUBS_H_ | 2647 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |