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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 V(FastArrayPush) \ | 79 V(FastArrayPush) \ |
80 V(FastFunctionBind) \ | 80 V(FastFunctionBind) \ |
81 /* These will be ported/eliminated */ \ | 81 /* These will be ported/eliminated */ \ |
82 /* as part of the new IC system, ask */ \ | 82 /* as part of the new IC system, ask */ \ |
83 /* ishell before doing anything */ \ | 83 /* ishell before doing anything */ \ |
84 V(KeyedLoadGeneric) \ | 84 V(KeyedLoadGeneric) \ |
85 V(LoadConstant) \ | 85 V(LoadConstant) \ |
86 V(LoadDictionaryElement) \ | 86 V(LoadDictionaryElement) \ |
87 V(LoadFastElement) \ | 87 V(LoadFastElement) \ |
88 V(LoadField) \ | 88 V(LoadField) \ |
89 V(StoreFastElement) \ | |
90 V(StoreTransition) \ | 89 V(StoreTransition) \ |
91 /* These should never be ported to TF */ \ | 90 /* These should never be ported to TF */ \ |
92 /* because they are either used only by */ \ | 91 /* because they are either used only by */ \ |
93 /* FCG/Crankshaft or are deprecated */ \ | 92 /* FCG/Crankshaft or are deprecated */ \ |
94 V(BinaryOpIC) \ | 93 V(BinaryOpIC) \ |
95 V(BinaryOpWithAllocationSite) \ | 94 V(BinaryOpWithAllocationSite) \ |
96 V(ToBooleanIC) \ | 95 V(ToBooleanIC) \ |
97 V(RegExpConstructResult) \ | 96 V(RegExpConstructResult) \ |
98 V(TransitionElementsKind) \ | 97 V(TransitionElementsKind) \ |
99 V(StoreGlobalViaContext) \ | 98 V(StoreGlobalViaContext) \ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 V(StringLessThanOrEqual) \ | 157 V(StringLessThanOrEqual) \ |
159 V(StringGreaterThan) \ | 158 V(StringGreaterThan) \ |
160 V(StringGreaterThanOrEqual) \ | 159 V(StringGreaterThanOrEqual) \ |
161 V(ToInteger) \ | 160 V(ToInteger) \ |
162 V(ToLength) \ | 161 V(ToLength) \ |
163 V(HasProperty) \ | 162 V(HasProperty) \ |
164 V(ForInFilter) \ | 163 V(ForInFilter) \ |
165 V(GetProperty) \ | 164 V(GetProperty) \ |
166 V(LoadICTF) \ | 165 V(LoadICTF) \ |
167 V(KeyedLoadICTF) \ | 166 V(KeyedLoadICTF) \ |
| 167 V(StoreFastElement) \ |
168 V(StoreField) \ | 168 V(StoreField) \ |
169 V(StoreGlobal) \ | 169 V(StoreGlobal) \ |
170 V(StoreInterceptor) \ | 170 V(StoreInterceptor) \ |
171 V(LoadApiGetter) \ | 171 V(LoadApiGetter) \ |
172 V(LoadIndexedInterceptor) \ | 172 V(LoadIndexedInterceptor) \ |
173 V(GrowArrayElements) \ | 173 V(GrowArrayElements) \ |
174 /* These are only called from FGC and */ \ | 174 /* These are only called from FGC and */ \ |
175 /* can be removed when we use ignition */ \ | 175 /* can be removed when we use ignition */ \ |
176 /* only */ \ | 176 /* only */ \ |
177 V(LoadICTrampolineTF) \ | 177 V(LoadICTrampolineTF) \ |
(...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2767 | 2767 |
2768 private: | 2768 private: |
2769 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 2769 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
2770 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 2770 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
2771 class CanConvertHoleToUndefined : public BitField<bool, 9, 1> {}; | 2771 class CanConvertHoleToUndefined : public BitField<bool, 9, 1> {}; |
2772 | 2772 |
2773 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2773 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
2774 DEFINE_HANDLER_CODE_STUB(LoadFastElement, HandlerStub); | 2774 DEFINE_HANDLER_CODE_STUB(LoadFastElement, HandlerStub); |
2775 }; | 2775 }; |
2776 | 2776 |
2777 | 2777 class StoreFastElementStub : public TurboFanCodeStub { |
2778 class StoreFastElementStub : public HydrogenCodeStub { | |
2779 public: | 2778 public: |
2780 StoreFastElementStub(Isolate* isolate, bool is_js_array, | 2779 StoreFastElementStub(Isolate* isolate, bool is_js_array, |
2781 ElementsKind elements_kind, KeyedAccessStoreMode mode) | 2780 ElementsKind elements_kind, KeyedAccessStoreMode mode) |
2782 : HydrogenCodeStub(isolate) { | 2781 : TurboFanCodeStub(isolate) { |
2783 set_sub_minor_key(CommonStoreModeBits::encode(mode) | | 2782 minor_key_ = CommonStoreModeBits::encode(mode) | |
2784 ElementsKindBits::encode(elements_kind) | | 2783 ElementsKindBits::encode(elements_kind) | |
2785 IsJSArrayBits::encode(is_js_array)); | 2784 IsJSArrayBits::encode(is_js_array); |
2786 } | 2785 } |
2787 | 2786 |
2788 static void GenerateAheadOfTime(Isolate* isolate); | 2787 static void GenerateAheadOfTime(Isolate* isolate); |
2789 | 2788 |
2790 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | 2789 bool is_js_array() const { return IsJSArrayBits::decode(minor_key_); } |
2791 | 2790 |
2792 ElementsKind elements_kind() const { | 2791 ElementsKind elements_kind() const { |
2793 return ElementsKindBits::decode(sub_minor_key()); | 2792 return ElementsKindBits::decode(minor_key_); |
2794 } | 2793 } |
2795 | 2794 |
2796 KeyedAccessStoreMode store_mode() const { | 2795 KeyedAccessStoreMode store_mode() const { |
2797 return CommonStoreModeBits::decode(sub_minor_key()); | 2796 return CommonStoreModeBits::decode(minor_key_); |
2798 } | 2797 } |
2799 | 2798 |
2800 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 2799 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
2801 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } | 2800 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
2802 | 2801 |
2803 private: | 2802 private: |
2804 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; | 2803 class ElementsKindBits |
2805 class IsJSArrayBits : public BitField<bool, 11, 1> {}; | 2804 : public BitField<ElementsKind, CommonStoreModeBits::kNext, 8> {}; |
| 2805 class IsJSArrayBits : public BitField<bool, ElementsKindBits::kNext, 1> {}; |
2806 | 2806 |
2807 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 2807 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
2808 DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub); | 2808 DEFINE_TURBOFAN_CODE_STUB(StoreFastElement, TurboFanCodeStub); |
2809 }; | 2809 }; |
2810 | 2810 |
2811 | 2811 |
2812 class TransitionElementsKindStub : public HydrogenCodeStub { | 2812 class TransitionElementsKindStub : public HydrogenCodeStub { |
2813 public: | 2813 public: |
2814 TransitionElementsKindStub(Isolate* isolate, ElementsKind from_kind, | 2814 TransitionElementsKindStub(Isolate* isolate, ElementsKind from_kind, |
2815 ElementsKind to_kind) | 2815 ElementsKind to_kind) |
2816 : HydrogenCodeStub(isolate) { | 2816 : HydrogenCodeStub(isolate) { |
2817 set_sub_minor_key(FromKindBits::encode(from_kind) | | 2817 set_sub_minor_key(FromKindBits::encode(from_kind) | |
2818 ToKindBits::encode(to_kind)); | 2818 ToKindBits::encode(to_kind)); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2997 } | 2997 } |
2998 | 2998 |
2999 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 2999 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
3000 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } | 3000 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
3001 | 3001 |
3002 private: | 3002 private: |
3003 ElementsKind elements_kind() const { | 3003 ElementsKind elements_kind() const { |
3004 return ElementsKindBits::decode(minor_key_); | 3004 return ElementsKindBits::decode(minor_key_); |
3005 } | 3005 } |
3006 | 3006 |
3007 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; | 3007 class ElementsKindBits |
| 3008 : public BitField<ElementsKind, CommonStoreModeBits::kNext, 8> {}; |
3008 | 3009 |
3009 DEFINE_PLATFORM_CODE_STUB(StoreElement, PlatformCodeStub); | 3010 DEFINE_PLATFORM_CODE_STUB(StoreElement, PlatformCodeStub); |
3010 }; | 3011 }; |
3011 | 3012 |
3012 class ToBooleanICStub : public HydrogenCodeStub { | 3013 class ToBooleanICStub : public HydrogenCodeStub { |
3013 public: | 3014 public: |
3014 enum Type { | 3015 enum Type { |
3015 UNDEFINED, | 3016 UNDEFINED, |
3016 BOOLEAN, | 3017 BOOLEAN, |
3017 NULL_TYPE, | 3018 NULL_TYPE, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 ElementsKind to_kind() const { return ToBits::decode(sub_minor_key()); } | 3098 ElementsKind to_kind() const { return ToBits::decode(sub_minor_key()); } |
3098 bool is_jsarray() const { return IsJSArrayBits::decode(sub_minor_key()); } | 3099 bool is_jsarray() const { return IsJSArrayBits::decode(sub_minor_key()); } |
3099 KeyedAccessStoreMode store_mode() const { | 3100 KeyedAccessStoreMode store_mode() const { |
3100 return CommonStoreModeBits::decode(sub_minor_key()); | 3101 return CommonStoreModeBits::decode(sub_minor_key()); |
3101 } | 3102 } |
3102 | 3103 |
3103 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 3104 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
3104 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } | 3105 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
3105 | 3106 |
3106 private: | 3107 private: |
3107 class FromBits : public BitField<ElementsKind, 3, 8> {}; | 3108 class FromBits |
| 3109 : public BitField<ElementsKind, CommonStoreModeBits::kNext, 8> {}; |
3108 class ToBits : public BitField<ElementsKind, 11, 8> {}; | 3110 class ToBits : public BitField<ElementsKind, 11, 8> {}; |
3109 class IsJSArrayBits : public BitField<bool, 19, 1> {}; | 3111 class IsJSArrayBits : public BitField<bool, 19, 1> {}; |
3110 | 3112 |
3111 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreTransition); | 3113 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreTransition); |
3112 DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub); | 3114 DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub); |
3113 }; | 3115 }; |
3114 | 3116 |
3115 | 3117 |
3116 class StubFailureTrampolineStub : public PlatformCodeStub { | 3118 class StubFailureTrampolineStub : public PlatformCodeStub { |
3117 public: | 3119 public: |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3206 #undef DEFINE_HYDROGEN_CODE_STUB | 3208 #undef DEFINE_HYDROGEN_CODE_STUB |
3207 #undef DEFINE_CODE_STUB | 3209 #undef DEFINE_CODE_STUB |
3208 #undef DEFINE_CODE_STUB_BASE | 3210 #undef DEFINE_CODE_STUB_BASE |
3209 | 3211 |
3210 extern Representation RepresentationFromMachineType(MachineType type); | 3212 extern Representation RepresentationFromMachineType(MachineType type); |
3211 | 3213 |
3212 } // namespace internal | 3214 } // namespace internal |
3213 } // namespace v8 | 3215 } // namespace v8 |
3214 | 3216 |
3215 #endif // V8_CODE_STUBS_H_ | 3217 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |