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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 public: | 733 public: |
734 enum ArgumentCountKey { ANY, NONE, ONE, MORE_THAN_ONE }; | 734 enum ArgumentCountKey { ANY, NONE, ONE, MORE_THAN_ONE }; |
735 ArrayConstructorStub(Isolate* isolate, int argument_count); | 735 ArrayConstructorStub(Isolate* isolate, int argument_count); |
736 explicit ArrayConstructorStub(Isolate* isolate); | 736 explicit ArrayConstructorStub(Isolate* isolate); |
737 | 737 |
738 void Generate(MacroAssembler* masm); | 738 void Generate(MacroAssembler* masm); |
739 | 739 |
740 private: | 740 private: |
741 void GenerateDispatchToArrayStub(MacroAssembler* masm, | 741 void GenerateDispatchToArrayStub(MacroAssembler* masm, |
742 AllocationSiteOverrideMode mode); | 742 AllocationSiteOverrideMode mode); |
| 743 virtual void PrintName(StringStream* stream); |
743 | 744 |
744 virtual CodeStub::Major MajorKey() { return ArrayConstructor; } | 745 virtual CodeStub::Major MajorKey() { return ArrayConstructor; } |
745 virtual int MinorKey() { return argument_count_; } | 746 virtual int MinorKey() { return argument_count_; } |
746 | 747 |
747 ArgumentCountKey argument_count_; | 748 ArgumentCountKey argument_count_; |
748 }; | 749 }; |
749 | 750 |
750 | 751 |
751 class InternalArrayConstructorStub: public PlatformCodeStub { | 752 class InternalArrayConstructorStub: public PlatformCodeStub { |
752 public: | 753 public: |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 return ContextCheckModeBits::decode(bit_field_); | 1930 return ContextCheckModeBits::decode(bit_field_); |
1930 } | 1931 } |
1931 | 1932 |
1932 static void GenerateStubsAheadOfTime(Isolate* isolate); | 1933 static void GenerateStubsAheadOfTime(Isolate* isolate); |
1933 static void InstallDescriptors(Isolate* isolate); | 1934 static void InstallDescriptors(Isolate* isolate); |
1934 | 1935 |
1935 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1936 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1936 static const int kConstructor = 0; | 1937 static const int kConstructor = 0; |
1937 static const int kPropertyCell = 1; | 1938 static const int kPropertyCell = 1; |
1938 | 1939 |
| 1940 protected: |
| 1941 void BasePrintName(const char* name, StringStream* stream); |
| 1942 |
1939 private: | 1943 private: |
1940 int NotMissMinorKey() { return bit_field_; } | 1944 int NotMissMinorKey() { return bit_field_; } |
1941 | 1945 |
1942 // Ensure data fits within available bits. | 1946 // Ensure data fits within available bits. |
1943 STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1); | 1947 STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1); |
1944 STATIC_ASSERT(LAST_CONTEXT_CHECK_MODE == 1); | 1948 STATIC_ASSERT(LAST_CONTEXT_CHECK_MODE == 1); |
1945 | 1949 |
1946 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 1950 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
1947 class AllocationSiteOverrideModeBits: public | 1951 class AllocationSiteOverrideModeBits: public |
1948 BitField<AllocationSiteOverrideMode, 8, 1> {}; // NOLINT | 1952 BitField<AllocationSiteOverrideMode, 8, 1> {}; // NOLINT |
(...skipping 15 matching lines...) Expand all Loading... |
1964 | 1968 |
1965 virtual Handle<Code> GenerateCode(Isolate* isolate); | 1969 virtual Handle<Code> GenerateCode(Isolate* isolate); |
1966 | 1970 |
1967 virtual void InitializeInterfaceDescriptor( | 1971 virtual void InitializeInterfaceDescriptor( |
1968 Isolate* isolate, | 1972 Isolate* isolate, |
1969 CodeStubInterfaceDescriptor* descriptor); | 1973 CodeStubInterfaceDescriptor* descriptor); |
1970 | 1974 |
1971 private: | 1975 private: |
1972 Major MajorKey() { return ArrayNoArgumentConstructor; } | 1976 Major MajorKey() { return ArrayNoArgumentConstructor; } |
1973 | 1977 |
| 1978 virtual void PrintName(StringStream* stream) { |
| 1979 BasePrintName("ArrayNoArgumentConstructorStub", stream); |
| 1980 } |
| 1981 |
1974 DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub); | 1982 DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub); |
1975 }; | 1983 }; |
1976 | 1984 |
1977 | 1985 |
1978 class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase { | 1986 class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase { |
1979 public: | 1987 public: |
1980 ArraySingleArgumentConstructorStub( | 1988 ArraySingleArgumentConstructorStub( |
1981 ElementsKind kind, | 1989 ElementsKind kind, |
1982 ContextCheckMode context_mode = CONTEXT_CHECK_REQUIRED, | 1990 ContextCheckMode context_mode = CONTEXT_CHECK_REQUIRED, |
1983 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 1991 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
1984 : ArrayConstructorStubBase(kind, context_mode, override_mode) { | 1992 : ArrayConstructorStubBase(kind, context_mode, override_mode) { |
1985 } | 1993 } |
1986 | 1994 |
1987 virtual Handle<Code> GenerateCode(Isolate* isolate); | 1995 virtual Handle<Code> GenerateCode(Isolate* isolate); |
1988 | 1996 |
1989 virtual void InitializeInterfaceDescriptor( | 1997 virtual void InitializeInterfaceDescriptor( |
1990 Isolate* isolate, | 1998 Isolate* isolate, |
1991 CodeStubInterfaceDescriptor* descriptor); | 1999 CodeStubInterfaceDescriptor* descriptor); |
1992 | 2000 |
1993 private: | 2001 private: |
1994 Major MajorKey() { return ArraySingleArgumentConstructor; } | 2002 Major MajorKey() { return ArraySingleArgumentConstructor; } |
1995 | 2003 |
| 2004 virtual void PrintName(StringStream* stream) { |
| 2005 BasePrintName("ArraySingleArgumentConstructorStub", stream); |
| 2006 } |
| 2007 |
1996 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); | 2008 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); |
1997 }; | 2009 }; |
1998 | 2010 |
1999 | 2011 |
2000 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { | 2012 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { |
2001 public: | 2013 public: |
2002 ArrayNArgumentsConstructorStub( | 2014 ArrayNArgumentsConstructorStub( |
2003 ElementsKind kind, | 2015 ElementsKind kind, |
2004 ContextCheckMode context_mode = CONTEXT_CHECK_REQUIRED, | 2016 ContextCheckMode context_mode = CONTEXT_CHECK_REQUIRED, |
2005 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 2017 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
2006 : ArrayConstructorStubBase(kind, context_mode, override_mode) { | 2018 : ArrayConstructorStubBase(kind, context_mode, override_mode) { |
2007 } | 2019 } |
2008 | 2020 |
2009 virtual Handle<Code> GenerateCode(Isolate* isolate); | 2021 virtual Handle<Code> GenerateCode(Isolate* isolate); |
2010 | 2022 |
2011 virtual void InitializeInterfaceDescriptor( | 2023 virtual void InitializeInterfaceDescriptor( |
2012 Isolate* isolate, | 2024 Isolate* isolate, |
2013 CodeStubInterfaceDescriptor* descriptor); | 2025 CodeStubInterfaceDescriptor* descriptor); |
2014 | 2026 |
2015 private: | 2027 private: |
2016 Major MajorKey() { return ArrayNArgumentsConstructor; } | 2028 Major MajorKey() { return ArrayNArgumentsConstructor; } |
2017 | 2029 |
| 2030 virtual void PrintName(StringStream* stream) { |
| 2031 BasePrintName("ArrayNArgumentsConstructorStub", stream); |
| 2032 } |
| 2033 |
2018 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); | 2034 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); |
2019 }; | 2035 }; |
2020 | 2036 |
2021 | 2037 |
2022 class InternalArrayConstructorStubBase : public HydrogenCodeStub { | 2038 class InternalArrayConstructorStubBase : public HydrogenCodeStub { |
2023 public: | 2039 public: |
2024 explicit InternalArrayConstructorStubBase(ElementsKind kind) { | 2040 explicit InternalArrayConstructorStubBase(ElementsKind kind) { |
2025 kind_ = kind; | 2041 kind_ = kind; |
2026 } | 2042 } |
2027 | 2043 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2347 int MinorKey() { return 0; } | 2363 int MinorKey() { return 0; } |
2348 | 2364 |
2349 void Generate(MacroAssembler* masm); | 2365 void Generate(MacroAssembler* masm); |
2350 | 2366 |
2351 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2367 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
2352 }; | 2368 }; |
2353 | 2369 |
2354 } } // namespace v8::internal | 2370 } } // namespace v8::internal |
2355 | 2371 |
2356 #endif // V8_CODE_STUBS_H_ | 2372 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |