| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // Derived constants from ElementsKind | 166 // Derived constants from ElementsKind |
| 167 FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_BYTE_ELEMENTS, | 167 FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_BYTE_ELEMENTS, |
| 168 LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS, | 168 LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS, |
| 169 FIRST_ELEMENTS_KIND = FAST_SMI_ONLY_ELEMENTS, | 169 FIRST_ELEMENTS_KIND = FAST_SMI_ONLY_ELEMENTS, |
| 170 LAST_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS | 170 LAST_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 static const int kElementsKindCount = | 173 static const int kElementsKindCount = |
| 174 LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1; | 174 LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1; |
| 175 | 175 |
| 176 void PrintElementsKind(FILE* out, ElementsKind kind); |
| 177 |
| 176 // PropertyDetails captures type and attributes for a property. | 178 // PropertyDetails captures type and attributes for a property. |
| 177 // They are used both in property dictionaries and instance descriptors. | 179 // They are used both in property dictionaries and instance descriptors. |
| 178 class PropertyDetails BASE_EMBEDDED { | 180 class PropertyDetails BASE_EMBEDDED { |
| 179 public: | 181 public: |
| 180 PropertyDetails(PropertyAttributes attributes, | 182 PropertyDetails(PropertyAttributes attributes, |
| 181 PropertyType type, | 183 PropertyType type, |
| 182 int index = 0) { | 184 int index = 0) { |
| 183 ASSERT(TypeField::is_valid(type)); | 185 ASSERT(TypeField::is_valid(type)); |
| 184 ASSERT(AttributesField::is_valid(attributes)); | 186 ASSERT(AttributesField::is_valid(attributes)); |
| 185 ASSERT(StorageField::is_valid(index)); | 187 ASSERT(StorageField::is_valid(index)); |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 // Since Smi and Failure are subclasses of Object no | 852 // Since Smi and Failure are subclasses of Object no |
| 851 // data members can be present in Object. | 853 // data members can be present in Object. |
| 852 class Object : public MaybeObject { | 854 class Object : public MaybeObject { |
| 853 public: | 855 public: |
| 854 // Type testing. | 856 // Type testing. |
| 855 #define IS_TYPE_FUNCTION_DECL(type_) inline bool Is##type_(); | 857 #define IS_TYPE_FUNCTION_DECL(type_) inline bool Is##type_(); |
| 856 OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) | 858 OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
| 857 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) | 859 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
| 858 #undef IS_TYPE_FUNCTION_DECL | 860 #undef IS_TYPE_FUNCTION_DECL |
| 859 | 861 |
| 862 inline bool IsFixedArrayBase(); |
| 863 |
| 860 // Returns true if this object is an instance of the specified | 864 // Returns true if this object is an instance of the specified |
| 861 // function template. | 865 // function template. |
| 862 inline bool IsInstanceOf(FunctionTemplateInfo* type); | 866 inline bool IsInstanceOf(FunctionTemplateInfo* type); |
| 863 | 867 |
| 864 inline bool IsStruct(); | 868 inline bool IsStruct(); |
| 865 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); | 869 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); |
| 866 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) | 870 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) |
| 867 #undef DECLARE_STRUCT_PREDICATE | 871 #undef DECLARE_STRUCT_PREDICATE |
| 868 | 872 |
| 869 INLINE(bool IsSpecObject()); | 873 INLINE(bool IsSpecObject()); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 | 946 |
| 943 // Returns true if this is a JSValue containing a string and the index is | 947 // Returns true if this is a JSValue containing a string and the index is |
| 944 // < the length of the string. Used to implement [] on strings. | 948 // < the length of the string. Used to implement [] on strings. |
| 945 inline bool IsStringObjectWithCharacterAt(uint32_t index); | 949 inline bool IsStringObjectWithCharacterAt(uint32_t index); |
| 946 | 950 |
| 947 #ifdef DEBUG | 951 #ifdef DEBUG |
| 948 // Verify a pointer is a valid object pointer. | 952 // Verify a pointer is a valid object pointer. |
| 949 static void VerifyPointer(Object* p); | 953 static void VerifyPointer(Object* p); |
| 950 #endif | 954 #endif |
| 951 | 955 |
| 956 // Print objects in an absolute minimal form. Prints either the name of the |
| 957 // oddball/built-in object, the content of strings, or the address of the |
| 958 // object. NOTE: MiniPrint is defined for all builds (not just DEBUG builds) |
| 959 // because we may want to be able to trace function calls in all modes. |
| 960 void MiniPrint(); |
| 961 |
| 952 // Prints this object without details. | 962 // Prints this object without details. |
| 953 inline void ShortPrint() { | 963 inline void ShortPrint() { |
| 954 ShortPrint(stdout); | 964 ShortPrint(stdout); |
| 955 } | 965 } |
| 956 void ShortPrint(FILE* out); | 966 void ShortPrint(FILE* out); |
| 957 | 967 |
| 958 // Prints this object without details to a message accumulator. | 968 // Prints this object without details to a message accumulator. |
| 959 void ShortPrint(StringStream* accumulator); | 969 void ShortPrint(StringStream* accumulator); |
| 960 | 970 |
| 961 // Casting: This cast is only needed to satisfy macros in objects-inl.h. | 971 // Casting: This cast is only needed to satisfy macros in objects-inl.h. |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 PrintProperties(stdout); | 1913 PrintProperties(stdout); |
| 1904 } | 1914 } |
| 1905 void PrintProperties(FILE* out); | 1915 void PrintProperties(FILE* out); |
| 1906 | 1916 |
| 1907 inline void PrintElements() { | 1917 inline void PrintElements() { |
| 1908 PrintElements(stdout); | 1918 PrintElements(stdout); |
| 1909 } | 1919 } |
| 1910 void PrintElements(FILE* out); | 1920 void PrintElements(FILE* out); |
| 1911 #endif | 1921 #endif |
| 1912 | 1922 |
| 1923 void PrintElementsTransition( |
| 1924 FILE* file, ElementsKind from_kind, FixedArrayBase* from_elements, |
| 1925 ElementsKind to_kind, FixedArrayBase* to_elements); |
| 1926 |
| 1913 #ifdef DEBUG | 1927 #ifdef DEBUG |
| 1914 // Structure for collecting spill information about JSObjects. | 1928 // Structure for collecting spill information about JSObjects. |
| 1915 class SpillInformation { | 1929 class SpillInformation { |
| 1916 public: | 1930 public: |
| 1917 void Clear(); | 1931 void Clear(); |
| 1918 void Print(); | 1932 void Print(); |
| 1919 int number_of_objects_; | 1933 int number_of_objects_; |
| 1920 int number_of_objects_with_fast_properties_; | 1934 int number_of_objects_with_fast_properties_; |
| 1921 int number_of_objects_with_fast_elements_; | 1935 int number_of_objects_with_fast_elements_; |
| 1922 int number_of_fast_used_fields_; | 1936 int number_of_fast_used_fields_; |
| (...skipping 4212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6135 inline bool AsArrayIndex(uint32_t* index); | 6149 inline bool AsArrayIndex(uint32_t* index); |
| 6136 | 6150 |
| 6137 // Casting. | 6151 // Casting. |
| 6138 static inline String* cast(Object* obj); | 6152 static inline String* cast(Object* obj); |
| 6139 | 6153 |
| 6140 void PrintOn(FILE* out); | 6154 void PrintOn(FILE* out); |
| 6141 | 6155 |
| 6142 // For use during stack traces. Performs rudimentary sanity check. | 6156 // For use during stack traces. Performs rudimentary sanity check. |
| 6143 bool LooksValid(); | 6157 bool LooksValid(); |
| 6144 | 6158 |
| 6159 // Print objects in an absolute minimal form. Prints either the name of the |
| 6160 // oddball/built-in object, the content of strings, or the address of the |
| 6161 // object. NOTE: MiniPrint is defined for all builds (not just DEBUG builds) |
| 6162 // because we may want to be able to trace function calls in all modes. |
| 6163 void MiniPrint(); |
| 6164 |
| 6145 // Dispatched behavior. | 6165 // Dispatched behavior. |
| 6146 void StringShortPrint(StringStream* accumulator); | 6166 void StringShortPrint(StringStream* accumulator); |
| 6147 #ifdef OBJECT_PRINT | 6167 #ifdef OBJECT_PRINT |
| 6148 inline void StringPrint() { | 6168 inline void StringPrint() { |
| 6149 StringPrint(stdout); | 6169 StringPrint(stdout); |
| 6150 } | 6170 } |
| 6151 void StringPrint(FILE* out); | 6171 void StringPrint(FILE* out); |
| 6152 | 6172 |
| 6153 char* ToAsciiArray(); | 6173 char* ToAsciiArray(); |
| 6154 #endif | 6174 #endif |
| (...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7635 } else { | 7655 } else { |
| 7636 value &= ~(1 << bit_position); | 7656 value &= ~(1 << bit_position); |
| 7637 } | 7657 } |
| 7638 return value; | 7658 return value; |
| 7639 } | 7659 } |
| 7640 }; | 7660 }; |
| 7641 | 7661 |
| 7642 } } // namespace v8::internal | 7662 } } // namespace v8::internal |
| 7643 | 7663 |
| 7644 #endif // V8_OBJECTS_H_ | 7664 #endif // V8_OBJECTS_H_ |
| OLD | NEW |