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 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1782 MUST_USE_RESULT MaybeObject* ReplaceSlowProperty( | 1782 MUST_USE_RESULT MaybeObject* ReplaceSlowProperty( |
1783 String* name, | 1783 String* name, |
1784 Object* value, | 1784 Object* value, |
1785 PropertyAttributes attributes); | 1785 PropertyAttributes attributes); |
1786 | 1786 |
1787 // Returns a new map with all transitions dropped from the object's current | 1787 // Returns a new map with all transitions dropped from the object's current |
1788 // map and the ElementsKind set. | 1788 // map and the ElementsKind set. |
1789 MUST_USE_RESULT MaybeObject* GetElementsTransitionMap( | 1789 MUST_USE_RESULT MaybeObject* GetElementsTransitionMap( |
1790 ElementsKind elements_kind); | 1790 ElementsKind elements_kind); |
1791 | 1791 |
| 1792 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); |
| 1793 |
| 1794 static bool IsValidElementsTransition(ElementsKind from_kind, |
| 1795 ElementsKind to_kind); |
| 1796 |
1792 // Converts a descriptor of any other type to a real field, | 1797 // Converts a descriptor of any other type to a real field, |
1793 // backed by the properties array. Descriptors of visible | 1798 // backed by the properties array. Descriptors of visible |
1794 // types, such as CONSTANT_FUNCTION, keep their enumeration order. | 1799 // types, such as CONSTANT_FUNCTION, keep their enumeration order. |
1795 // Converts the descriptor on the original object's map to a | 1800 // Converts the descriptor on the original object's map to a |
1796 // map transition, and the the new field is on the object's new map. | 1801 // map transition, and the the new field is on the object's new map. |
1797 MUST_USE_RESULT MaybeObject* ConvertDescriptorToFieldAndMapTransition( | 1802 MUST_USE_RESULT MaybeObject* ConvertDescriptorToFieldAndMapTransition( |
1798 String* name, | 1803 String* name, |
1799 Object* new_value, | 1804 Object* new_value, |
1800 PropertyAttributes attributes); | 1805 PropertyAttributes attributes); |
1801 | 1806 |
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4281 // |safe_to_add_transitions| is set to false if adding transitions is not | 4286 // |safe_to_add_transitions| is set to false if adding transitions is not |
4282 // allowed. | 4287 // allowed. |
4283 Map* LookupElementsTransitionMap(ElementsKind elements_kind, | 4288 Map* LookupElementsTransitionMap(ElementsKind elements_kind, |
4284 bool* safe_to_add_transition); | 4289 bool* safe_to_add_transition); |
4285 | 4290 |
4286 // Adds an entry to this map's descriptor array for a transition to | 4291 // Adds an entry to this map's descriptor array for a transition to |
4287 // |transitioned_map| when its elements_kind is changed to |elements_kind|. | 4292 // |transitioned_map| when its elements_kind is changed to |elements_kind|. |
4288 MaybeObject* AddElementsTransition(ElementsKind elements_kind, | 4293 MaybeObject* AddElementsTransition(ElementsKind elements_kind, |
4289 Map* transitioned_map); | 4294 Map* transitioned_map); |
4290 | 4295 |
| 4296 // Returns the transitioned map for this map with the most generic |
| 4297 // elements_kind that's found in |candidates|, or NULL if no match is |
| 4298 // found at all. |
| 4299 Map* FindTransitionedMap(MapList* candidates); |
| 4300 |
4291 // Dispatched behavior. | 4301 // Dispatched behavior. |
4292 #ifdef OBJECT_PRINT | 4302 #ifdef OBJECT_PRINT |
4293 inline void MapPrint() { | 4303 inline void MapPrint() { |
4294 MapPrint(stdout); | 4304 MapPrint(stdout); |
4295 } | 4305 } |
4296 void MapPrint(FILE* out); | 4306 void MapPrint(FILE* out); |
4297 #endif | 4307 #endif |
4298 #ifdef DEBUG | 4308 #ifdef DEBUG |
4299 void MapVerify(); | 4309 void MapVerify(); |
4300 void SharedMapVerify(); | 4310 void SharedMapVerify(); |
(...skipping 3288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7589 } else { | 7599 } else { |
7590 value &= ~(1 << bit_position); | 7600 value &= ~(1 << bit_position); |
7591 } | 7601 } |
7592 return value; | 7602 return value; |
7593 } | 7603 } |
7594 }; | 7604 }; |
7595 | 7605 |
7596 } } // namespace v8::internal | 7606 } } // namespace v8::internal |
7597 | 7607 |
7598 #endif // V8_OBJECTS_H_ | 7608 #endif // V8_OBJECTS_H_ |
OLD | NEW |