| 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" |
| (...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2107 private: | 2107 private: |
| 2108 StringCharCodeAtGenerator char_code_at_generator_; | 2108 StringCharCodeAtGenerator char_code_at_generator_; |
| 2109 StringCharFromCodeGenerator char_from_code_generator_; | 2109 StringCharFromCodeGenerator char_from_code_generator_; |
| 2110 | 2110 |
| 2111 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); | 2111 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); |
| 2112 }; | 2112 }; |
| 2113 | 2113 |
| 2114 | 2114 |
| 2115 class LoadDictionaryElementStub : public HydrogenCodeStub { | 2115 class LoadDictionaryElementStub : public HydrogenCodeStub { |
| 2116 public: | 2116 public: |
| 2117 explicit LoadDictionaryElementStub(Isolate* isolate) | 2117 explicit LoadDictionaryElementStub(Isolate* isolate, const LoadICState& state) |
| 2118 : HydrogenCodeStub(isolate) {} | 2118 : HydrogenCodeStub(isolate) { |
| 2119 minor_key_ = state.GetExtraICState(); |
| 2120 } |
| 2119 | 2121 |
| 2120 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 2122 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
| 2121 return LoadWithVectorDescriptor(isolate()); | 2123 return LoadWithVectorDescriptor(isolate()); |
| 2122 } | 2124 } |
| 2123 | 2125 |
| 2126 Strength strength() const { return LoadICState::GetStrength(MinorKey()); } |
| 2127 |
| 2124 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); | 2128 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); |
| 2125 }; | 2129 }; |
| 2126 | 2130 |
| 2127 | 2131 |
| 2128 class KeyedLoadGenericStub : public HydrogenCodeStub { | 2132 class KeyedLoadGenericStub : public HydrogenCodeStub { |
| 2129 public: | 2133 public: |
| 2130 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 2134 explicit KeyedLoadGenericStub(Isolate* isolate, const LoadICState& state) |
| 2135 : HydrogenCodeStub(isolate) { |
| 2136 minor_key_ = state.GetExtraICState(); |
| 2137 } |
| 2131 | 2138 |
| 2132 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2139 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2133 InlineCacheState GetICState() const override { return GENERIC; } | 2140 InlineCacheState GetICState() const override { return GENERIC; } |
| 2134 | 2141 |
| 2142 Strength strength() const { return LoadICState::GetStrength(MinorKey()); } |
| 2143 |
| 2135 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 2144 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 2136 | 2145 |
| 2137 DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); | 2146 DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); |
| 2138 }; | 2147 }; |
| 2139 | 2148 |
| 2140 | 2149 |
| 2141 class LoadICTrampolineStub : public PlatformCodeStub { | 2150 class LoadICTrampolineStub : public PlatformCodeStub { |
| 2142 public: | 2151 public: |
| 2143 LoadICTrampolineStub(Isolate* isolate, const LoadICState& state) | 2152 LoadICTrampolineStub(Isolate* isolate, const LoadICState& state) |
| 2144 : PlatformCodeStub(isolate) { | 2153 : PlatformCodeStub(isolate) { |
| 2145 minor_key_ = state.GetExtraICState(); | 2154 minor_key_ = state.GetExtraICState(); |
| 2146 } | 2155 } |
| 2147 | 2156 |
| 2148 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2157 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2149 | 2158 |
| 2150 InlineCacheState GetICState() const final { return DEFAULT; } | 2159 InlineCacheState GetICState() const final { return DEFAULT; } |
| 2151 | 2160 |
| 2152 ExtraICState GetExtraICState() const final { | 2161 ExtraICState GetExtraICState() const final { |
| 2153 return static_cast<ExtraICState>(minor_key_); | 2162 return static_cast<ExtraICState>(minor_key_); |
| 2154 } | 2163 } |
| 2155 | 2164 |
| 2156 private: | 2165 protected: |
| 2157 LoadICState state() const { | 2166 LoadICState state() const { |
| 2158 return LoadICState(static_cast<ExtraICState>(minor_key_)); | 2167 return LoadICState(static_cast<ExtraICState>(minor_key_)); |
| 2159 } | 2168 } |
| 2160 | 2169 |
| 2161 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 2170 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 2162 DEFINE_PLATFORM_CODE_STUB(LoadICTrampoline, PlatformCodeStub); | 2171 DEFINE_PLATFORM_CODE_STUB(LoadICTrampoline, PlatformCodeStub); |
| 2163 }; | 2172 }; |
| 2164 | 2173 |
| 2165 | 2174 |
| 2166 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { | 2175 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { |
| 2167 public: | 2176 public: |
| 2168 explicit KeyedLoadICTrampolineStub(Isolate* isolate) | 2177 explicit KeyedLoadICTrampolineStub(Isolate* isolate, const LoadICState& state) |
| 2169 : LoadICTrampolineStub(isolate, LoadICState(0)) {} | 2178 : LoadICTrampolineStub(isolate, state) {} |
| 2170 | 2179 |
| 2171 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2180 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2172 | 2181 |
| 2173 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); | 2182 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); |
| 2174 }; | 2183 }; |
| 2175 | 2184 |
| 2176 | 2185 |
| 2177 class VectorStoreICTrampolineStub : public PlatformCodeStub { | 2186 class VectorStoreICTrampolineStub : public PlatformCodeStub { |
| 2178 public: | 2187 public: |
| 2179 VectorStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | 2188 VectorStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2265 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2274 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2266 DEFINE_PLATFORM_CODE_STUB(LoadIC, PlatformCodeStub); | 2275 DEFINE_PLATFORM_CODE_STUB(LoadIC, PlatformCodeStub); |
| 2267 | 2276 |
| 2268 protected: | 2277 protected: |
| 2269 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2278 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2270 }; | 2279 }; |
| 2271 | 2280 |
| 2272 | 2281 |
| 2273 class KeyedLoadICStub : public PlatformCodeStub { | 2282 class KeyedLoadICStub : public PlatformCodeStub { |
| 2274 public: | 2283 public: |
| 2275 explicit KeyedLoadICStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2284 explicit KeyedLoadICStub(Isolate* isolate, const LoadICState& state) |
| 2285 : PlatformCodeStub(isolate) { |
| 2286 minor_key_ = state.GetExtraICState(); |
| 2287 } |
| 2276 | 2288 |
| 2277 void GenerateForTrampoline(MacroAssembler* masm); | 2289 void GenerateForTrampoline(MacroAssembler* masm); |
| 2278 | 2290 |
| 2279 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2291 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2280 InlineCacheState GetICState() const final { return DEFAULT; } | 2292 InlineCacheState GetICState() const final { return DEFAULT; } |
| 2293 ExtraICState GetExtraICState() const final { |
| 2294 return static_cast<ExtraICState>(minor_key_); |
| 2295 } |
| 2281 | 2296 |
| 2282 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2297 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2283 DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub); | 2298 DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub); |
| 2284 | 2299 |
| 2285 protected: | 2300 protected: |
| 2286 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2301 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2287 }; | 2302 }; |
| 2288 | 2303 |
| 2289 | 2304 |
| 2290 class VectorStoreICStub : public PlatformCodeStub { | 2305 class VectorStoreICStub : public PlatformCodeStub { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2314 public: | 2329 public: |
| 2315 VectorKeyedStoreICStub(Isolate* isolate, const StoreICState& state) | 2330 VectorKeyedStoreICStub(Isolate* isolate, const StoreICState& state) |
| 2316 : PlatformCodeStub(isolate) { | 2331 : PlatformCodeStub(isolate) { |
| 2317 minor_key_ = state.GetExtraICState(); | 2332 minor_key_ = state.GetExtraICState(); |
| 2318 } | 2333 } |
| 2319 | 2334 |
| 2320 void GenerateForTrampoline(MacroAssembler* masm); | 2335 void GenerateForTrampoline(MacroAssembler* masm); |
| 2321 | 2336 |
| 2322 Code::Kind GetCodeKind() const final { return Code::KEYED_STORE_IC; } | 2337 Code::Kind GetCodeKind() const final { return Code::KEYED_STORE_IC; } |
| 2323 InlineCacheState GetICState() const final { return DEFAULT; } | 2338 InlineCacheState GetICState() const final { return DEFAULT; } |
| 2339 virtual ExtraICState GetExtraICState() const final { |
| 2340 return static_cast<ExtraICState>(minor_key_); |
| 2341 } |
| 2324 | 2342 |
| 2325 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC); | 2343 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC); |
| 2326 DEFINE_PLATFORM_CODE_STUB(VectorKeyedStoreIC, PlatformCodeStub); | 2344 DEFINE_PLATFORM_CODE_STUB(VectorKeyedStoreIC, PlatformCodeStub); |
| 2327 | 2345 |
| 2328 protected: | 2346 protected: |
| 2329 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2347 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2330 }; | 2348 }; |
| 2331 | 2349 |
| 2332 | 2350 |
| 2333 class DoubleToIStub : public PlatformCodeStub { | 2351 class DoubleToIStub : public PlatformCodeStub { |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2969 | 2987 |
| 2970 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2988 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
| 2971 #undef DEFINE_PLATFORM_CODE_STUB | 2989 #undef DEFINE_PLATFORM_CODE_STUB |
| 2972 #undef DEFINE_HANDLER_CODE_STUB | 2990 #undef DEFINE_HANDLER_CODE_STUB |
| 2973 #undef DEFINE_HYDROGEN_CODE_STUB | 2991 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2974 #undef DEFINE_CODE_STUB | 2992 #undef DEFINE_CODE_STUB |
| 2975 #undef DEFINE_CODE_STUB_BASE | 2993 #undef DEFINE_CODE_STUB_BASE |
| 2976 } } // namespace v8::internal | 2994 } } // namespace v8::internal |
| 2977 | 2995 |
| 2978 #endif // V8_CODE_STUBS_H_ | 2996 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |