| 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 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2352 | 2352 |
| 2353 protected: | 2353 protected: |
| 2354 LoadICState state() const { | 2354 LoadICState state() const { |
| 2355 return LoadICState(static_cast<ExtraICState>(minor_key_)); | 2355 return LoadICState(static_cast<ExtraICState>(minor_key_)); |
| 2356 } | 2356 } |
| 2357 | 2357 |
| 2358 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | 2358 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); |
| 2359 DEFINE_CODE_STUB(LoadICTrampolineTF, TurboFanCodeStub); | 2359 DEFINE_CODE_STUB(LoadICTrampolineTF, TurboFanCodeStub); |
| 2360 }; | 2360 }; |
| 2361 | 2361 |
| 2362 class LoadGlobalICTrampolineStub : public LoadICTrampolineTFStub { | 2362 class LoadGlobalICTrampolineStub : public TurboFanCodeStub { |
| 2363 public: | 2363 public: |
| 2364 explicit LoadGlobalICTrampolineStub(Isolate* isolate, | 2364 explicit LoadGlobalICTrampolineStub(Isolate* isolate, |
| 2365 const LoadICState& state) | 2365 const LoadICState& state) |
| 2366 : LoadICTrampolineTFStub(isolate, state) {} | 2366 : TurboFanCodeStub(isolate) { |
| 2367 minor_key_ = state.GetExtraICState(); |
| 2368 } |
| 2367 | 2369 |
| 2368 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2370 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
| 2369 | 2371 |
| 2370 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 2372 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
| 2371 | 2373 |
| 2372 // DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); | 2374 ExtraICState GetExtraICState() const final { |
| 2373 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { | 2375 return static_cast<ExtraICState>(minor_key_); |
| 2374 if (!FLAG_new_load_global_ic) { | |
| 2375 return LoadICTrampolineTFStub::GetCallInterfaceDescriptor(); | |
| 2376 } | |
| 2377 return LoadGlobalDescriptor(isolate()); | |
| 2378 } | 2376 } |
| 2379 DEFINE_CODE_STUB(LoadGlobalICTrampoline, LoadICTrampolineTFStub); | 2377 |
| 2378 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); |
| 2379 DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); |
| 2380 }; | 2380 }; |
| 2381 | 2381 |
| 2382 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { | 2382 class KeyedLoadICTrampolineStub : public LoadICTrampolineStub { |
| 2383 public: | 2383 public: |
| 2384 explicit KeyedLoadICTrampolineStub(Isolate* isolate, const LoadICState& state) | 2384 explicit KeyedLoadICTrampolineStub(Isolate* isolate, const LoadICState& state) |
| 2385 : LoadICTrampolineStub(isolate, state) {} | 2385 : LoadICTrampolineStub(isolate, state) {} |
| 2386 | 2386 |
| 2387 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2387 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
| 2388 | 2388 |
| 2389 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); | 2389 DEFINE_PLATFORM_CODE_STUB(KeyedLoadICTrampoline, LoadICTrampolineStub); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2483 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2483 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2484 | 2484 |
| 2485 ExtraICState GetExtraICState() const final { | 2485 ExtraICState GetExtraICState() const final { |
| 2486 return static_cast<ExtraICState>(minor_key_); | 2486 return static_cast<ExtraICState>(minor_key_); |
| 2487 } | 2487 } |
| 2488 | 2488 |
| 2489 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2489 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2490 DEFINE_CODE_STUB(LoadICTF, TurboFanCodeStub); | 2490 DEFINE_CODE_STUB(LoadICTF, TurboFanCodeStub); |
| 2491 }; | 2491 }; |
| 2492 | 2492 |
| 2493 class LoadGlobalICStub : public LoadICTFStub { | 2493 class LoadGlobalICStub : public TurboFanCodeStub { |
| 2494 public: | 2494 public: |
| 2495 explicit LoadGlobalICStub(Isolate* isolate, const LoadICState& state) | 2495 explicit LoadGlobalICStub(Isolate* isolate, const LoadICState& state) |
| 2496 : LoadICTFStub(isolate, state) {} | 2496 : TurboFanCodeStub(isolate) { |
| 2497 minor_key_ = state.GetExtraICState(); |
| 2498 } |
| 2497 | 2499 |
| 2498 void GenerateAssembly(CodeStubAssembler* assembler) const override; | 2500 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
| 2499 | 2501 |
| 2500 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 2502 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
| 2501 | 2503 |
| 2502 // DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); | 2504 ExtraICState GetExtraICState() const final { |
| 2503 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { | 2505 return static_cast<ExtraICState>(minor_key_); |
| 2504 if (!FLAG_new_load_global_ic) { | |
| 2505 return LoadICTFStub::GetCallInterfaceDescriptor(); | |
| 2506 } | |
| 2507 return LoadGlobalWithVectorDescriptor(isolate()); | |
| 2508 } | 2506 } |
| 2509 DEFINE_CODE_STUB(LoadGlobalIC, LoadICTFStub); | 2507 |
| 2508 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); |
| 2509 DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); |
| 2510 }; | 2510 }; |
| 2511 | 2511 |
| 2512 class KeyedLoadICStub : public PlatformCodeStub { | 2512 class KeyedLoadICStub : public PlatformCodeStub { |
| 2513 public: | 2513 public: |
| 2514 explicit KeyedLoadICStub(Isolate* isolate, const LoadICState& state) | 2514 explicit KeyedLoadICStub(Isolate* isolate, const LoadICState& state) |
| 2515 : PlatformCodeStub(isolate) { | 2515 : PlatformCodeStub(isolate) { |
| 2516 minor_key_ = state.GetExtraICState(); | 2516 minor_key_ = state.GetExtraICState(); |
| 2517 } | 2517 } |
| 2518 | 2518 |
| 2519 void GenerateForTrampoline(MacroAssembler* masm); | 2519 void GenerateForTrampoline(MacroAssembler* masm); |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3156 #undef DEFINE_HYDROGEN_CODE_STUB | 3156 #undef DEFINE_HYDROGEN_CODE_STUB |
| 3157 #undef DEFINE_CODE_STUB | 3157 #undef DEFINE_CODE_STUB |
| 3158 #undef DEFINE_CODE_STUB_BASE | 3158 #undef DEFINE_CODE_STUB_BASE |
| 3159 | 3159 |
| 3160 extern Representation RepresentationFromType(Type* type); | 3160 extern Representation RepresentationFromType(Type* type); |
| 3161 | 3161 |
| 3162 } // namespace internal | 3162 } // namespace internal |
| 3163 } // namespace v8 | 3163 } // namespace v8 |
| 3164 | 3164 |
| 3165 #endif // V8_CODE_STUBS_H_ | 3165 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |