| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 V(ToNumber) \ | 70 V(ToNumber) \ |
| 71 V(ArgumentsAccess) \ | 71 V(ArgumentsAccess) \ |
| 72 V(RegExpConstructResult) \ | 72 V(RegExpConstructResult) \ |
| 73 V(NumberToString) \ | 73 V(NumberToString) \ |
| 74 V(CEntry) \ | 74 V(CEntry) \ |
| 75 V(JSEntry) \ | 75 V(JSEntry) \ |
| 76 V(KeyedLoadElement) \ | 76 V(KeyedLoadElement) \ |
| 77 V(ArrayNoArgumentConstructor) \ | 77 V(ArrayNoArgumentConstructor) \ |
| 78 V(ArraySingleArgumentConstructor) \ | 78 V(ArraySingleArgumentConstructor) \ |
| 79 V(ArrayNArgumentsConstructor) \ | 79 V(ArrayNArgumentsConstructor) \ |
| 80 V(InternalArrayNoArgumentConstructor) \ |
| 81 V(InternalArraySingleArgumentConstructor) \ |
| 82 V(InternalArrayNArgumentsConstructor) \ |
| 80 V(KeyedStoreElement) \ | 83 V(KeyedStoreElement) \ |
| 81 V(DebuggerStatement) \ | 84 V(DebuggerStatement) \ |
| 82 V(NameDictionaryLookup) \ | 85 V(NameDictionaryLookup) \ |
| 83 V(ElementsTransitionAndStore) \ | 86 V(ElementsTransitionAndStore) \ |
| 84 V(TransitionElementsKind) \ | 87 V(TransitionElementsKind) \ |
| 85 V(StoreArrayLiteralElement) \ | 88 V(StoreArrayLiteralElement) \ |
| 86 V(StubFailureTrampoline) \ | 89 V(StubFailureTrampoline) \ |
| 87 V(ArrayConstructor) \ | 90 V(ArrayConstructor) \ |
| 91 V(InternalArrayConstructor) \ |
| 88 V(ProfileEntryHook) \ | 92 V(ProfileEntryHook) \ |
| 89 /* IC Handler stubs */ \ | 93 /* IC Handler stubs */ \ |
| 90 V(LoadField) \ | 94 V(LoadField) \ |
| 91 V(KeyedLoadField) | 95 V(KeyedLoadField) |
| 92 | 96 |
| 93 // List of code stubs only used on ARM platforms. | 97 // List of code stubs only used on ARM platforms. |
| 94 #ifdef V8_TARGET_ARCH_ARM | 98 #ifdef V8_TARGET_ARCH_ARM |
| 95 #define CODE_STUB_LIST_ARM(V) \ | 99 #define CODE_STUB_LIST_ARM(V) \ |
| 96 V(GetProperty) \ | 100 V(GetProperty) \ |
| 97 V(SetProperty) \ | 101 V(SetProperty) \ |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 void Generate(MacroAssembler* masm); | 667 void Generate(MacroAssembler* masm); |
| 664 | 668 |
| 665 private: | 669 private: |
| 666 virtual CodeStub::Major MajorKey() { return ArrayConstructor; } | 670 virtual CodeStub::Major MajorKey() { return ArrayConstructor; } |
| 667 virtual int MinorKey() { return argument_count_; } | 671 virtual int MinorKey() { return argument_count_; } |
| 668 | 672 |
| 669 ArgumentCountKey argument_count_; | 673 ArgumentCountKey argument_count_; |
| 670 }; | 674 }; |
| 671 | 675 |
| 672 | 676 |
| 677 class InternalArrayConstructorStub: public PlatformCodeStub { |
| 678 public: |
| 679 explicit InternalArrayConstructorStub(Isolate* isolate); |
| 680 |
| 681 void Generate(MacroAssembler* masm); |
| 682 |
| 683 private: |
| 684 virtual CodeStub::Major MajorKey() { return InternalArrayConstructor; } |
| 685 virtual int MinorKey() { return 0; } |
| 686 |
| 687 void GenerateCase(MacroAssembler* masm, ElementsKind kind); |
| 688 }; |
| 689 |
| 690 |
| 673 class MathPowStub: public PlatformCodeStub { | 691 class MathPowStub: public PlatformCodeStub { |
| 674 public: | 692 public: |
| 675 enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK }; | 693 enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK }; |
| 676 | 694 |
| 677 explicit MathPowStub(ExponentType exponent_type) | 695 explicit MathPowStub(ExponentType exponent_type) |
| 678 : exponent_type_(exponent_type) { } | 696 : exponent_type_(exponent_type) { } |
| 679 virtual void Generate(MacroAssembler* masm); | 697 virtual void Generate(MacroAssembler* masm); |
| 680 | 698 |
| 681 private: | 699 private: |
| 682 virtual CodeStub::Major MajorKey() { return MathPow; } | 700 virtual CodeStub::Major MajorKey() { return MathPow; } |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1705 | 1723 |
| 1706 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1724 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 1707 static const int kConstructor = 0; | 1725 static const int kConstructor = 0; |
| 1708 static const int kPropertyCell = 1; | 1726 static const int kPropertyCell = 1; |
| 1709 | 1727 |
| 1710 private: | 1728 private: |
| 1711 int NotMissMinorKey() { return bit_field_; } | 1729 int NotMissMinorKey() { return bit_field_; } |
| 1712 | 1730 |
| 1713 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 1731 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 1714 class AllocationSiteModeBits: public BitField<bool, 8, 1> {}; | 1732 class AllocationSiteModeBits: public BitField<bool, 8, 1> {}; |
| 1733 |
| 1715 uint32_t bit_field_; | 1734 uint32_t bit_field_; |
| 1716 | 1735 |
| 1717 DISALLOW_COPY_AND_ASSIGN(ArrayConstructorStubBase); | 1736 DISALLOW_COPY_AND_ASSIGN(ArrayConstructorStubBase); |
| 1718 }; | 1737 }; |
| 1719 | 1738 |
| 1720 | 1739 |
| 1721 class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase { | 1740 class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase { |
| 1722 public: | 1741 public: |
| 1723 ArrayNoArgumentConstructorStub( | 1742 ArrayNoArgumentConstructorStub( |
| 1724 ElementsKind kind, | 1743 ElementsKind kind, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1757 Major MajorKey() { return ArraySingleArgumentConstructor; } | 1776 Major MajorKey() { return ArraySingleArgumentConstructor; } |
| 1758 | 1777 |
| 1759 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); | 1778 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); |
| 1760 }; | 1779 }; |
| 1761 | 1780 |
| 1762 | 1781 |
| 1763 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { | 1782 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { |
| 1764 public: | 1783 public: |
| 1765 ArrayNArgumentsConstructorStub( | 1784 ArrayNArgumentsConstructorStub( |
| 1766 ElementsKind kind, | 1785 ElementsKind kind, |
| 1767 AllocationSiteMode mode = TRACK_ALLOCATION_SITE) : | 1786 AllocationSiteMode mode = TRACK_ALLOCATION_SITE) |
| 1768 ArrayConstructorStubBase(kind, mode) { | 1787 : ArrayConstructorStubBase(kind, mode) { |
| 1769 } | 1788 } |
| 1770 | 1789 |
| 1771 virtual Handle<Code> GenerateCode(); | 1790 virtual Handle<Code> GenerateCode(); |
| 1772 | 1791 |
| 1773 virtual void InitializeInterfaceDescriptor( | 1792 virtual void InitializeInterfaceDescriptor( |
| 1774 Isolate* isolate, | 1793 Isolate* isolate, |
| 1775 CodeStubInterfaceDescriptor* descriptor); | 1794 CodeStubInterfaceDescriptor* descriptor); |
| 1776 | 1795 |
| 1777 private: | 1796 private: |
| 1778 Major MajorKey() { return ArrayNArgumentsConstructor; } | 1797 Major MajorKey() { return ArrayNArgumentsConstructor; } |
| 1779 | 1798 |
| 1780 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); | 1799 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); |
| 1781 }; | 1800 }; |
| 1782 | 1801 |
| 1783 | 1802 |
| 1803 class InternalArrayConstructorStubBase : public HydrogenCodeStub { |
| 1804 public: |
| 1805 explicit InternalArrayConstructorStubBase(ElementsKind kind) { |
| 1806 kind_ = kind; |
| 1807 } |
| 1808 |
| 1809 virtual bool IsPregenerated() { return true; } |
| 1810 static void GenerateStubsAheadOfTime(Isolate* isolate); |
| 1811 static void InstallDescriptors(Isolate* isolate); |
| 1812 |
| 1813 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 1814 static const int kConstructor = 0; |
| 1815 |
| 1816 ElementsKind elements_kind() const { return kind_; } |
| 1817 |
| 1818 private: |
| 1819 int NotMissMinorKey() { return kind_; } |
| 1820 |
| 1821 ElementsKind kind_; |
| 1822 |
| 1823 DISALLOW_COPY_AND_ASSIGN(InternalArrayConstructorStubBase); |
| 1824 }; |
| 1825 |
| 1826 |
| 1827 class InternalArrayNoArgumentConstructorStub : public |
| 1828 InternalArrayConstructorStubBase { |
| 1829 public: |
| 1830 explicit InternalArrayNoArgumentConstructorStub(ElementsKind kind) |
| 1831 : InternalArrayConstructorStubBase(kind) { } |
| 1832 |
| 1833 virtual Handle<Code> GenerateCode(); |
| 1834 |
| 1835 virtual void InitializeInterfaceDescriptor( |
| 1836 Isolate* isolate, |
| 1837 CodeStubInterfaceDescriptor* descriptor); |
| 1838 |
| 1839 private: |
| 1840 Major MajorKey() { return InternalArrayNoArgumentConstructor; } |
| 1841 |
| 1842 DISALLOW_COPY_AND_ASSIGN(InternalArrayNoArgumentConstructorStub); |
| 1843 }; |
| 1844 |
| 1845 |
| 1846 class InternalArraySingleArgumentConstructorStub : public |
| 1847 InternalArrayConstructorStubBase { |
| 1848 public: |
| 1849 explicit InternalArraySingleArgumentConstructorStub(ElementsKind kind) |
| 1850 : InternalArrayConstructorStubBase(kind) { } |
| 1851 |
| 1852 virtual Handle<Code> GenerateCode(); |
| 1853 |
| 1854 virtual void InitializeInterfaceDescriptor( |
| 1855 Isolate* isolate, |
| 1856 CodeStubInterfaceDescriptor* descriptor); |
| 1857 |
| 1858 private: |
| 1859 Major MajorKey() { return InternalArraySingleArgumentConstructor; } |
| 1860 |
| 1861 DISALLOW_COPY_AND_ASSIGN(InternalArraySingleArgumentConstructorStub); |
| 1862 }; |
| 1863 |
| 1864 |
| 1865 class InternalArrayNArgumentsConstructorStub : public |
| 1866 InternalArrayConstructorStubBase { |
| 1867 public: |
| 1868 explicit InternalArrayNArgumentsConstructorStub(ElementsKind kind) |
| 1869 : InternalArrayConstructorStubBase(kind) { } |
| 1870 |
| 1871 virtual Handle<Code> GenerateCode(); |
| 1872 |
| 1873 virtual void InitializeInterfaceDescriptor( |
| 1874 Isolate* isolate, |
| 1875 CodeStubInterfaceDescriptor* descriptor); |
| 1876 |
| 1877 private: |
| 1878 Major MajorKey() { return InternalArrayNArgumentsConstructor; } |
| 1879 |
| 1880 DISALLOW_COPY_AND_ASSIGN(InternalArrayNArgumentsConstructorStub); |
| 1881 }; |
| 1882 |
| 1883 |
| 1784 class KeyedStoreElementStub : public PlatformCodeStub { | 1884 class KeyedStoreElementStub : public PlatformCodeStub { |
| 1785 public: | 1885 public: |
| 1786 KeyedStoreElementStub(bool is_js_array, | 1886 KeyedStoreElementStub(bool is_js_array, |
| 1787 ElementsKind elements_kind, | 1887 ElementsKind elements_kind, |
| 1788 KeyedAccessStoreMode store_mode) | 1888 KeyedAccessStoreMode store_mode) |
| 1789 : is_js_array_(is_js_array), | 1889 : is_js_array_(is_js_array), |
| 1790 elements_kind_(elements_kind), | 1890 elements_kind_(elements_kind), |
| 1791 store_mode_(store_mode), | 1891 store_mode_(store_mode), |
| 1792 fp_registers_(CanUseFPRegisters()) { } | 1892 fp_registers_(CanUseFPRegisters()) { } |
| 1793 | 1893 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 | 2111 |
| 2012 // The current function entry hook. | 2112 // The current function entry hook. |
| 2013 static FunctionEntryHook entry_hook_; | 2113 static FunctionEntryHook entry_hook_; |
| 2014 | 2114 |
| 2015 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2115 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
| 2016 }; | 2116 }; |
| 2017 | 2117 |
| 2018 } } // namespace v8::internal | 2118 } } // namespace v8::internal |
| 2019 | 2119 |
| 2020 #endif // V8_CODE_STUBS_H_ | 2120 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |