| 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 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2768 | 2768 |
| 2769 private: | 2769 private: |
| 2770 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 2770 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 2771 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 2771 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
| 2772 class CanConvertHoleToUndefined : public BitField<bool, 9, 1> {}; | 2772 class CanConvertHoleToUndefined : public BitField<bool, 9, 1> {}; |
| 2773 | 2773 |
| 2774 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2774 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
| 2775 DEFINE_HANDLER_CODE_STUB(LoadFastElement, HandlerStub); | 2775 DEFINE_HANDLER_CODE_STUB(LoadFastElement, HandlerStub); |
| 2776 }; | 2776 }; |
| 2777 | 2777 |
| 2778 | 2778 class StoreFastElementStub : public TurboFanCodeStub { |
| 2779 class StoreFastElementStub : public HydrogenCodeStub { | |
| 2780 public: | 2779 public: |
| 2781 StoreFastElementStub(Isolate* isolate, bool is_js_array, | 2780 StoreFastElementStub(Isolate* isolate, bool is_js_array, |
| 2782 ElementsKind elements_kind, KeyedAccessStoreMode mode) | 2781 ElementsKind elements_kind, KeyedAccessStoreMode mode) |
| 2783 : HydrogenCodeStub(isolate) { | 2782 : TurboFanCodeStub(isolate) { |
| 2784 set_sub_minor_key(CommonStoreModeBits::encode(mode) | | 2783 minor_key_ = CommonStoreModeBits::encode(mode) | |
| 2785 ElementsKindBits::encode(elements_kind) | | 2784 ElementsKindBits::encode(elements_kind) | |
| 2786 IsJSArrayBits::encode(is_js_array)); | 2785 IsJSArrayBits::encode(is_js_array); |
| 2787 } | 2786 } |
| 2788 | 2787 |
| 2789 static void GenerateAheadOfTime(Isolate* isolate); | 2788 static void GenerateAheadOfTime(Isolate* isolate); |
| 2790 | 2789 |
| 2791 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | 2790 bool is_js_array() const { return IsJSArrayBits::decode(minor_key_); } |
| 2792 | 2791 |
| 2793 ElementsKind elements_kind() const { | 2792 ElementsKind elements_kind() const { |
| 2794 return ElementsKindBits::decode(sub_minor_key()); | 2793 return ElementsKindBits::decode(minor_key_); |
| 2795 } | 2794 } |
| 2796 | 2795 |
| 2797 KeyedAccessStoreMode store_mode() const { | 2796 KeyedAccessStoreMode store_mode() const { |
| 2798 return CommonStoreModeBits::decode(sub_minor_key()); | 2797 return CommonStoreModeBits::decode(minor_key_); |
| 2799 } | 2798 } |
| 2800 | 2799 |
| 2801 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 2800 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 2802 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } | 2801 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
| 2803 | 2802 |
| 2804 private: | 2803 private: |
| 2805 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; | 2804 class ElementsKindBits |
| 2806 class IsJSArrayBits : public BitField<bool, 11, 1> {}; | 2805 : public BitField<ElementsKind, CommonStoreModeBits::kNext, 8> {}; |
| 2806 class IsJSArrayBits : public BitField<bool, ElementsKindBits::kNext, 1> {}; |
| 2807 | 2807 |
| 2808 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 2808 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
| 2809 DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub); | 2809 DEFINE_TURBOFAN_CODE_STUB(StoreFastElement, TurboFanCodeStub); |
| 2810 }; | 2810 }; |
| 2811 | 2811 |
| 2812 | 2812 |
| 2813 class TransitionElementsKindStub : public HydrogenCodeStub { | 2813 class TransitionElementsKindStub : public HydrogenCodeStub { |
| 2814 public: | 2814 public: |
| 2815 TransitionElementsKindStub(Isolate* isolate, ElementsKind from_kind, | 2815 TransitionElementsKindStub(Isolate* isolate, ElementsKind from_kind, |
| 2816 ElementsKind to_kind) | 2816 ElementsKind to_kind) |
| 2817 : HydrogenCodeStub(isolate) { | 2817 : HydrogenCodeStub(isolate) { |
| 2818 set_sub_minor_key(FromKindBits::encode(from_kind) | | 2818 set_sub_minor_key(FromKindBits::encode(from_kind) | |
| 2819 ToKindBits::encode(to_kind)); | 2819 ToKindBits::encode(to_kind)); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2998 } | 2998 } |
| 2999 | 2999 |
| 3000 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 3000 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 3001 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } | 3001 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
| 3002 | 3002 |
| 3003 private: | 3003 private: |
| 3004 ElementsKind elements_kind() const { | 3004 ElementsKind elements_kind() const { |
| 3005 return ElementsKindBits::decode(minor_key_); | 3005 return ElementsKindBits::decode(minor_key_); |
| 3006 } | 3006 } |
| 3007 | 3007 |
| 3008 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; | 3008 class ElementsKindBits |
| 3009 : public BitField<ElementsKind, CommonStoreModeBits::kNext, 8> {}; |
| 3009 | 3010 |
| 3010 DEFINE_PLATFORM_CODE_STUB(StoreElement, PlatformCodeStub); | 3011 DEFINE_PLATFORM_CODE_STUB(StoreElement, PlatformCodeStub); |
| 3011 }; | 3012 }; |
| 3012 | 3013 |
| 3013 class ToBooleanICStub : public HydrogenCodeStub { | 3014 class ToBooleanICStub : public HydrogenCodeStub { |
| 3014 public: | 3015 public: |
| 3015 enum Type { | 3016 enum Type { |
| 3016 UNDEFINED, | 3017 UNDEFINED, |
| 3017 BOOLEAN, | 3018 BOOLEAN, |
| 3018 NULL_TYPE, | 3019 NULL_TYPE, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3098 ElementsKind to_kind() const { return ToBits::decode(sub_minor_key()); } | 3099 ElementsKind to_kind() const { return ToBits::decode(sub_minor_key()); } |
| 3099 bool is_jsarray() const { return IsJSArrayBits::decode(sub_minor_key()); } | 3100 bool is_jsarray() const { return IsJSArrayBits::decode(sub_minor_key()); } |
| 3100 KeyedAccessStoreMode store_mode() const { | 3101 KeyedAccessStoreMode store_mode() const { |
| 3101 return CommonStoreModeBits::decode(sub_minor_key()); | 3102 return CommonStoreModeBits::decode(sub_minor_key()); |
| 3102 } | 3103 } |
| 3103 | 3104 |
| 3104 Code::Kind GetCodeKind() const override { return Code::HANDLER; } | 3105 Code::Kind GetCodeKind() const override { return Code::HANDLER; } |
| 3105 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } | 3106 ExtraICState GetExtraICState() const override { return Code::KEYED_STORE_IC; } |
| 3106 | 3107 |
| 3107 private: | 3108 private: |
| 3108 class FromBits : public BitField<ElementsKind, 3, 8> {}; | 3109 class FromBits |
| 3110 : public BitField<ElementsKind, CommonStoreModeBits::kNext, 8> {}; |
| 3109 class ToBits : public BitField<ElementsKind, 11, 8> {}; | 3111 class ToBits : public BitField<ElementsKind, 11, 8> {}; |
| 3110 class IsJSArrayBits : public BitField<bool, 19, 1> {}; | 3112 class IsJSArrayBits : public BitField<bool, 19, 1> {}; |
| 3111 | 3113 |
| 3112 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreTransition); | 3114 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreTransition); |
| 3113 DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub); | 3115 DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub); |
| 3114 }; | 3116 }; |
| 3115 | 3117 |
| 3116 | 3118 |
| 3117 class StubFailureTrampolineStub : public PlatformCodeStub { | 3119 class StubFailureTrampolineStub : public PlatformCodeStub { |
| 3118 public: | 3120 public: |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3215 #undef DEFINE_HYDROGEN_CODE_STUB | 3217 #undef DEFINE_HYDROGEN_CODE_STUB |
| 3216 #undef DEFINE_CODE_STUB | 3218 #undef DEFINE_CODE_STUB |
| 3217 #undef DEFINE_CODE_STUB_BASE | 3219 #undef DEFINE_CODE_STUB_BASE |
| 3218 | 3220 |
| 3219 extern Representation RepresentationFromMachineType(MachineType type); | 3221 extern Representation RepresentationFromMachineType(MachineType type); |
| 3220 | 3222 |
| 3221 } // namespace internal | 3223 } // namespace internal |
| 3222 } // namespace v8 | 3224 } // namespace v8 |
| 3223 | 3225 |
| 3224 #endif // V8_CODE_STUBS_H_ | 3226 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |