OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 OMIT_CREATION | 170 OMIT_CREATION |
171 }; | 171 }; |
172 | 172 |
173 | 173 |
174 // Indicates whether transitions can be added to a source map or not. | 174 // Indicates whether transitions can be added to a source map or not. |
175 enum TransitionFlag { | 175 enum TransitionFlag { |
176 INSERT_TRANSITION, | 176 INSERT_TRANSITION, |
177 OMIT_TRANSITION | 177 OMIT_TRANSITION |
178 }; | 178 }; |
179 | 179 |
| 180 |
| 181 // Indicates whether the transition is simple: the target map of the transition |
| 182 // either extends the current map with a new property, or it modifies the |
| 183 // property that was added last to the current map. |
| 184 enum SimpleTransitionFlag { |
| 185 SIMPLE_TRANSITION, |
| 186 FULL_TRANSITION |
| 187 }; |
| 188 |
| 189 |
180 // Indicates whether we are only interested in the descriptors of a particular | 190 // Indicates whether we are only interested in the descriptors of a particular |
181 // map, or in all descriptors in the descriptor array. | 191 // map, or in all descriptors in the descriptor array. |
182 enum DescriptorFlag { | 192 enum DescriptorFlag { |
183 ALL_DESCRIPTORS, | 193 ALL_DESCRIPTORS, |
184 OWN_DESCRIPTORS | 194 OWN_DESCRIPTORS |
185 }; | 195 }; |
186 | 196 |
187 | 197 |
188 // Instance size sentinel for objects of variable size. | 198 // Instance size sentinel for objects of variable size. |
189 const int kVariableSizeSentinel = 0; | 199 const int kVariableSizeSentinel = 0; |
(...skipping 4639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4829 ElementsKind to_kind); | 4839 ElementsKind to_kind); |
4830 | 4840 |
4831 bool StoresOwnDescriptors() { return HasTransitionArray(); } | 4841 bool StoresOwnDescriptors() { return HasTransitionArray(); } |
4832 inline bool HasTransitionArray(); | 4842 inline bool HasTransitionArray(); |
4833 inline bool HasElementsTransition(); | 4843 inline bool HasElementsTransition(); |
4834 inline Map* elements_transition_map(); | 4844 inline Map* elements_transition_map(); |
4835 MUST_USE_RESULT inline MaybeObject* set_elements_transition_map( | 4845 MUST_USE_RESULT inline MaybeObject* set_elements_transition_map( |
4836 Map* transitioned_map); | 4846 Map* transitioned_map); |
4837 inline void SetTransition(int transition_index, Map* target); | 4847 inline void SetTransition(int transition_index, Map* target); |
4838 inline Map* GetTransition(int transition_index); | 4848 inline Map* GetTransition(int transition_index); |
4839 MUST_USE_RESULT inline MaybeObject* AddTransition(String* key, Map* target); | 4849 MUST_USE_RESULT inline MaybeObject* AddTransition(String* key, |
| 4850 Map* target, |
| 4851 SimpleTransitionFlag flag); |
4840 DECL_ACCESSORS(transitions, TransitionArray) | 4852 DECL_ACCESSORS(transitions, TransitionArray) |
4841 inline void ClearTransitions(Heap* heap, | 4853 inline void ClearTransitions(Heap* heap, |
4842 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 4854 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
4843 | 4855 |
4844 // Tells whether the map is attached to SharedFunctionInfo | 4856 // Tells whether the map is attached to SharedFunctionInfo |
4845 // (for inobject slack tracking). | 4857 // (for inobject slack tracking). |
4846 inline void set_attached_to_shared_function_info(bool value); | 4858 inline void set_attached_to_shared_function_info(bool value); |
4847 | 4859 |
4848 inline bool attached_to_shared_function_info(); | 4860 inline bool attached_to_shared_function_info(); |
4849 | 4861 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4980 | 4992 |
4981 inline bool owns_descriptors(); | 4993 inline bool owns_descriptors(); |
4982 inline void set_owns_descriptors(bool is_shared); | 4994 inline void set_owns_descriptors(bool is_shared); |
4983 | 4995 |
4984 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); | 4996 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); |
4985 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); | 4997 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); |
4986 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); | 4998 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); |
4987 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( | 4999 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( |
4988 DescriptorArray* descriptors, | 5000 DescriptorArray* descriptors, |
4989 String* name, | 5001 String* name, |
4990 TransitionFlag flag); | 5002 TransitionFlag flag, |
| 5003 int descriptor_index); |
4991 MUST_USE_RESULT MaybeObject* ShareDescriptor(Descriptor* descriptor); | 5004 MUST_USE_RESULT MaybeObject* ShareDescriptor(Descriptor* descriptor); |
4992 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, | 5005 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, |
4993 TransitionFlag flag); | 5006 TransitionFlag flag); |
4994 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, | 5007 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, |
4995 TransitionFlag flag); | 5008 TransitionFlag flag); |
4996 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor(Descriptor* descriptor, | 5009 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor(Descriptor* descriptor, |
4997 int index, | 5010 int index, |
4998 TransitionFlag flag); | 5011 TransitionFlag flag); |
4999 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, | 5012 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, |
5000 TransitionFlag flag); | 5013 TransitionFlag flag); |
(...skipping 4005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9006 } else { | 9019 } else { |
9007 value &= ~(1 << bit_position); | 9020 value &= ~(1 << bit_position); |
9008 } | 9021 } |
9009 return value; | 9022 return value; |
9010 } | 9023 } |
9011 }; | 9024 }; |
9012 | 9025 |
9013 } } // namespace v8::internal | 9026 } } // namespace v8::internal |
9014 | 9027 |
9015 #endif // V8_OBJECTS_H_ | 9028 #endif // V8_OBJECTS_H_ |
OLD | NEW |