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 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1853 MUST_USE_RESULT MaybeObject* AddConstantFunctionProperty( | 1853 MUST_USE_RESULT MaybeObject* AddConstantFunctionProperty( |
1854 String* name, | 1854 String* name, |
1855 JSFunction* function, | 1855 JSFunction* function, |
1856 PropertyAttributes attributes); | 1856 PropertyAttributes attributes); |
1857 | 1857 |
1858 MUST_USE_RESULT MaybeObject* ReplaceSlowProperty( | 1858 MUST_USE_RESULT MaybeObject* ReplaceSlowProperty( |
1859 String* name, | 1859 String* name, |
1860 Object* value, | 1860 Object* value, |
1861 PropertyAttributes attributes); | 1861 PropertyAttributes attributes); |
1862 | 1862 |
| 1863 |
| 1864 // Returns a new map with all transitions dropped from the object's current |
| 1865 // map and the ElementsKind set. |
| 1866 MUST_USE_RESULT MaybeObject* GetElementsTransitionMap( |
| 1867 ElementsKind elements_kind); |
| 1868 |
1863 // Converts a descriptor of any other type to a real field, | 1869 // Converts a descriptor of any other type to a real field, |
1864 // backed by the properties array. Descriptors of visible | 1870 // backed by the properties array. Descriptors of visible |
1865 // types, such as CONSTANT_FUNCTION, keep their enumeration order. | 1871 // types, such as CONSTANT_FUNCTION, keep their enumeration order. |
1866 // Converts the descriptor on the original object's map to a | 1872 // Converts the descriptor on the original object's map to a |
1867 // map transition, and the the new field is on the object's new map. | 1873 // map transition, and the the new field is on the object's new map. |
1868 MUST_USE_RESULT MaybeObject* ConvertDescriptorToFieldAndMapTransition( | 1874 MUST_USE_RESULT MaybeObject* ConvertDescriptorToFieldAndMapTransition( |
1869 String* name, | 1875 String* name, |
1870 Object* new_value, | 1876 Object* new_value, |
1871 PropertyAttributes attributes); | 1877 PropertyAttributes attributes); |
1872 | 1878 |
(...skipping 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4131 | 4137 |
4132 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); | 4138 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); |
4133 | 4139 |
4134 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, | 4140 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, |
4135 NormalizedMapSharingMode sharing); | 4141 NormalizedMapSharingMode sharing); |
4136 | 4142 |
4137 // Returns a copy of the map, with all transitions dropped from the | 4143 // Returns a copy of the map, with all transitions dropped from the |
4138 // instance descriptors. | 4144 // instance descriptors. |
4139 MUST_USE_RESULT MaybeObject* CopyDropTransitions(); | 4145 MUST_USE_RESULT MaybeObject* CopyDropTransitions(); |
4140 | 4146 |
4141 // Returns this map if it already has elements that are fast, otherwise | |
4142 // returns a copy of the map, with all transitions dropped from the | |
4143 // descriptors and the ElementsKind set to FAST_ELEMENTS. | |
4144 MUST_USE_RESULT inline MaybeObject* GetFastElementsMap(); | |
4145 | |
4146 // Returns this map if it already has fast elements that are doubles, | |
4147 // otherwise returns a copy of the map, with all transitions dropped from the | |
4148 // descriptors and the ElementsKind set to FAST_DOUBLE_ELEMENTS. | |
4149 MUST_USE_RESULT inline MaybeObject* GetFastDoubleElementsMap(); | |
4150 | |
4151 // Returns this map if already has dictionary elements, otherwise returns a | |
4152 // copy of the map, with all transitions dropped from the descriptors and the | |
4153 // ElementsKind set to DICTIONARY_ELEMENTS. | |
4154 MUST_USE_RESULT inline MaybeObject* GetSlowElementsMap(); | |
4155 | |
4156 // Returns a new map with all transitions dropped from the descriptors and the | |
4157 // ElementsKind set. | |
4158 MUST_USE_RESULT MaybeObject* GetElementsTransitionMap( | |
4159 ElementsKind elements_kind, | |
4160 bool safe_to_add_transition); | |
4161 | |
4162 // Returns the property index for name (only valid for FAST MODE). | 4147 // Returns the property index for name (only valid for FAST MODE). |
4163 int PropertyIndexFor(String* name); | 4148 int PropertyIndexFor(String* name); |
4164 | 4149 |
4165 // Returns the next free property index (only valid for FAST MODE). | 4150 // Returns the next free property index (only valid for FAST MODE). |
4166 int NextFreePropertyIndex(); | 4151 int NextFreePropertyIndex(); |
4167 | 4152 |
4168 // Returns the number of properties described in instance_descriptors. | 4153 // Returns the number of properties described in instance_descriptors. |
4169 int NumberOfDescribedProperties(); | 4154 int NumberOfDescribedProperties(); |
4170 | 4155 |
4171 // Casting. | 4156 // Casting. |
(...skipping 3314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7486 } else { | 7471 } else { |
7487 value &= ~(1 << bit_position); | 7472 value &= ~(1 << bit_position); |
7488 } | 7473 } |
7489 return value; | 7474 return value; |
7490 } | 7475 } |
7491 }; | 7476 }; |
7492 | 7477 |
7493 } } // namespace v8::internal | 7478 } } // namespace v8::internal |
7494 | 7479 |
7495 #endif // V8_OBJECTS_H_ | 7480 #endif // V8_OBJECTS_H_ |
OLD | NEW |