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 25 matching lines...) Expand all Loading... |
36 V(InternalArrayConstructor) \ | 36 V(InternalArrayConstructor) \ |
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(StoreIC) \ | |
47 V(KeyedStoreIC) \ | 46 V(KeyedStoreIC) \ |
48 V(KeyedLoadIC) \ | 47 V(KeyedLoadIC) \ |
49 V(LoadGlobalIC) \ | 48 V(LoadGlobalIC) \ |
50 V(FastNewObject) \ | 49 V(FastNewObject) \ |
51 V(FastNewRestParameter) \ | 50 V(FastNewRestParameter) \ |
52 V(FastNewSloppyArguments) \ | 51 V(FastNewSloppyArguments) \ |
53 V(FastNewStrictArguments) \ | 52 V(FastNewStrictArguments) \ |
54 V(NameDictionaryLookup) \ | 53 V(NameDictionaryLookup) \ |
55 /* This can be removed once there are no */ \ | 54 /* This can be removed once there are no */ \ |
56 /* more deopting Hydrogen stubs. */ \ | 55 /* more deopting Hydrogen stubs. */ \ |
57 V(StubFailureTrampoline) \ | 56 V(StubFailureTrampoline) \ |
58 /* These are only called from FCG */ \ | 57 /* These are only called from FCG */ \ |
59 /* They can be removed when only the TF */ \ | 58 /* They can be removed when only the TF */ \ |
60 /* version of the corresponding stub is */ \ | 59 /* version of the corresponding stub is */ \ |
61 /* used universally */ \ | 60 /* used universally */ \ |
62 V(CallICTrampoline) \ | 61 V(CallICTrampoline) \ |
63 V(KeyedLoadICTrampoline) \ | 62 V(KeyedLoadICTrampoline) \ |
64 V(KeyedStoreICTrampoline) \ | 63 V(KeyedStoreICTrampoline) \ |
65 V(StoreICTrampoline) \ | |
66 /* --- HydrogenCodeStubs --- */ \ | 64 /* --- HydrogenCodeStubs --- */ \ |
67 V(StringAdd) \ | 65 V(StringAdd) \ |
68 /* These builtins w/ JS linkage are */ \ | 66 /* These builtins w/ JS linkage are */ \ |
69 /* just fast-cases of C++ builtins. They */ \ | 67 /* just fast-cases of C++ builtins. They */ \ |
70 /* require varg support from TF */ \ | 68 /* require varg support from TF */ \ |
71 V(FastArrayPush) \ | 69 V(FastArrayPush) \ |
72 V(FastFunctionBind) \ | 70 V(FastFunctionBind) \ |
73 /* These will be ported/eliminated */ \ | 71 /* These will be ported/eliminated */ \ |
74 /* as part of the new IC system, ask */ \ | 72 /* as part of the new IC system, ask */ \ |
75 /* ishell before doing anything */ \ | 73 /* ishell before doing anything */ \ |
(...skipping 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 explicit KeyedLoadICTrampolineTFStub(Isolate* isolate) | 2094 explicit KeyedLoadICTrampolineTFStub(Isolate* isolate) |
2097 : LoadICTrampolineStub(isolate) {} | 2095 : LoadICTrampolineStub(isolate) {} |
2098 | 2096 |
2099 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2097 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
2100 | 2098 |
2101 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2099 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
2102 | 2100 |
2103 DEFINE_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); | 2101 DEFINE_CODE_STUB(KeyedLoadICTrampolineTF, LoadICTrampolineStub); |
2104 }; | 2102 }; |
2105 | 2103 |
2106 class StoreICTrampolineStub : public PlatformCodeStub { | 2104 class StoreICTrampolineTFStub : public TurboFanCodeStub { |
2107 public: | 2105 public: |
2108 StoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | 2106 StoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) |
2109 : PlatformCodeStub(isolate) { | 2107 : TurboFanCodeStub(isolate) { |
2110 minor_key_ = state.GetExtraICState(); | 2108 minor_key_ = state.GetExtraICState(); |
2111 } | 2109 } |
2112 | 2110 |
| 2111 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
| 2112 |
2113 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 2113 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
2114 | 2114 |
2115 ExtraICState GetExtraICState() const final { | 2115 ExtraICState GetExtraICState() const final { |
2116 return static_cast<ExtraICState>(minor_key_); | 2116 return static_cast<ExtraICState>(minor_key_); |
2117 } | 2117 } |
2118 | 2118 |
2119 protected: | 2119 protected: |
2120 StoreICState state() const { return StoreICState(GetExtraICState()); } | 2120 StoreICState state() const { return StoreICState(GetExtraICState()); } |
2121 | 2121 |
2122 private: | |
2123 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); | 2122 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); |
2124 DEFINE_PLATFORM_CODE_STUB(StoreICTrampoline, PlatformCodeStub); | 2123 DEFINE_CODE_STUB(StoreICTrampolineTF, TurboFanCodeStub); |
2125 }; | 2124 }; |
2126 | 2125 |
2127 class StoreICTrampolineTFStub : public TurboFanCodeStub { | 2126 class KeyedStoreICTrampolineStub : public PlatformCodeStub { |
2128 public: | 2127 public: |
2129 StoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) | 2128 KeyedStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) |
2130 : TurboFanCodeStub(isolate) { | 2129 : PlatformCodeStub(isolate) { |
2131 minor_key_ = state.GetExtraICState(); | 2130 minor_key_ = state.GetExtraICState(); |
2132 } | 2131 } |
2133 | 2132 |
2134 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2133 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } |
2135 | 2134 |
2136 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | |
2137 ExtraICState GetExtraICState() const final { | 2135 ExtraICState GetExtraICState() const final { |
2138 return static_cast<ExtraICState>(minor_key_); | 2136 return static_cast<ExtraICState>(minor_key_); |
2139 } | 2137 } |
2140 | 2138 |
2141 protected: | 2139 protected: |
2142 StoreICState state() const { return StoreICState(GetExtraICState()); } | 2140 StoreICState state() const { return StoreICState(GetExtraICState()); } |
2143 | 2141 |
| 2142 private: |
2144 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); | 2143 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); |
2145 DEFINE_CODE_STUB(StoreICTrampolineTF, TurboFanCodeStub); | 2144 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, PlatformCodeStub); |
2146 }; | |
2147 | |
2148 class KeyedStoreICTrampolineStub : public StoreICTrampolineStub { | |
2149 public: | |
2150 KeyedStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | |
2151 : StoreICTrampolineStub(isolate, state) {} | |
2152 | |
2153 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | |
2154 | |
2155 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, StoreICTrampolineStub); | |
2156 }; | 2145 }; |
2157 | 2146 |
2158 | 2147 |
2159 class CallICTrampolineStub : public PlatformCodeStub { | 2148 class CallICTrampolineStub : public PlatformCodeStub { |
2160 public: | 2149 public: |
2161 CallICTrampolineStub(Isolate* isolate, const CallICState& state) | 2150 CallICTrampolineStub(Isolate* isolate, const CallICState& state) |
2162 : PlatformCodeStub(isolate) { | 2151 : PlatformCodeStub(isolate) { |
2163 minor_key_ = state.GetExtraICState(); | 2152 minor_key_ = state.GetExtraICState(); |
2164 } | 2153 } |
2165 | 2154 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 public: | 2217 public: |
2229 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} | 2218 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} |
2230 | 2219 |
2231 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2220 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
2232 | 2221 |
2233 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2222 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
2234 | 2223 |
2235 DEFINE_CODE_STUB(KeyedLoadICTF, LoadICStub); | 2224 DEFINE_CODE_STUB(KeyedLoadICTF, LoadICStub); |
2236 }; | 2225 }; |
2237 | 2226 |
2238 class StoreICStub : public PlatformCodeStub { | |
2239 public: | |
2240 StoreICStub(Isolate* isolate, const StoreICState& state) | |
2241 : PlatformCodeStub(isolate) { | |
2242 minor_key_ = state.GetExtraICState(); | |
2243 } | |
2244 | |
2245 void GenerateForTrampoline(MacroAssembler* masm); | |
2246 | |
2247 Code::Kind GetCodeKind() const final { return Code::STORE_IC; } | |
2248 | |
2249 ExtraICState GetExtraICState() const final { | |
2250 return static_cast<ExtraICState>(minor_key_); | |
2251 } | |
2252 | |
2253 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | |
2254 DEFINE_PLATFORM_CODE_STUB(StoreIC, PlatformCodeStub); | |
2255 | |
2256 protected: | |
2257 void GenerateImpl(MacroAssembler* masm, bool in_frame); | |
2258 }; | |
2259 | |
2260 class StoreICTFStub : public TurboFanCodeStub { | 2227 class StoreICTFStub : public TurboFanCodeStub { |
2261 public: | 2228 public: |
2262 StoreICTFStub(Isolate* isolate, const StoreICState& state) | 2229 StoreICTFStub(Isolate* isolate, const StoreICState& state) |
2263 : TurboFanCodeStub(isolate) { | 2230 : TurboFanCodeStub(isolate) { |
2264 minor_key_ = state.GetExtraICState(); | 2231 minor_key_ = state.GetExtraICState(); |
2265 } | 2232 } |
2266 | 2233 |
2267 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2234 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
2268 | 2235 |
2269 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 2236 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2863 #undef DEFINE_HYDROGEN_CODE_STUB | 2830 #undef DEFINE_HYDROGEN_CODE_STUB |
2864 #undef DEFINE_CODE_STUB | 2831 #undef DEFINE_CODE_STUB |
2865 #undef DEFINE_CODE_STUB_BASE | 2832 #undef DEFINE_CODE_STUB_BASE |
2866 | 2833 |
2867 extern Representation RepresentationFromMachineType(MachineType type); | 2834 extern Representation RepresentationFromMachineType(MachineType type); |
2868 | 2835 |
2869 } // namespace internal | 2836 } // namespace internal |
2870 } // namespace v8 | 2837 } // namespace v8 |
2871 | 2838 |
2872 #endif // V8_CODE_STUBS_H_ | 2839 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |