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 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 | 968 |
969 class CallICStub: public PlatformCodeStub { | 969 class CallICStub: public PlatformCodeStub { |
970 public: | 970 public: |
971 CallICStub(Isolate* isolate, const CallICState& state) | 971 CallICStub(Isolate* isolate, const CallICState& state) |
972 : PlatformCodeStub(isolate) { | 972 : PlatformCodeStub(isolate) { |
973 minor_key_ = state.GetExtraICState(); | 973 minor_key_ = state.GetExtraICState(); |
974 } | 974 } |
975 | 975 |
976 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } | 976 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } |
977 | 977 |
978 InlineCacheState GetICState() const override { return DEFAULT; } | 978 InlineCacheState GetICState() const override { return GENERIC; } |
979 | 979 |
980 ExtraICState GetExtraICState() const final { | 980 ExtraICState GetExtraICState() const final { |
981 return static_cast<ExtraICState>(minor_key_); | 981 return static_cast<ExtraICState>(minor_key_); |
982 } | 982 } |
983 | 983 |
984 protected: | 984 protected: |
985 bool CallAsMethod() const { | 985 bool CallAsMethod() const { |
986 return state().call_type() == CallICState::METHOD; | 986 return state().call_type() == CallICState::METHOD; |
987 } | 987 } |
988 | 988 |
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2251 | 2251 |
2252 class LoadICTrampolineStub : public PlatformCodeStub { | 2252 class LoadICTrampolineStub : public PlatformCodeStub { |
2253 public: | 2253 public: |
2254 LoadICTrampolineStub(Isolate* isolate, const LoadICState& state) | 2254 LoadICTrampolineStub(Isolate* isolate, const LoadICState& state) |
2255 : PlatformCodeStub(isolate) { | 2255 : PlatformCodeStub(isolate) { |
2256 minor_key_ = state.GetExtraICState(); | 2256 minor_key_ = state.GetExtraICState(); |
2257 } | 2257 } |
2258 | 2258 |
2259 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2259 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
2260 | 2260 |
2261 InlineCacheState GetICState() const final { return DEFAULT; } | 2261 InlineCacheState GetICState() const final { return GENERIC; } |
2262 | 2262 |
2263 ExtraICState GetExtraICState() const final { | 2263 ExtraICState GetExtraICState() const final { |
2264 return static_cast<ExtraICState>(minor_key_); | 2264 return static_cast<ExtraICState>(minor_key_); |
2265 } | 2265 } |
2266 | 2266 |
2267 protected: | 2267 protected: |
2268 LoadICState state() const { | 2268 LoadICState state() const { |
2269 return LoadICState(static_cast<ExtraICState>(minor_key_)); | 2269 return LoadICState(static_cast<ExtraICState>(minor_key_)); |
2270 } | 2270 } |
2271 | 2271 |
(...skipping 15 matching lines...) Expand all Loading... |
2287 | 2287 |
2288 class VectorStoreICTrampolineStub : public PlatformCodeStub { | 2288 class VectorStoreICTrampolineStub : public PlatformCodeStub { |
2289 public: | 2289 public: |
2290 VectorStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | 2290 VectorStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) |
2291 : PlatformCodeStub(isolate) { | 2291 : PlatformCodeStub(isolate) { |
2292 minor_key_ = state.GetExtraICState(); | 2292 minor_key_ = state.GetExtraICState(); |
2293 } | 2293 } |
2294 | 2294 |
2295 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 2295 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
2296 | 2296 |
2297 InlineCacheState GetICState() const final { return DEFAULT; } | 2297 InlineCacheState GetICState() const final { return GENERIC; } |
2298 | 2298 |
2299 ExtraICState GetExtraICState() const final { | 2299 ExtraICState GetExtraICState() const final { |
2300 return static_cast<ExtraICState>(minor_key_); | 2300 return static_cast<ExtraICState>(minor_key_); |
2301 } | 2301 } |
2302 | 2302 |
2303 protected: | 2303 protected: |
2304 StoreICState state() const { | 2304 StoreICState state() const { |
2305 return StoreICState(static_cast<ExtraICState>(minor_key_)); | 2305 return StoreICState(static_cast<ExtraICState>(minor_key_)); |
2306 } | 2306 } |
2307 | 2307 |
(...skipping 17 matching lines...) Expand all Loading... |
2325 | 2325 |
2326 class CallICTrampolineStub : public PlatformCodeStub { | 2326 class CallICTrampolineStub : public PlatformCodeStub { |
2327 public: | 2327 public: |
2328 CallICTrampolineStub(Isolate* isolate, const CallICState& state) | 2328 CallICTrampolineStub(Isolate* isolate, const CallICState& state) |
2329 : PlatformCodeStub(isolate) { | 2329 : PlatformCodeStub(isolate) { |
2330 minor_key_ = state.GetExtraICState(); | 2330 minor_key_ = state.GetExtraICState(); |
2331 } | 2331 } |
2332 | 2332 |
2333 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } | 2333 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } |
2334 | 2334 |
2335 InlineCacheState GetICState() const final { return DEFAULT; } | 2335 InlineCacheState GetICState() const final { return GENERIC; } |
2336 | 2336 |
2337 ExtraICState GetExtraICState() const final { | 2337 ExtraICState GetExtraICState() const final { |
2338 return static_cast<ExtraICState>(minor_key_); | 2338 return static_cast<ExtraICState>(minor_key_); |
2339 } | 2339 } |
2340 | 2340 |
2341 protected: | 2341 protected: |
2342 CallICState state() const { | 2342 CallICState state() const { |
2343 return CallICState(static_cast<ExtraICState>(minor_key_)); | 2343 return CallICState(static_cast<ExtraICState>(minor_key_)); |
2344 } | 2344 } |
2345 | 2345 |
2346 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); | 2346 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); |
2347 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); | 2347 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); |
2348 }; | 2348 }; |
2349 | 2349 |
2350 | 2350 |
2351 class LoadICStub : public PlatformCodeStub { | 2351 class LoadICStub : public PlatformCodeStub { |
2352 public: | 2352 public: |
2353 explicit LoadICStub(Isolate* isolate, const LoadICState& state) | 2353 explicit LoadICStub(Isolate* isolate, const LoadICState& state) |
2354 : PlatformCodeStub(isolate) { | 2354 : PlatformCodeStub(isolate) { |
2355 minor_key_ = state.GetExtraICState(); | 2355 minor_key_ = state.GetExtraICState(); |
2356 } | 2356 } |
2357 | 2357 |
2358 void GenerateForTrampoline(MacroAssembler* masm); | 2358 void GenerateForTrampoline(MacroAssembler* masm); |
2359 | 2359 |
2360 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2360 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
2361 InlineCacheState GetICState() const final { return DEFAULT; } | 2361 InlineCacheState GetICState() const final { return GENERIC; } |
2362 ExtraICState GetExtraICState() const final { | 2362 ExtraICState GetExtraICState() const final { |
2363 return static_cast<ExtraICState>(minor_key_); | 2363 return static_cast<ExtraICState>(minor_key_); |
2364 } | 2364 } |
2365 | 2365 |
2366 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2366 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
2367 DEFINE_PLATFORM_CODE_STUB(LoadIC, PlatformCodeStub); | 2367 DEFINE_PLATFORM_CODE_STUB(LoadIC, PlatformCodeStub); |
2368 | 2368 |
2369 protected: | 2369 protected: |
2370 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2370 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
2371 }; | 2371 }; |
2372 | 2372 |
2373 | 2373 |
2374 class KeyedLoadICStub : public PlatformCodeStub { | 2374 class KeyedLoadICStub : public PlatformCodeStub { |
2375 public: | 2375 public: |
2376 explicit KeyedLoadICStub(Isolate* isolate, const LoadICState& state) | 2376 explicit KeyedLoadICStub(Isolate* isolate, const LoadICState& state) |
2377 : PlatformCodeStub(isolate) { | 2377 : PlatformCodeStub(isolate) { |
2378 minor_key_ = state.GetExtraICState(); | 2378 minor_key_ = state.GetExtraICState(); |
2379 } | 2379 } |
2380 | 2380 |
2381 void GenerateForTrampoline(MacroAssembler* masm); | 2381 void GenerateForTrampoline(MacroAssembler* masm); |
2382 | 2382 |
2383 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2383 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
2384 InlineCacheState GetICState() const final { return DEFAULT; } | 2384 InlineCacheState GetICState() const final { return GENERIC; } |
2385 ExtraICState GetExtraICState() const final { | 2385 ExtraICState GetExtraICState() const final { |
2386 return static_cast<ExtraICState>(minor_key_); | 2386 return static_cast<ExtraICState>(minor_key_); |
2387 } | 2387 } |
2388 | 2388 |
2389 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2389 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
2390 DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub); | 2390 DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub); |
2391 | 2391 |
2392 protected: | 2392 protected: |
2393 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2393 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
2394 }; | 2394 }; |
2395 | 2395 |
2396 | 2396 |
2397 class VectorStoreICStub : public PlatformCodeStub { | 2397 class VectorStoreICStub : public PlatformCodeStub { |
2398 public: | 2398 public: |
2399 VectorStoreICStub(Isolate* isolate, const StoreICState& state) | 2399 VectorStoreICStub(Isolate* isolate, const StoreICState& state) |
2400 : PlatformCodeStub(isolate) { | 2400 : PlatformCodeStub(isolate) { |
2401 minor_key_ = state.GetExtraICState(); | 2401 minor_key_ = state.GetExtraICState(); |
2402 } | 2402 } |
2403 | 2403 |
2404 void GenerateForTrampoline(MacroAssembler* masm); | 2404 void GenerateForTrampoline(MacroAssembler* masm); |
2405 | 2405 |
2406 Code::Kind GetCodeKind() const final { return Code::STORE_IC; } | 2406 Code::Kind GetCodeKind() const final { return Code::STORE_IC; } |
2407 InlineCacheState GetICState() const final { return DEFAULT; } | 2407 InlineCacheState GetICState() const final { return GENERIC; } |
2408 ExtraICState GetExtraICState() const final { | 2408 ExtraICState GetExtraICState() const final { |
2409 return static_cast<ExtraICState>(minor_key_); | 2409 return static_cast<ExtraICState>(minor_key_); |
2410 } | 2410 } |
2411 | 2411 |
2412 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC); | 2412 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC); |
2413 DEFINE_PLATFORM_CODE_STUB(VectorStoreIC, PlatformCodeStub); | 2413 DEFINE_PLATFORM_CODE_STUB(VectorStoreIC, PlatformCodeStub); |
2414 | 2414 |
2415 protected: | 2415 protected: |
2416 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2416 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
2417 }; | 2417 }; |
2418 | 2418 |
2419 | 2419 |
2420 class VectorKeyedStoreICStub : public PlatformCodeStub { | 2420 class VectorKeyedStoreICStub : public PlatformCodeStub { |
2421 public: | 2421 public: |
2422 VectorKeyedStoreICStub(Isolate* isolate, const StoreICState& state) | 2422 VectorKeyedStoreICStub(Isolate* isolate, const StoreICState& state) |
2423 : PlatformCodeStub(isolate) { | 2423 : PlatformCodeStub(isolate) { |
2424 minor_key_ = state.GetExtraICState(); | 2424 minor_key_ = state.GetExtraICState(); |
2425 } | 2425 } |
2426 | 2426 |
2427 void GenerateForTrampoline(MacroAssembler* masm); | 2427 void GenerateForTrampoline(MacroAssembler* masm); |
2428 | 2428 |
2429 Code::Kind GetCodeKind() const final { return Code::KEYED_STORE_IC; } | 2429 Code::Kind GetCodeKind() const final { return Code::KEYED_STORE_IC; } |
2430 InlineCacheState GetICState() const final { return DEFAULT; } | 2430 InlineCacheState GetICState() const final { return GENERIC; } |
2431 virtual ExtraICState GetExtraICState() const final { | 2431 virtual ExtraICState GetExtraICState() const final { |
2432 return static_cast<ExtraICState>(minor_key_); | 2432 return static_cast<ExtraICState>(minor_key_); |
2433 } | 2433 } |
2434 | 2434 |
2435 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC); | 2435 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC); |
2436 DEFINE_PLATFORM_CODE_STUB(VectorKeyedStoreIC, PlatformCodeStub); | 2436 DEFINE_PLATFORM_CODE_STUB(VectorKeyedStoreIC, PlatformCodeStub); |
2437 | 2437 |
2438 protected: | 2438 protected: |
2439 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2439 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
2440 }; | 2440 }; |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3119 #undef DEFINE_HYDROGEN_CODE_STUB | 3119 #undef DEFINE_HYDROGEN_CODE_STUB |
3120 #undef DEFINE_CODE_STUB | 3120 #undef DEFINE_CODE_STUB |
3121 #undef DEFINE_CODE_STUB_BASE | 3121 #undef DEFINE_CODE_STUB_BASE |
3122 | 3122 |
3123 extern Representation RepresentationFromType(Type* type); | 3123 extern Representation RepresentationFromType(Type* type); |
3124 | 3124 |
3125 } // namespace internal | 3125 } // namespace internal |
3126 } // namespace v8 | 3126 } // namespace v8 |
3127 | 3127 |
3128 #endif // V8_CODE_STUBS_H_ | 3128 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |