| 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 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 PrintProperties(stdout); | 1907 PrintProperties(stdout); |
| 1904 } | 1908 } |
| 1905 void PrintProperties(FILE* out); | 1909 void PrintProperties(FILE* out); |
| 1906 | 1910 |
| 1907 inline void PrintElements() { | 1911 inline void PrintElements() { |
| 1908 PrintElements(stdout); | 1912 PrintElements(stdout); |
| 1909 } | 1913 } |
| 1910 void PrintElements(FILE* out); | 1914 void PrintElements(FILE* out); |
| 1911 #endif | 1915 #endif |
| 1912 | 1916 |
| 1917 void PrintElementsTransition( |
| 1918 FILE* file, ElementsKind from_kind, FixedArrayBase* from_elements, |
| 1919 ElementsKind to_kind, FixedArrayBase* to_elements); |
| 1920 |
| 1913 #ifdef DEBUG | 1921 #ifdef DEBUG |
| 1914 // Structure for collecting spill information about JSObjects. | 1922 // Structure for collecting spill information about JSObjects. |
| 1915 class SpillInformation { | 1923 class SpillInformation { |
| 1916 public: | 1924 public: |
| 1917 void Clear(); | 1925 void Clear(); |
| 1918 void Print(); | 1926 void Print(); |
| 1919 int number_of_objects_; | 1927 int number_of_objects_; |
| 1920 int number_of_objects_with_fast_properties_; | 1928 int number_of_objects_with_fast_properties_; |
| 1921 int number_of_objects_with_fast_elements_; | 1929 int number_of_objects_with_fast_elements_; |
| 1922 int number_of_fast_used_fields_; | 1930 int number_of_fast_used_fields_; |
| (...skipping 5712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7635 } else { | 7643 } else { |
| 7636 value &= ~(1 << bit_position); | 7644 value &= ~(1 << bit_position); |
| 7637 } | 7645 } |
| 7638 return value; | 7646 return value; |
| 7639 } | 7647 } |
| 7640 }; | 7648 }; |
| 7641 | 7649 |
| 7642 } } // namespace v8::internal | 7650 } } // namespace v8::internal |
| 7643 | 7651 |
| 7644 #endif // V8_OBJECTS_H_ | 7652 #endif // V8_OBJECTS_H_ |
| OLD | NEW |