| 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 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2278 private: | 2278 private: |
| 2279 StringCharCodeAtGenerator char_code_at_generator_; | 2279 StringCharCodeAtGenerator char_code_at_generator_; |
| 2280 StringCharFromCodeGenerator char_from_code_generator_; | 2280 StringCharFromCodeGenerator char_from_code_generator_; |
| 2281 | 2281 |
| 2282 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); | 2282 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); |
| 2283 }; | 2283 }; |
| 2284 | 2284 |
| 2285 | 2285 |
| 2286 class LoadDictionaryElementStub : public HydrogenCodeStub { | 2286 class LoadDictionaryElementStub : public HydrogenCodeStub { |
| 2287 public: | 2287 public: |
| 2288 explicit LoadDictionaryElementStub(Isolate* isolate, const LoadICState& state) | 2288 explicit LoadDictionaryElementStub(Isolate* isolate) |
| 2289 : HydrogenCodeStub(isolate) { | 2289 : HydrogenCodeStub(isolate) {} |
| 2290 minor_key_ = state.GetExtraICState(); | |
| 2291 } | |
| 2292 | 2290 |
| 2293 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { | 2291 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2294 return LoadWithVectorDescriptor(isolate()); | |
| 2295 } | |
| 2296 | |
| 2297 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); | 2292 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); |
| 2298 }; | 2293 }; |
| 2299 | 2294 |
| 2300 | 2295 |
| 2301 class KeyedLoadGenericStub : public HydrogenCodeStub { | 2296 class KeyedLoadGenericStub : public HydrogenCodeStub { |
| 2302 public: | 2297 public: |
| 2303 explicit KeyedLoadGenericStub(Isolate* isolate, const LoadICState& state) | 2298 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
| 2304 : HydrogenCodeStub(isolate) { | |
| 2305 minor_key_ = state.GetExtraICState(); | |
| 2306 } | |
| 2307 | 2299 |
| 2308 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2300 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2309 | 2301 |
| 2310 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 2302 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 2311 | |
| 2312 DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); | 2303 DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); |
| 2313 }; | 2304 }; |
| 2314 | 2305 |
| 2315 | 2306 |
| 2316 class LoadICTrampolineStub : public PlatformCodeStub { | 2307 class LoadICTrampolineStub : public PlatformCodeStub { |
| 2317 public: | 2308 public: |
| 2318 LoadICTrampolineStub(Isolate* isolate, const LoadICState& state) | 2309 explicit LoadICTrampolineStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 2319 : PlatformCodeStub(isolate) { | |
| 2320 minor_key_ = state.GetExtraICState(); | |
| 2321 } | |
| 2322 | 2310 |
| 2323 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2311 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2324 | 2312 |
| 2325 ExtraICState GetExtraICState() const final { | |
| 2326 return static_cast<ExtraICState>(minor_key_); | |
| 2327 } | |
| 2328 | |
| 2329 protected: | |
| 2330 LoadICState state() const { | |
| 2331 return LoadICState(static_cast<ExtraICState>(minor_key_)); | |
| 2332 } | |
| 2333 | |
| 2334 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 2313 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 2335 DEFINE_PLATFORM_CODE_STUB(LoadICTrampoline, PlatformCodeStub); | 2314 DEFINE_PLATFORM_CODE_STUB(LoadICTrampoline, PlatformCodeStub); |
| 2336 }; | 2315 }; |
| 2337 | 2316 |
| 2338 class LoadICTrampolineTFStub : public TurboFanCodeStub { | 2317 class LoadICTrampolineTFStub : public TurboFanCodeStub { |
| 2339 public: | 2318 public: |
| 2340 LoadICTrampolineTFStub(Isolate* isolate, const LoadICState& state) | 2319 explicit LoadICTrampolineTFStub(Isolate* isolate) |
| 2341 : TurboFanCodeStub(isolate) { | 2320 : TurboFanCodeStub(isolate) {} |
| 2342 minor_key_ = state.GetExtraICState(); | |
| 2343 } | |
| 2344 | 2321 |
| 2345 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2322 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
| 2346 | 2323 |
| 2347 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2324 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2348 | 2325 |
| 2349 ExtraICState GetExtraICState() const final { | |
| 2350 return static_cast<ExtraICState>(minor_key_); | |
| 2351 } | |
| 2352 | |
| 2353 protected: | |
| 2354 LoadICState state() const { | |
| 2355 return LoadICState(static_cast<ExtraICState>(minor_key_)); | |
| 2356 } | |
| 2357 | |
| 2358 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 2326 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 2359 DEFINE_CODE_STUB(LoadICTrampolineTF, TurboFanCodeStub); | 2327 DEFINE_CODE_STUB(LoadICTrampolineTF, TurboFanCodeStub); |
| 2360 }; | 2328 }; |
| 2361 | 2329 |
| 2362 class LoadGlobalICTrampolineStub : public TurboFanCodeStub { | 2330 class LoadGlobalICTrampolineStub : public TurboFanCodeStub { |
| 2363 public: | 2331 public: |
| 2364 explicit LoadGlobalICTrampolineStub(Isolate* isolate, | 2332 explicit LoadGlobalICTrampolineStub(Isolate* isolate, |
| 2365 const LoadICState& state) | 2333 const LoadGlobalICState& state) |
| 2366 : TurboFanCodeStub(isolate) { | 2334 : TurboFanCodeStub(isolate) { |
| 2367 minor_key_ = state.GetExtraICState(); | 2335 minor_key_ = state.GetExtraICState(); |
| 2368 } | 2336 } |
| 2369 | 2337 |
| 2370 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2338 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
| 2371 | 2339 |
| 2372 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 2340 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
| 2373 | 2341 |
| 2374 ExtraICState GetExtraICState() const final { | 2342 ExtraICState GetExtraICState() const final { |
| 2375 return static_cast<ExtraICState>(minor_key_); | 2343 return static_cast<ExtraICState>(minor_key_); |
| 2376 } | 2344 } |
| 2377 | 2345 |
| 2378 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); | 2346 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); |
| 2379 DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); | 2347 DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); |
| 2380 }; | 2348 }; |
| 2381 | 2349 |
| 2382 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { | 2350 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { |
| 2383 public: | 2351 public: |
| 2384 explicit KeyedLoadICTrampolineStub(Isolate* isolate, const LoadICState& state) | 2352 explicit KeyedLoadICTrampolineStub(Isolate* isolate) |
| 2385 : LoadICTrampolineStub(isolate, state) {} | 2353 : LoadICTrampolineStub(isolate) {} |
| 2386 | 2354 |
| 2387 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2355 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2388 | 2356 |
| 2389 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); | 2357 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); |
| 2390 }; | 2358 }; |
| 2391 | 2359 |
| 2392 | 2360 |
| 2393 class VectorStoreICTrampolineStub : public PlatformCodeStub { | 2361 class VectorStoreICTrampolineStub : public PlatformCodeStub { |
| 2394 public: | 2362 public: |
| 2395 VectorStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | 2363 VectorStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2444 return CallICState(static_cast<ExtraICState>(minor_key_)); | 2412 return CallICState(static_cast<ExtraICState>(minor_key_)); |
| 2445 } | 2413 } |
| 2446 | 2414 |
| 2447 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); | 2415 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); |
| 2448 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); | 2416 DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub); |
| 2449 }; | 2417 }; |
| 2450 | 2418 |
| 2451 | 2419 |
| 2452 class LoadICStub : public PlatformCodeStub { | 2420 class LoadICStub : public PlatformCodeStub { |
| 2453 public: | 2421 public: |
| 2454 explicit LoadICStub(Isolate* isolate, const LoadICState& state) | 2422 explicit LoadICStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 2455 : PlatformCodeStub(isolate) { | |
| 2456 minor_key_ = state.GetExtraICState(); | |
| 2457 } | |
| 2458 | 2423 |
| 2459 void GenerateForTrampoline(MacroAssembler* masm); | 2424 void GenerateForTrampoline(MacroAssembler* masm); |
| 2460 | 2425 |
| 2461 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2426 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2462 | 2427 |
| 2463 ExtraICState GetExtraICState() const final { | |
| 2464 return static_cast<ExtraICState>(minor_key_); | |
| 2465 } | |
| 2466 | |
| 2467 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2428 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2468 DEFINE_PLATFORM_CODE_STUB(LoadIC, PlatformCodeStub); | 2429 DEFINE_PLATFORM_CODE_STUB(LoadIC, PlatformCodeStub); |
| 2469 | 2430 |
| 2470 protected: | 2431 protected: |
| 2471 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2432 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2472 }; | 2433 }; |
| 2473 | 2434 |
| 2474 class LoadICTFStub : public TurboFanCodeStub { | 2435 class LoadICTFStub : public TurboFanCodeStub { |
| 2475 public: | 2436 public: |
| 2476 explicit LoadICTFStub(Isolate* isolate, const LoadICState& state) | 2437 explicit LoadICTFStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 2477 : TurboFanCodeStub(isolate) { | |
| 2478 minor_key_ = state.GetExtraICState(); | |
| 2479 } | |
| 2480 | 2438 |
| 2481 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2439 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
| 2482 | 2440 |
| 2483 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2441 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2484 | 2442 |
| 2485 ExtraICState GetExtraICState() const final { | |
| 2486 return static_cast<ExtraICState>(minor_key_); | |
| 2487 } | |
| 2488 | |
| 2489 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2443 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2490 DEFINE_CODE_STUB(LoadICTF, TurboFanCodeStub); | 2444 DEFINE_CODE_STUB(LoadICTF, TurboFanCodeStub); |
| 2491 }; | 2445 }; |
| 2492 | 2446 |
| 2493 class LoadGlobalICStub : public TurboFanCodeStub { | 2447 class LoadGlobalICStub : public TurboFanCodeStub { |
| 2494 public: | 2448 public: |
| 2495 explicit LoadGlobalICStub(Isolate* isolate, const LoadICState& state) | 2449 explicit LoadGlobalICStub(Isolate* isolate, const LoadGlobalICState& state) |
| 2496 : TurboFanCodeStub(isolate) { | 2450 : TurboFanCodeStub(isolate) { |
| 2497 minor_key_ = state.GetExtraICState(); | 2451 minor_key_ = state.GetExtraICState(); |
| 2498 } | 2452 } |
| 2499 | 2453 |
| 2500 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2454 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
| 2501 | 2455 |
| 2502 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 2456 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
| 2503 | 2457 |
| 2504 ExtraICState GetExtraICState() const final { | 2458 ExtraICState GetExtraICState() const final { |
| 2505 return static_cast<ExtraICState>(minor_key_); | 2459 return static_cast<ExtraICState>(minor_key_); |
| 2506 } | 2460 } |
| 2507 | 2461 |
| 2508 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); | 2462 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); |
| 2509 DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); | 2463 DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); |
| 2510 }; | 2464 }; |
| 2511 | 2465 |
| 2512 class KeyedLoadICStub : public PlatformCodeStub { | 2466 class KeyedLoadICStub : public PlatformCodeStub { |
| 2513 public: | 2467 public: |
| 2514 explicit KeyedLoadICStub(Isolate* isolate, const LoadICState& state) | 2468 explicit KeyedLoadICStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 2515 : PlatformCodeStub(isolate) { | |
| 2516 minor_key_ = state.GetExtraICState(); | |
| 2517 } | |
| 2518 | 2469 |
| 2519 void GenerateForTrampoline(MacroAssembler* masm); | 2470 void GenerateForTrampoline(MacroAssembler* masm); |
| 2520 | 2471 |
| 2521 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2472 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2522 | 2473 |
| 2523 ExtraICState GetExtraICState() const final { | |
| 2524 return static_cast<ExtraICState>(minor_key_); | |
| 2525 } | |
| 2526 | |
| 2527 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2474 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2528 DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub); | 2475 DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub); |
| 2529 | 2476 |
| 2530 protected: | 2477 protected: |
| 2531 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2478 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
| 2532 }; | 2479 }; |
| 2533 | 2480 |
| 2534 | 2481 |
| 2535 class VectorStoreICStub : public PlatformCodeStub { | 2482 class VectorStoreICStub : public PlatformCodeStub { |
| 2536 public: | 2483 public: |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3156 #undef DEFINE_HYDROGEN_CODE_STUB | 3103 #undef DEFINE_HYDROGEN_CODE_STUB |
| 3157 #undef DEFINE_CODE_STUB | 3104 #undef DEFINE_CODE_STUB |
| 3158 #undef DEFINE_CODE_STUB_BASE | 3105 #undef DEFINE_CODE_STUB_BASE |
| 3159 | 3106 |
| 3160 extern Representation RepresentationFromType(Type* type); | 3107 extern Representation RepresentationFromType(Type* type); |
| 3161 | 3108 |
| 3162 } // namespace internal | 3109 } // namespace internal |
| 3163 } // namespace v8 | 3110 } // namespace v8 |
| 3164 | 3111 |
| 3165 #endif // V8_CODE_STUBS_H_ | 3112 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |