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/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 V(JSEntry) \ | 37 V(JSEntry) \ |
38 V(LoadIndexedString) \ | 38 V(LoadIndexedString) \ |
39 V(MathPow) \ | 39 V(MathPow) \ |
40 V(ProfileEntryHook) \ | 40 V(ProfileEntryHook) \ |
41 V(RecordWrite) \ | 41 V(RecordWrite) \ |
42 V(RegExpExec) \ | 42 V(RegExpExec) \ |
43 V(StoreBufferOverflow) \ | 43 V(StoreBufferOverflow) \ |
44 V(StoreElement) \ | 44 V(StoreElement) \ |
45 V(SubString) \ | 45 V(SubString) \ |
46 V(KeyedStoreIC) \ | 46 V(KeyedStoreIC) \ |
47 V(KeyedLoadIC) \ | |
48 V(LoadGlobalIC) \ | 47 V(LoadGlobalIC) \ |
49 V(FastNewObject) \ | 48 V(FastNewObject) \ |
50 V(FastNewRestParameter) \ | 49 V(FastNewRestParameter) \ |
51 V(FastNewSloppyArguments) \ | 50 V(FastNewSloppyArguments) \ |
52 V(FastNewStrictArguments) \ | 51 V(FastNewStrictArguments) \ |
53 V(NameDictionaryLookup) \ | 52 V(NameDictionaryLookup) \ |
54 /* This can be removed once there are no */ \ | 53 /* This can be removed once there are no */ \ |
55 /* more deopting Hydrogen stubs. */ \ | 54 /* more deopting Hydrogen stubs. */ \ |
56 V(StubFailureTrampoline) \ | 55 V(StubFailureTrampoline) \ |
57 /* These are only called from FCG */ \ | 56 /* These are only called from FCG */ \ |
58 /* They can be removed when only the TF */ \ | 57 /* They can be removed when only the TF */ \ |
59 /* version of the corresponding stub is */ \ | 58 /* version of the corresponding stub is */ \ |
60 /* used universally */ \ | 59 /* used universally */ \ |
61 V(CallICTrampoline) \ | 60 V(CallICTrampoline) \ |
62 V(KeyedLoadICTrampoline) \ | |
63 V(KeyedStoreICTrampoline) \ | 61 V(KeyedStoreICTrampoline) \ |
64 /* --- HydrogenCodeStubs --- */ \ | 62 /* --- HydrogenCodeStubs --- */ \ |
65 V(StringAdd) \ | 63 V(StringAdd) \ |
66 /* These builtins w/ JS linkage are */ \ | 64 /* These builtins w/ JS linkage are */ \ |
67 /* just fast-cases of C++ builtins. They */ \ | 65 /* just fast-cases of C++ builtins. They */ \ |
68 /* require varg support from TF */ \ | 66 /* require varg support from TF */ \ |
69 V(FastArrayPush) \ | 67 V(FastArrayPush) \ |
70 V(FastFunctionBind) \ | 68 V(FastFunctionBind) \ |
71 /* These will be ported/eliminated */ \ | 69 /* These will be ported/eliminated */ \ |
72 /* as part of the new IC system, ask */ \ | 70 /* as part of the new IC system, ask */ \ |
73 /* ishell before doing anything */ \ | 71 /* ishell before doing anything */ \ |
74 V(KeyedLoadGeneric) \ | |
75 V(LoadConstant) \ | 72 V(LoadConstant) \ |
76 V(LoadDictionaryElement) \ | 73 V(LoadDictionaryElement) \ |
77 V(LoadFastElement) \ | 74 V(LoadFastElement) \ |
78 V(LoadField) \ | 75 V(LoadField) \ |
79 /* These should never be ported to TF */ \ | 76 /* These should never be ported to TF */ \ |
80 /* because they are either used only by */ \ | 77 /* because they are either used only by */ \ |
81 /* FCG/Crankshaft or are deprecated */ \ | 78 /* FCG/Crankshaft or are deprecated */ \ |
82 V(BinaryOpIC) \ | 79 V(BinaryOpIC) \ |
83 V(BinaryOpWithAllocationSite) \ | 80 V(BinaryOpWithAllocationSite) \ |
84 V(ToBooleanIC) \ | 81 V(ToBooleanIC) \ |
(...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 | 1984 |
1988 class LoadDictionaryElementStub : public HydrogenCodeStub { | 1985 class LoadDictionaryElementStub : public HydrogenCodeStub { |
1989 public: | 1986 public: |
1990 explicit LoadDictionaryElementStub(Isolate* isolate) | 1987 explicit LoadDictionaryElementStub(Isolate* isolate) |
1991 : HydrogenCodeStub(isolate) {} | 1988 : HydrogenCodeStub(isolate) {} |
1992 | 1989 |
1993 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 1990 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
1994 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); | 1991 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); |
1995 }; | 1992 }; |
1996 | 1993 |
1997 | |
1998 class KeyedLoadGenericStub : public HydrogenCodeStub { | |
1999 public: | |
2000 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | |
2001 | |
2002 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | |
2003 | |
2004 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | |
2005 DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); | |
2006 }; | |
2007 | |
2008 class LoadICTrampolineStub : public TurboFanCodeStub { | 1994 class LoadICTrampolineStub : public TurboFanCodeStub { |
2009 public: | 1995 public: |
2010 explicit LoadICTrampolineStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 1996 explicit LoadICTrampolineStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
2011 | 1997 |
2012 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 1998 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
2013 | 1999 |
2014 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2000 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
2015 | 2001 |
2016 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 2002 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
2017 DEFINE_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); | 2003 DEFINE_CODE_STUB(LoadICTrampoline, TurboFanCodeStub); |
(...skipping 12 matching lines...) Expand all Loading... |
2030 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 2016 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
2031 | 2017 |
2032 ExtraICState GetExtraICState() const final { | 2018 ExtraICState GetExtraICState() const final { |
2033 return static_cast<ExtraICState>(minor_key_); | 2019 return static_cast<ExtraICState>(minor_key_); |
2034 } | 2020 } |
2035 | 2021 |
2036 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); | 2022 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); |
2037 DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); | 2023 DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); |
2038 }; | 2024 }; |
2039 | 2025 |
2040 class KeyedLoadICTrampolineStub : public PlatformCodeStub { | |
2041 public: | |
2042 explicit KeyedLoadICTrampolineStub(Isolate* isolate) | |
2043 : PlatformCodeStub(isolate) {} | |
2044 | |
2045 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | |
2046 | |
2047 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | |
2048 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, PlatformCodeStub); | |
2049 }; | |
2050 | |
2051 class KeyedLoadICTrampolineTFStub : public LoadICTrampolineStub { | 2026 class KeyedLoadICTrampolineTFStub : public LoadICTrampolineStub { |
2052 public: | 2027 public: |
2053 explicit KeyedLoadICTrampolineTFStub(Isolate* isolate) | 2028 explicit KeyedLoadICTrampolineTFStub(Isolate* isolate) |
2054 : LoadICTrampolineStub(isolate) {} | 2029 : LoadICTrampolineStub(isolate) {} |
2055 | 2030 |
2056 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2031 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
2057 | 2032 |
2058 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2033 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
2059 | 2034 |
2060 DEFINE_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); | 2035 DEFINE_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 2125 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
2151 | 2126 |
2152 ExtraICState GetExtraICState() const final { | 2127 ExtraICState GetExtraICState() const final { |
2153 return static_cast<ExtraICState>(minor_key_); | 2128 return static_cast<ExtraICState>(minor_key_); |
2154 } | 2129 } |
2155 | 2130 |
2156 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); | 2131 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); |
2157 DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); | 2132 DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); |
2158 }; | 2133 }; |
2159 | 2134 |
2160 class KeyedLoadICStub : public PlatformCodeStub { | |
2161 public: | |
2162 explicit KeyedLoadICStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | |
2163 | |
2164 void GenerateForTrampoline(MacroAssembler* masm); | |
2165 | |
2166 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | |
2167 | |
2168 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | |
2169 DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub); | |
2170 | |
2171 protected: | |
2172 void GenerateImpl(MacroAssembler* masm, bool in_frame); | |
2173 }; | |
2174 | |
2175 class KeyedLoadICTFStub : public LoadICStub { | 2135 class KeyedLoadICTFStub : public LoadICStub { |
2176 public: | 2136 public: |
2177 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} | 2137 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} |
2178 | 2138 |
2179 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2139 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
2180 | 2140 |
2181 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2141 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
2182 | 2142 |
2183 DEFINE_CODE_STUB(KeyedLoadICTF, LoadICStub); | 2143 DEFINE_CODE_STUB(KeyedLoadICTF, LoadICStub); |
2184 }; | 2144 }; |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2789 #undef DEFINE_HYDROGEN_CODE_STUB | 2749 #undef DEFINE_HYDROGEN_CODE_STUB |
2790 #undef DEFINE_CODE_STUB | 2750 #undef DEFINE_CODE_STUB |
2791 #undef DEFINE_CODE_STUB_BASE | 2751 #undef DEFINE_CODE_STUB_BASE |
2792 | 2752 |
2793 extern Representation RepresentationFromMachineType(MachineType type); | 2753 extern Representation RepresentationFromMachineType(MachineType type); |
2794 | 2754 |
2795 } // namespace internal | 2755 } // namespace internal |
2796 } // namespace v8 | 2756 } // namespace v8 |
2797 | 2757 |
2798 #endif // V8_CODE_STUBS_H_ | 2758 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |