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/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 : TurboFanCodeStub(isolate) {} | 766 : TurboFanCodeStub(isolate) {} |
767 | 767 |
768 DEFINE_CALL_INTERFACE_DESCRIPTOR(Compare); | 768 DEFINE_CALL_INTERFACE_DESCRIPTOR(Compare); |
769 DEFINE_TURBOFAN_CODE_STUB(StringGreaterThanOrEqual, TurboFanCodeStub); | 769 DEFINE_TURBOFAN_CODE_STUB(StringGreaterThanOrEqual, TurboFanCodeStub); |
770 }; | 770 }; |
771 | 771 |
772 class ToBooleanStub final : public TurboFanCodeStub { | 772 class ToBooleanStub final : public TurboFanCodeStub { |
773 public: | 773 public: |
774 explicit ToBooleanStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 774 explicit ToBooleanStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
775 | 775 |
776 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToBoolean); | 776 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
777 DEFINE_TURBOFAN_CODE_STUB(ToBoolean, TurboFanCodeStub); | 777 DEFINE_TURBOFAN_CODE_STUB(ToBoolean, TurboFanCodeStub); |
778 }; | 778 }; |
779 | 779 |
780 enum StringAddFlags { | 780 enum StringAddFlags { |
781 // Omit both parameter checks. | 781 // Omit both parameter checks. |
782 STRING_ADD_CHECK_NONE = 0, | 782 STRING_ADD_CHECK_NONE = 0, |
783 // Check left parameter. | 783 // Check left parameter. |
784 STRING_ADD_CHECK_LEFT = 1 << 0, | 784 STRING_ADD_CHECK_LEFT = 1 << 0, |
785 // Check right parameter. | 785 // Check right parameter. |
786 STRING_ADD_CHECK_RIGHT = 1 << 1, | 786 STRING_ADD_CHECK_RIGHT = 1 << 1, |
787 // Check both parameters. | 787 // Check both parameters. |
788 STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT, | 788 STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT, |
789 // Convert parameters when check fails (instead of throwing an exception). | 789 // Convert parameters when check fails (instead of throwing an exception). |
790 STRING_ADD_CONVERT = 1 << 2, | 790 STRING_ADD_CONVERT = 1 << 2, |
791 STRING_ADD_CONVERT_LEFT = STRING_ADD_CHECK_LEFT | STRING_ADD_CONVERT, | 791 STRING_ADD_CONVERT_LEFT = STRING_ADD_CHECK_LEFT | STRING_ADD_CONVERT, |
792 STRING_ADD_CONVERT_RIGHT = STRING_ADD_CHECK_RIGHT | STRING_ADD_CONVERT | 792 STRING_ADD_CONVERT_RIGHT = STRING_ADD_CHECK_RIGHT | STRING_ADD_CONVERT |
793 }; | 793 }; |
794 | 794 |
795 | 795 |
796 std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags); | 796 std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags); |
797 | 797 |
798 | 798 |
799 class NumberToStringStub final : public HydrogenCodeStub { | 799 class NumberToStringStub final : public HydrogenCodeStub { |
800 public: | 800 public: |
801 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 801 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
802 | 802 |
803 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 803 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
804 static const int kNumber = 0; | 804 static const int kNumber = 0; |
805 | 805 |
806 DEFINE_CALL_INTERFACE_DESCRIPTOR(NumberToString); | 806 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
807 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); | 807 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); |
808 }; | 808 }; |
809 | 809 |
810 | 810 |
811 class TypeofStub final : public HydrogenCodeStub { | 811 class TypeofStub final : public HydrogenCodeStub { |
812 public: | 812 public: |
813 explicit TypeofStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 813 explicit TypeofStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
814 | 814 |
815 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 815 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
816 static const int kObject = 0; | 816 static const int kObject = 0; |
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2813 return MONOMORPHIC; | 2813 return MONOMORPHIC; |
2814 } | 2814 } |
2815 } | 2815 } |
2816 | 2816 |
2817 private: | 2817 private: |
2818 ToBooleanICStub(Isolate* isolate, InitializationState init_state) | 2818 ToBooleanICStub(Isolate* isolate, InitializationState init_state) |
2819 : HydrogenCodeStub(isolate, init_state) {} | 2819 : HydrogenCodeStub(isolate, init_state) {} |
2820 | 2820 |
2821 class TypesBits : public BitField<uint16_t, 0, NUMBER_OF_TYPES> {}; | 2821 class TypesBits : public BitField<uint16_t, 0, NUMBER_OF_TYPES> {}; |
2822 | 2822 |
2823 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToBoolean); | 2823 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
2824 DEFINE_HYDROGEN_CODE_STUB(ToBooleanIC, HydrogenCodeStub); | 2824 DEFINE_HYDROGEN_CODE_STUB(ToBooleanIC, HydrogenCodeStub); |
2825 }; | 2825 }; |
2826 | 2826 |
2827 std::ostream& operator<<(std::ostream& os, const ToBooleanICStub::Types& t); | 2827 std::ostream& operator<<(std::ostream& os, const ToBooleanICStub::Types& t); |
2828 | 2828 |
2829 class ElementsTransitionAndStoreStub : public HydrogenCodeStub { | 2829 class ElementsTransitionAndStoreStub : public HydrogenCodeStub { |
2830 public: | 2830 public: |
2831 ElementsTransitionAndStoreStub(Isolate* isolate, ElementsKind from_kind, | 2831 ElementsTransitionAndStoreStub(Isolate* isolate, ElementsKind from_kind, |
2832 ElementsKind to_kind, bool is_jsarray, | 2832 ElementsKind to_kind, bool is_jsarray, |
2833 KeyedAccessStoreMode store_mode) | 2833 KeyedAccessStoreMode store_mode) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2925 | 2925 |
2926 DEFINE_CALL_INTERFACE_DESCRIPTOR(ContextOnly); | 2926 DEFINE_CALL_INTERFACE_DESCRIPTOR(ContextOnly); |
2927 DEFINE_PLATFORM_CODE_STUB(SubString, PlatformCodeStub); | 2927 DEFINE_PLATFORM_CODE_STUB(SubString, PlatformCodeStub); |
2928 }; | 2928 }; |
2929 | 2929 |
2930 | 2930 |
2931 class ToNumberStub final : public PlatformCodeStub { | 2931 class ToNumberStub final : public PlatformCodeStub { |
2932 public: | 2932 public: |
2933 explicit ToNumberStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2933 explicit ToNumberStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
2934 | 2934 |
2935 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToNumber); | 2935 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
2936 DEFINE_PLATFORM_CODE_STUB(ToNumber, PlatformCodeStub); | 2936 DEFINE_PLATFORM_CODE_STUB(ToNumber, PlatformCodeStub); |
2937 }; | 2937 }; |
2938 | 2938 |
2939 | 2939 |
2940 class ToLengthStub final : public PlatformCodeStub { | 2940 class ToLengthStub final : public PlatformCodeStub { |
2941 public: | 2941 public: |
2942 explicit ToLengthStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2942 explicit ToLengthStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
2943 | 2943 |
2944 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToLength); | 2944 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
2945 DEFINE_PLATFORM_CODE_STUB(ToLength, PlatformCodeStub); | 2945 DEFINE_PLATFORM_CODE_STUB(ToLength, PlatformCodeStub); |
2946 }; | 2946 }; |
2947 | 2947 |
2948 | 2948 |
2949 class ToStringStub final : public PlatformCodeStub { | 2949 class ToStringStub final : public PlatformCodeStub { |
2950 public: | 2950 public: |
2951 explicit ToStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2951 explicit ToStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
2952 | 2952 |
2953 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToString); | 2953 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
2954 DEFINE_PLATFORM_CODE_STUB(ToString, PlatformCodeStub); | 2954 DEFINE_PLATFORM_CODE_STUB(ToString, PlatformCodeStub); |
2955 }; | 2955 }; |
2956 | 2956 |
2957 | 2957 |
2958 class ToNameStub final : public PlatformCodeStub { | 2958 class ToNameStub final : public PlatformCodeStub { |
2959 public: | 2959 public: |
2960 explicit ToNameStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2960 explicit ToNameStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
2961 | 2961 |
2962 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToName); | 2962 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
2963 DEFINE_PLATFORM_CODE_STUB(ToName, PlatformCodeStub); | 2963 DEFINE_PLATFORM_CODE_STUB(ToName, PlatformCodeStub); |
2964 }; | 2964 }; |
2965 | 2965 |
2966 | 2966 |
2967 class ToObjectStub final : public HydrogenCodeStub { | 2967 class ToObjectStub final : public HydrogenCodeStub { |
2968 public: | 2968 public: |
2969 explicit ToObjectStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 2969 explicit ToObjectStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
2970 | 2970 |
2971 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToObject); | 2971 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
2972 DEFINE_HYDROGEN_CODE_STUB(ToObject, HydrogenCodeStub); | 2972 DEFINE_HYDROGEN_CODE_STUB(ToObject, HydrogenCodeStub); |
2973 }; | 2973 }; |
2974 | 2974 |
2975 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2975 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
2976 #undef DEFINE_PLATFORM_CODE_STUB | 2976 #undef DEFINE_PLATFORM_CODE_STUB |
2977 #undef DEFINE_HANDLER_CODE_STUB | 2977 #undef DEFINE_HANDLER_CODE_STUB |
2978 #undef DEFINE_HYDROGEN_CODE_STUB | 2978 #undef DEFINE_HYDROGEN_CODE_STUB |
2979 #undef DEFINE_CODE_STUB | 2979 #undef DEFINE_CODE_STUB |
2980 #undef DEFINE_CODE_STUB_BASE | 2980 #undef DEFINE_CODE_STUB_BASE |
2981 | 2981 |
2982 extern Representation RepresentationFromType(Type* type); | 2982 extern Representation RepresentationFromType(Type* type); |
2983 | 2983 |
2984 } // namespace internal | 2984 } // namespace internal |
2985 } // namespace v8 | 2985 } // namespace v8 |
2986 | 2986 |
2987 #endif // V8_CODE_STUBS_H_ | 2987 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |