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