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 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2727 private: | 2727 private: |
2728 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; | 2728 class ElementsKindBits : public BitField<ElementsKind, 3, 8> {}; |
2729 class IsJSArrayBits : public BitField<bool, 11, 1> {}; | 2729 class IsJSArrayBits : public BitField<bool, 11, 1> {}; |
2730 | 2730 |
2731 DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub); | 2731 DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub); |
2732 }; | 2732 }; |
2733 | 2733 |
2734 | 2734 |
2735 class TransitionElementsKindStub : public HydrogenCodeStub { | 2735 class TransitionElementsKindStub : public HydrogenCodeStub { |
2736 public: | 2736 public: |
2737 TransitionElementsKindStub(Isolate* isolate, | 2737 TransitionElementsKindStub(Isolate* isolate, ElementsKind from_kind, |
2738 ElementsKind from_kind, | 2738 ElementsKind to_kind) |
2739 ElementsKind to_kind, | 2739 : HydrogenCodeStub(isolate) { |
2740 bool is_js_array) : HydrogenCodeStub(isolate) { | |
2741 set_sub_minor_key(FromKindBits::encode(from_kind) | | 2740 set_sub_minor_key(FromKindBits::encode(from_kind) | |
2742 ToKindBits::encode(to_kind) | | 2741 ToKindBits::encode(to_kind)); |
2743 IsJSArrayBits::encode(is_js_array)); | |
2744 } | 2742 } |
2745 | 2743 |
2746 ElementsKind from_kind() const { | 2744 ElementsKind from_kind() const { |
2747 return FromKindBits::decode(sub_minor_key()); | 2745 return FromKindBits::decode(sub_minor_key()); |
2748 } | 2746 } |
2749 | 2747 |
2750 ElementsKind to_kind() const { return ToKindBits::decode(sub_minor_key()); } | 2748 ElementsKind to_kind() const { return ToKindBits::decode(sub_minor_key()); } |
2751 | 2749 |
2752 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | |
2753 | |
2754 private: | 2750 private: |
2755 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; | 2751 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; |
2756 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; | 2752 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; |
2757 class IsJSArrayBits: public BitField<bool, 16, 1> {}; | |
2758 | 2753 |
2759 DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind); | 2754 DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind); |
2760 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); | 2755 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); |
2761 }; | 2756 }; |
2762 | 2757 |
2763 class AllocateHeapNumberStub : public TurboFanCodeStub { | 2758 class AllocateHeapNumberStub : public TurboFanCodeStub { |
2764 public: | 2759 public: |
2765 explicit AllocateHeapNumberStub(Isolate* isolate) | 2760 explicit AllocateHeapNumberStub(Isolate* isolate) |
2766 : TurboFanCodeStub(isolate) {} | 2761 : TurboFanCodeStub(isolate) {} |
2767 | 2762 |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3141 #undef DEFINE_HYDROGEN_CODE_STUB | 3136 #undef DEFINE_HYDROGEN_CODE_STUB |
3142 #undef DEFINE_CODE_STUB | 3137 #undef DEFINE_CODE_STUB |
3143 #undef DEFINE_CODE_STUB_BASE | 3138 #undef DEFINE_CODE_STUB_BASE |
3144 | 3139 |
3145 extern Representation RepresentationFromType(Type* type); | 3140 extern Representation RepresentationFromType(Type* type); |
3146 | 3141 |
3147 } // namespace internal | 3142 } // namespace internal |
3148 } // namespace v8 | 3143 } // namespace v8 |
3149 | 3144 |
3150 #endif // V8_CODE_STUBS_H_ | 3145 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |