| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 V(RevertToNumber) \ | 63 V(RevertToNumber) \ |
| 64 V(ToBoolean) \ | 64 V(ToBoolean) \ |
| 65 V(ToNumber) \ | 65 V(ToNumber) \ |
| 66 V(CounterOp) \ | 66 V(CounterOp) \ |
| 67 V(ArgumentsAccess) \ | 67 V(ArgumentsAccess) \ |
| 68 V(RegExpExec) \ | 68 V(RegExpExec) \ |
| 69 V(RegExpConstructResult) \ | 69 V(RegExpConstructResult) \ |
| 70 V(NumberToString) \ | 70 V(NumberToString) \ |
| 71 V(CEntry) \ | 71 V(CEntry) \ |
| 72 V(JSEntry) \ | 72 V(JSEntry) \ |
| 73 V(KeyedLoadFastElement) \ | 73 V(KeyedLoadElement) \ |
| 74 V(KeyedStoreFastElement) \ | 74 V(KeyedStoreElement) \ |
| 75 V(KeyedLoadExternalArray) \ | |
| 76 V(KeyedStoreExternalArray) \ | |
| 77 V(DebuggerStatement) \ | 75 V(DebuggerStatement) \ |
| 78 V(StringDictionaryNegativeLookup) | 76 V(StringDictionaryNegativeLookup) |
| 79 | 77 |
| 80 // List of code stubs only used on ARM platforms. | 78 // List of code stubs only used on ARM platforms. |
| 81 #ifdef V8_TARGET_ARCH_ARM | 79 #ifdef V8_TARGET_ARCH_ARM |
| 82 #define CODE_STUB_LIST_ARM(V) \ | 80 #define CODE_STUB_LIST_ARM(V) \ |
| 83 V(GetProperty) \ | 81 V(GetProperty) \ |
| 84 V(SetProperty) \ | 82 V(SetProperty) \ |
| 85 V(InvokeBuiltin) \ | 83 V(InvokeBuiltin) \ |
| 86 V(RegExpCEntry) \ | 84 V(RegExpCEntry) \ |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); | 919 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); |
| 922 }; | 920 }; |
| 923 | 921 |
| 924 #ifdef DEBUG | 922 #ifdef DEBUG |
| 925 #define DECLARE_ARRAY_STUB_PRINT(name) void Print() { PrintF(#name); } | 923 #define DECLARE_ARRAY_STUB_PRINT(name) void Print() { PrintF(#name); } |
| 926 #else | 924 #else |
| 927 #define DECLARE_ARRAY_STUB_PRINT(name) | 925 #define DECLARE_ARRAY_STUB_PRINT(name) |
| 928 #endif | 926 #endif |
| 929 | 927 |
| 930 | 928 |
| 931 class KeyedLoadFastElementStub : public CodeStub { | 929 class KeyedLoadElementStub : public CodeStub { |
| 932 public: | 930 public: |
| 933 explicit KeyedLoadFastElementStub() { | 931 explicit KeyedLoadElementStub(JSObject::ElementsKind elements_kind) |
| 934 } | 932 : elements_kind_(elements_kind) |
| 933 { } |
| 935 | 934 |
| 936 Major MajorKey() { return KeyedLoadFastElement; } | 935 Major MajorKey() { return KeyedLoadElement; } |
| 937 int MinorKey() { return 0; } | |
| 938 | |
| 939 void Generate(MacroAssembler* masm); | |
| 940 | |
| 941 const char* GetName() { return "KeyedLoadFastElementStub"; } | |
| 942 | |
| 943 DECLARE_ARRAY_STUB_PRINT(KeyedLoadFastElementStub) | |
| 944 }; | |
| 945 | |
| 946 | |
| 947 class KeyedStoreFastElementStub : public CodeStub { | |
| 948 public: | |
| 949 explicit KeyedStoreFastElementStub(bool is_js_array) | |
| 950 : is_js_array_(is_js_array) { } | |
| 951 | |
| 952 Major MajorKey() { return KeyedStoreFastElement; } | |
| 953 int MinorKey() { return is_js_array_ ? 1 : 0; } | |
| 954 | |
| 955 void Generate(MacroAssembler* masm); | |
| 956 | |
| 957 const char* GetName() { return "KeyedStoreFastElementStub"; } | |
| 958 | |
| 959 DECLARE_ARRAY_STUB_PRINT(KeyedStoreFastElementStub) | |
| 960 | |
| 961 private: | |
| 962 bool is_js_array_; | |
| 963 }; | |
| 964 | |
| 965 | |
| 966 class KeyedLoadExternalArrayStub : public CodeStub { | |
| 967 public: | |
| 968 explicit KeyedLoadExternalArrayStub(JSObject::ElementsKind elements_kind) | |
| 969 : elements_kind_(elements_kind) { } | |
| 970 | |
| 971 Major MajorKey() { return KeyedLoadExternalArray; } | |
| 972 int MinorKey() { return elements_kind_; } | 936 int MinorKey() { return elements_kind_; } |
| 973 | 937 |
| 974 void Generate(MacroAssembler* masm); | 938 void Generate(MacroAssembler* masm); |
| 975 | 939 |
| 976 const char* GetName() { return "KeyedLoadExternalArrayStub"; } | 940 const char* GetName() { return "KeyedLoadElementStub"; } |
| 977 | 941 |
| 978 DECLARE_ARRAY_STUB_PRINT(KeyedLoadExternalArrayStub) | 942 DECLARE_ARRAY_STUB_PRINT(KeyedLoadElementStub) |
| 979 | 943 |
| 980 protected: | 944 private: |
| 981 JSObject::ElementsKind elements_kind_; | 945 JSObject::ElementsKind elements_kind_; |
| 946 |
| 947 DISALLOW_COPY_AND_ASSIGN(KeyedLoadElementStub); |
| 982 }; | 948 }; |
| 983 | 949 |
| 984 | 950 |
| 985 class KeyedStoreExternalArrayStub : public CodeStub { | 951 class KeyedStoreElementStub : public CodeStub { |
| 986 public: | 952 public: |
| 987 explicit KeyedStoreExternalArrayStub(JSObject::ElementsKind elements_kind) | 953 KeyedStoreElementStub(bool is_js_array, |
| 988 : elements_kind_(elements_kind) { } | 954 JSObject::ElementsKind elements_kind) |
| 955 : is_js_array_(is_js_array), |
| 956 elements_kind_(elements_kind) { } |
| 989 | 957 |
| 990 Major MajorKey() { return KeyedStoreExternalArray; } | 958 Major MajorKey() { return KeyedStoreElement; } |
| 991 int MinorKey() { return elements_kind_; } | 959 int MinorKey() { |
| 960 return (is_js_array_ ? 0 : JSObject::kElementsKindCount) + elements_kind_; |
| 961 } |
| 992 | 962 |
| 993 void Generate(MacroAssembler* masm); | 963 void Generate(MacroAssembler* masm); |
| 994 | 964 |
| 995 const char* GetName() { return "KeyedStoreExternalArrayStub"; } | 965 const char* GetName() { return "KeyedStoreElementStub"; } |
| 996 | 966 |
| 997 DECLARE_ARRAY_STUB_PRINT(KeyedStoreExternalArrayStub) | 967 DECLARE_ARRAY_STUB_PRINT(KeyedStoreElementStub) |
| 998 | 968 |
| 999 protected: | 969 private: |
| 970 bool is_js_array_; |
| 1000 JSObject::ElementsKind elements_kind_; | 971 JSObject::ElementsKind elements_kind_; |
| 972 |
| 973 DISALLOW_COPY_AND_ASSIGN(KeyedStoreElementStub); |
| 1001 }; | 974 }; |
| 1002 | 975 |
| 1003 | 976 |
| 1004 class ToBooleanStub: public CodeStub { | 977 class ToBooleanStub: public CodeStub { |
| 1005 public: | 978 public: |
| 1006 explicit ToBooleanStub(Register tos) : tos_(tos) { } | 979 explicit ToBooleanStub(Register tos) : tos_(tos) { } |
| 1007 | 980 |
| 1008 void Generate(MacroAssembler* masm); | 981 void Generate(MacroAssembler* masm); |
| 1009 | 982 |
| 1010 private: | 983 private: |
| 1011 Register tos_; | 984 Register tos_; |
| 1012 Major MajorKey() { return ToBoolean; } | 985 Major MajorKey() { return ToBoolean; } |
| 1013 int MinorKey() { return tos_.code(); } | 986 int MinorKey() { return tos_.code(); } |
| 1014 }; | 987 }; |
| 1015 | 988 |
| 1016 } } // namespace v8::internal | 989 } } // namespace v8::internal |
| 1017 | 990 |
| 1018 #endif // V8_CODE_STUBS_H_ | 991 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |