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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 V(ToInteger) \ | 157 V(ToInteger) \ |
158 V(ToLength) \ | 158 V(ToLength) \ |
159 V(HasProperty) \ | 159 V(HasProperty) \ |
160 V(ForInFilter) \ | 160 V(ForInFilter) \ |
161 V(GetProperty) \ | 161 V(GetProperty) \ |
162 V(LoadICTF) \ | 162 V(LoadICTF) \ |
163 V(KeyedLoadICTF) \ | 163 V(KeyedLoadICTF) \ |
164 V(StoreFastElement) \ | 164 V(StoreFastElement) \ |
165 V(StoreField) \ | 165 V(StoreField) \ |
166 V(StoreGlobal) \ | 166 V(StoreGlobal) \ |
| 167 V(StoreICTF) \ |
167 V(StoreInterceptor) \ | 168 V(StoreInterceptor) \ |
168 V(StoreTransition) \ | 169 V(StoreTransition) \ |
169 V(LoadApiGetter) \ | 170 V(LoadApiGetter) \ |
170 V(LoadIndexedInterceptor) \ | 171 V(LoadIndexedInterceptor) \ |
171 V(GrowArrayElements) \ | 172 V(GrowArrayElements) \ |
172 V(ToObject) \ | 173 V(ToObject) \ |
173 V(Typeof) \ | 174 V(Typeof) \ |
174 /* These are only called from FGC and */ \ | 175 /* These are only called from FGC and */ \ |
175 /* can be removed when we use ignition */ \ | 176 /* can be removed when we use ignition */ \ |
176 /* only */ \ | 177 /* only */ \ |
177 V(LoadICTrampolineTF) \ | 178 V(LoadICTrampolineTF) \ |
178 V(LoadGlobalICTrampoline) \ | 179 V(LoadGlobalICTrampoline) \ |
179 V(KeyedLoadICTrampolineTF) | 180 V(KeyedLoadICTrampolineTF) \ |
| 181 V(StoreICTrampolineTF) |
180 | 182 |
181 // List of code stubs only used on ARM 32 bits platforms. | 183 // List of code stubs only used on ARM 32 bits platforms. |
182 #if V8_TARGET_ARCH_ARM | 184 #if V8_TARGET_ARCH_ARM |
183 #define CODE_STUB_LIST_ARM(V) V(DirectCEntry) | 185 #define CODE_STUB_LIST_ARM(V) V(DirectCEntry) |
184 | 186 |
185 #else | 187 #else |
186 #define CODE_STUB_LIST_ARM(V) | 188 #define CODE_STUB_LIST_ARM(V) |
187 #endif | 189 #endif |
188 | 190 |
189 // List of code stubs only used on ARM 64 bits platforms. | 191 // List of code stubs only used on ARM 64 bits platforms. |
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2407 minor_key_ = state.GetExtraICState(); | 2409 minor_key_ = state.GetExtraICState(); |
2408 } | 2410 } |
2409 | 2411 |
2410 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 2412 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
2411 | 2413 |
2412 ExtraICState GetExtraICState() const final { | 2414 ExtraICState GetExtraICState() const final { |
2413 return static_cast<ExtraICState>(minor_key_); | 2415 return static_cast<ExtraICState>(minor_key_); |
2414 } | 2416 } |
2415 | 2417 |
2416 protected: | 2418 protected: |
2417 StoreICState state() const { | 2419 StoreICState state() const { return StoreICState(GetExtraICState()); } |
2418 return StoreICState(static_cast<ExtraICState>(minor_key_)); | |
2419 } | |
2420 | 2420 |
2421 private: | 2421 private: |
2422 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); | 2422 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); |
2423 DEFINE_PLATFORM_CODE_STUB(StoreICTrampoline, PlatformCodeStub); | 2423 DEFINE_PLATFORM_CODE_STUB(StoreICTrampoline, PlatformCodeStub); |
2424 }; | 2424 }; |
2425 | 2425 |
| 2426 class StoreICTrampolineTFStub : public TurboFanCodeStub { |
| 2427 public: |
| 2428 StoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) |
| 2429 : TurboFanCodeStub(isolate) { |
| 2430 minor_key_ = state.GetExtraICState(); |
| 2431 } |
| 2432 |
| 2433 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
| 2434 |
| 2435 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
| 2436 ExtraICState GetExtraICState() const final { |
| 2437 return static_cast<ExtraICState>(minor_key_); |
| 2438 } |
| 2439 |
| 2440 protected: |
| 2441 StoreICState state() const { return StoreICState(GetExtraICState()); } |
| 2442 |
| 2443 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); |
| 2444 DEFINE_CODE_STUB(StoreICTrampolineTF, TurboFanCodeStub); |
| 2445 }; |
| 2446 |
2426 class KeyedStoreICTrampolineStub : public StoreICTrampolineStub { | 2447 class KeyedStoreICTrampolineStub : public StoreICTrampolineStub { |
2427 public: | 2448 public: |
2428 KeyedStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) | 2449 KeyedStoreICTrampolineStub(Isolate* isolate, const StoreICState& state) |
2429 : StoreICTrampolineStub(isolate, state) {} | 2450 : StoreICTrampolineStub(isolate, state) {} |
2430 | 2451 |
2431 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 2452 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } |
2432 | 2453 |
2433 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, StoreICTrampolineStub); | 2454 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, StoreICTrampolineStub); |
2434 }; | 2455 }; |
2435 | 2456 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2544 return static_cast<ExtraICState>(minor_key_); | 2565 return static_cast<ExtraICState>(minor_key_); |
2545 } | 2566 } |
2546 | 2567 |
2547 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 2568 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
2548 DEFINE_PLATFORM_CODE_STUB(StoreIC, PlatformCodeStub); | 2569 DEFINE_PLATFORM_CODE_STUB(StoreIC, PlatformCodeStub); |
2549 | 2570 |
2550 protected: | 2571 protected: |
2551 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2572 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
2552 }; | 2573 }; |
2553 | 2574 |
| 2575 class StoreICTFStub : public TurboFanCodeStub { |
| 2576 public: |
| 2577 StoreICTFStub(Isolate* isolate, const StoreICState& state) |
| 2578 : TurboFanCodeStub(isolate) { |
| 2579 minor_key_ = state.GetExtraICState(); |
| 2580 } |
| 2581 |
| 2582 void GenerateAssembly(CodeStubAssembler* assembler) const override; |
| 2583 |
| 2584 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
| 2585 ExtraICState GetExtraICState() const final { |
| 2586 return static_cast<ExtraICState>(minor_key_); |
| 2587 } |
| 2588 |
| 2589 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
| 2590 DEFINE_CODE_STUB(StoreICTF, TurboFanCodeStub); |
| 2591 }; |
| 2592 |
2554 class KeyedStoreICStub : public PlatformCodeStub { | 2593 class KeyedStoreICStub : public PlatformCodeStub { |
2555 public: | 2594 public: |
2556 KeyedStoreICStub(Isolate* isolate, const StoreICState& state) | 2595 KeyedStoreICStub(Isolate* isolate, const StoreICState& state) |
2557 : PlatformCodeStub(isolate) { | 2596 : PlatformCodeStub(isolate) { |
2558 minor_key_ = state.GetExtraICState(); | 2597 minor_key_ = state.GetExtraICState(); |
2559 } | 2598 } |
2560 | 2599 |
2561 void GenerateForTrampoline(MacroAssembler* masm); | 2600 void GenerateForTrampoline(MacroAssembler* masm); |
2562 | 2601 |
2563 Code::Kind GetCodeKind() const final { return Code::KEYED_STORE_IC; } | 2602 Code::Kind GetCodeKind() const final { return Code::KEYED_STORE_IC; } |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3154 #undef DEFINE_HYDROGEN_CODE_STUB | 3193 #undef DEFINE_HYDROGEN_CODE_STUB |
3155 #undef DEFINE_CODE_STUB | 3194 #undef DEFINE_CODE_STUB |
3156 #undef DEFINE_CODE_STUB_BASE | 3195 #undef DEFINE_CODE_STUB_BASE |
3157 | 3196 |
3158 extern Representation RepresentationFromMachineType(MachineType type); | 3197 extern Representation RepresentationFromMachineType(MachineType type); |
3159 | 3198 |
3160 } // namespace internal | 3199 } // namespace internal |
3161 } // namespace v8 | 3200 } // namespace v8 |
3162 | 3201 |
3163 #endif // V8_CODE_STUBS_H_ | 3202 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |