| 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 12 matching lines...) Expand all Loading... |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #ifndef V8_CODE_STUBS_H_ | 28 #ifndef V8_CODE_STUBS_H_ |
| 29 #define V8_CODE_STUBS_H_ | 29 #define V8_CODE_STUBS_H_ |
| 30 | 30 |
| 31 #include "allocation.h" | 31 #include "allocation.h" |
| 32 #include "globals.h" | 32 #include "globals.h" |
| 33 #include "codegen.h" |
| 33 | 34 |
| 34 namespace v8 { | 35 namespace v8 { |
| 35 namespace internal { | 36 namespace internal { |
| 36 | 37 |
| 37 // List of code stubs used on all platforms. | 38 // List of code stubs used on all platforms. |
| 38 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ | 39 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ |
| 39 V(CallFunction) \ | 40 V(CallFunction) \ |
| 40 V(UnaryOp) \ | 41 V(UnaryOp) \ |
| 41 V(BinaryOp) \ | 42 V(BinaryOp) \ |
| 42 V(StringAdd) \ | 43 V(StringAdd) \ |
| (...skipping 20 matching lines...) Expand all Loading... |
| 63 V(CounterOp) \ | 64 V(CounterOp) \ |
| 64 V(ArgumentsAccess) \ | 65 V(ArgumentsAccess) \ |
| 65 V(RegExpConstructResult) \ | 66 V(RegExpConstructResult) \ |
| 66 V(NumberToString) \ | 67 V(NumberToString) \ |
| 67 V(CEntry) \ | 68 V(CEntry) \ |
| 68 V(JSEntry) \ | 69 V(JSEntry) \ |
| 69 V(KeyedLoadElement) \ | 70 V(KeyedLoadElement) \ |
| 70 V(KeyedStoreElement) \ | 71 V(KeyedStoreElement) \ |
| 71 V(DebuggerStatement) \ | 72 V(DebuggerStatement) \ |
| 72 V(StringDictionaryLookup) \ | 73 V(StringDictionaryLookup) \ |
| 73 V(FastElementsConversion) | 74 V(ElementsTransitionAndStore) |
| 74 | 75 |
| 75 // List of code stubs only used on ARM platforms. | 76 // List of code stubs only used on ARM platforms. |
| 76 #ifdef V8_TARGET_ARCH_ARM | 77 #ifdef V8_TARGET_ARCH_ARM |
| 77 #define CODE_STUB_LIST_ARM(V) \ | 78 #define CODE_STUB_LIST_ARM(V) \ |
| 78 V(GetProperty) \ | 79 V(GetProperty) \ |
| 79 V(SetProperty) \ | 80 V(SetProperty) \ |
| 80 V(InvokeBuiltin) \ | 81 V(InvokeBuiltin) \ |
| 81 V(RegExpCEntry) \ | 82 V(RegExpCEntry) \ |
| 82 V(DirectCEntry) | 83 V(DirectCEntry) |
| 83 #else | 84 #else |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 Type type, | 1022 Type type, |
| 1022 Heap::RootListIndex value, | 1023 Heap::RootListIndex value, |
| 1023 bool result); | 1024 bool result); |
| 1024 void GenerateTypeTransition(MacroAssembler* masm); | 1025 void GenerateTypeTransition(MacroAssembler* masm); |
| 1025 | 1026 |
| 1026 Register tos_; | 1027 Register tos_; |
| 1027 Types types_; | 1028 Types types_; |
| 1028 }; | 1029 }; |
| 1029 | 1030 |
| 1030 | 1031 |
| 1031 class FastElementsConversionStub : public CodeStub { | 1032 class ElementsTransitionAndStoreStub : public CodeStub { |
| 1032 public: | 1033 public: |
| 1033 FastElementsConversionStub(ElementsKind from, | 1034 ElementsTransitionAndStoreStub(ElementsKind from, |
| 1034 ElementsKind to, | 1035 ElementsKind to, |
| 1035 bool is_jsarray, | 1036 bool is_jsarray, |
| 1036 StrictModeFlag strict_mode) | 1037 StrictModeFlag strict_mode) |
| 1037 : from_(from), | 1038 : from_(from), |
| 1038 to_(to), | 1039 to_(to), |
| 1039 is_jsarray_(is_jsarray), | 1040 is_jsarray_(is_jsarray), |
| 1040 strict_mode_(strict_mode) {} | 1041 strict_mode_(strict_mode) {} |
| 1041 | 1042 |
| 1042 private: | 1043 private: |
| 1043 class FromBits: public BitField<ElementsKind, 0, 8> {}; | 1044 class FromBits: public BitField<ElementsKind, 0, 8> {}; |
| 1044 class ToBits: public BitField<ElementsKind, 8, 8> {}; | 1045 class ToBits: public BitField<ElementsKind, 8, 8> {}; |
| 1045 class IsJSArrayBits: public BitField<bool, 16, 8> {}; | 1046 class IsJSArrayBits: public BitField<bool, 16, 8> {}; |
| 1046 class StrictModeBits: public BitField<StrictModeFlag, 24, 8> {}; | 1047 class StrictModeBits: public BitField<StrictModeFlag, 24, 8> {}; |
| 1047 | 1048 |
| 1048 Major MajorKey() { return FastElementsConversion; } | 1049 Major MajorKey() { return ElementsTransitionAndStore; } |
| 1049 int MinorKey() { | 1050 int MinorKey() { |
| 1050 return FromBits::encode(from_) | | 1051 return FromBits::encode(from_) | |
| 1051 ToBits::encode(to_) | | 1052 ToBits::encode(to_) | |
| 1052 IsJSArrayBits::encode(is_jsarray_) | | 1053 IsJSArrayBits::encode(is_jsarray_) | |
| 1053 StrictModeBits::encode(strict_mode_); | 1054 StrictModeBits::encode(strict_mode_); |
| 1054 } | 1055 } |
| 1055 | 1056 |
| 1056 void Generate(MacroAssembler* masm); | 1057 void Generate(MacroAssembler* masm); |
| 1057 static void GenerateSmiOnlyToObject(MacroAssembler* masm, | |
| 1058 StrictModeFlag strict_mode); | |
| 1059 static void GenerateSmiOnlyToDouble(MacroAssembler* masm, | |
| 1060 StrictModeFlag strict_mode); | |
| 1061 static void GenerateDoubleToObject(MacroAssembler* masm, | |
| 1062 StrictModeFlag strict_mode); | |
| 1063 | 1058 |
| 1064 ElementsKind from_; | 1059 ElementsKind from_; |
| 1065 ElementsKind to_; | 1060 ElementsKind to_; |
| 1066 bool is_jsarray_; | 1061 bool is_jsarray_; |
| 1067 StrictModeFlag strict_mode_; | 1062 StrictModeFlag strict_mode_; |
| 1068 | 1063 |
| 1069 DISALLOW_COPY_AND_ASSIGN(FastElementsConversionStub); | 1064 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); |
| 1070 }; | 1065 }; |
| 1071 | 1066 |
| 1072 } } // namespace v8::internal | 1067 } } // namespace v8::internal |
| 1073 | 1068 |
| 1074 #endif // V8_CODE_STUBS_H_ | 1069 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |