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 1042 matching lines...) Loading... |
1053 inline bool IsArgumentsMarker(); | 1053 inline bool IsArgumentsMarker(); |
1054 inline bool NonFailureIsHeapObject(); | 1054 inline bool NonFailureIsHeapObject(); |
1055 | 1055 |
1056 // Filler objects (fillers and free space objects). | 1056 // Filler objects (fillers and free space objects). |
1057 inline bool IsFiller(); | 1057 inline bool IsFiller(); |
1058 | 1058 |
1059 // Extract the number. | 1059 // Extract the number. |
1060 inline double Number(); | 1060 inline double Number(); |
1061 inline bool IsNaN(); | 1061 inline bool IsNaN(); |
1062 | 1062 |
| 1063 inline Representation OptimalRepresentation() { |
| 1064 if (FLAG_track_fields && IsSmi()) { |
| 1065 return Representation::Smi(); |
| 1066 } else if (FLAG_track_double_fields && IsHeapNumber()) { |
| 1067 return Representation::Double(); |
| 1068 } else { |
| 1069 return Representation::Tagged(); |
| 1070 } |
| 1071 } |
| 1072 |
| 1073 inline bool FitsRepresentation(Representation representation) { |
| 1074 if (FLAG_track_fields && representation.IsSmi()) { |
| 1075 return IsSmi(); |
| 1076 } else if (FLAG_track_double_fields && representation.IsDouble()) { |
| 1077 return IsNumber(); |
| 1078 } |
| 1079 return true; |
| 1080 } |
| 1081 |
1063 // Returns true if the object is of the correct type to be used as a | 1082 // Returns true if the object is of the correct type to be used as a |
1064 // implementation of a JSObject's elements. | 1083 // implementation of a JSObject's elements. |
1065 inline bool HasValidElements(); | 1084 inline bool HasValidElements(); |
1066 | 1085 |
1067 inline bool HasSpecificClassOf(String* name); | 1086 inline bool HasSpecificClassOf(String* name); |
1068 | 1087 |
1069 MUST_USE_RESULT MaybeObject* ToObject(); // ECMA-262 9.9. | 1088 MUST_USE_RESULT MaybeObject* ToObject(); // ECMA-262 9.9. |
1070 bool BooleanValue(); // ECMA-262 9.2. | 1089 bool BooleanValue(); // ECMA-262 9.2. |
1071 | 1090 |
1072 // Convert to a JSObject if needed. | 1091 // Convert to a JSObject if needed. |
(...skipping 726 matching lines...) Loading... |
1799 | 1818 |
1800 // Try to follow an existing transition to a field with attributes NONE. The | 1819 // Try to follow an existing transition to a field with attributes NONE. The |
1801 // return value indicates whether the transition was successful. | 1820 // return value indicates whether the transition was successful. |
1802 static inline Handle<Map> FindTransitionToField(Handle<Map> map, | 1821 static inline Handle<Map> FindTransitionToField(Handle<Map> map, |
1803 Handle<Name> key); | 1822 Handle<Name> key); |
1804 | 1823 |
1805 inline int LastAddedFieldIndex(); | 1824 inline int LastAddedFieldIndex(); |
1806 | 1825 |
1807 // Extend the receiver with a single fast property appeared first in the | 1826 // Extend the receiver with a single fast property appeared first in the |
1808 // passed map. This also extends the property backing store if necessary. | 1827 // passed map. This also extends the property backing store if necessary. |
1809 static void AddFastPropertyUsingMap(Handle<JSObject> object, Handle<Map> map); | |
1810 inline MUST_USE_RESULT MaybeObject* AddFastPropertyUsingMap(Map* map); | |
1811 static void TransitionToMap(Handle<JSObject> object, Handle<Map> map); | 1828 static void TransitionToMap(Handle<JSObject> object, Handle<Map> map); |
1812 inline MUST_USE_RESULT MaybeObject* TransitionToMap(Map* map); | 1829 inline MUST_USE_RESULT MaybeObject* TransitionToMap(Map* map); |
1813 | 1830 |
| 1831 static void MigrateInstance(Handle<JSObject> instance); |
| 1832 inline MUST_USE_RESULT MaybeObject* MigrateInstance(); |
| 1833 |
1814 // Can cause GC. | 1834 // Can cause GC. |
1815 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( | 1835 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( |
1816 Name* key, | 1836 Name* key, |
1817 Object* value, | 1837 Object* value, |
1818 PropertyAttributes attributes); | 1838 PropertyAttributes attributes); |
1819 | 1839 |
1820 // Retrieve a value in a normalized object given a lookup result. | 1840 // Retrieve a value in a normalized object given a lookup result. |
1821 // Handles the special representation of JS global objects. | 1841 // Handles the special representation of JS global objects. |
1822 Object* GetNormalizedProperty(LookupResult* result); | 1842 Object* GetNormalizedProperty(LookupResult* result); |
1823 | 1843 |
(...skipping 333 matching lines...) Loading... |
2157 Object* new_value, | 2177 Object* new_value, |
2158 PropertyAttributes attributes); | 2178 PropertyAttributes attributes); |
2159 | 2179 |
2160 // Converts a descriptor of any other type to a real field, backed by the | 2180 // Converts a descriptor of any other type to a real field, backed by the |
2161 // properties array. | 2181 // properties array. |
2162 MUST_USE_RESULT MaybeObject* ConvertDescriptorToField( | 2182 MUST_USE_RESULT MaybeObject* ConvertDescriptorToField( |
2163 Name* name, | 2183 Name* name, |
2164 Object* new_value, | 2184 Object* new_value, |
2165 PropertyAttributes attributes); | 2185 PropertyAttributes attributes); |
2166 | 2186 |
| 2187 MUST_USE_RESULT MaybeObject* MigrateToMap(Map* new_map); |
| 2188 MUST_USE_RESULT MaybeObject* GeneralizeFieldRepresentation( |
| 2189 int modify_index, |
| 2190 Representation new_representation); |
| 2191 |
2167 // Add a property to a fast-case object. | 2192 // Add a property to a fast-case object. |
2168 MUST_USE_RESULT MaybeObject* AddFastProperty( | 2193 MUST_USE_RESULT MaybeObject* AddFastProperty( |
2169 Name* name, | 2194 Name* name, |
2170 Object* value, | 2195 Object* value, |
2171 PropertyAttributes attributes, | 2196 PropertyAttributes attributes, |
2172 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); | 2197 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); |
2173 | 2198 |
2174 // Add a property to a slow-case object. | 2199 // Add a property to a slow-case object. |
2175 MUST_USE_RESULT MaybeObject* AddSlowProperty(Name* name, | 2200 MUST_USE_RESULT MaybeObject* AddSlowProperty(Name* name, |
2176 Object* value, | 2201 Object* value, |
(...skipping 569 matching lines...) Loading... |
2746 inline PropertyDetails GetDetails(int descriptor_number); | 2771 inline PropertyDetails GetDetails(int descriptor_number); |
2747 inline PropertyType GetType(int descriptor_number); | 2772 inline PropertyType GetType(int descriptor_number); |
2748 inline int GetFieldIndex(int descriptor_number); | 2773 inline int GetFieldIndex(int descriptor_number); |
2749 inline JSFunction* GetConstantFunction(int descriptor_number); | 2774 inline JSFunction* GetConstantFunction(int descriptor_number); |
2750 inline Object* GetCallbacksObject(int descriptor_number); | 2775 inline Object* GetCallbacksObject(int descriptor_number); |
2751 inline AccessorDescriptor* GetCallbacks(int descriptor_number); | 2776 inline AccessorDescriptor* GetCallbacks(int descriptor_number); |
2752 | 2777 |
2753 inline Name* GetSortedKey(int descriptor_number); | 2778 inline Name* GetSortedKey(int descriptor_number); |
2754 inline int GetSortedKeyIndex(int descriptor_number); | 2779 inline int GetSortedKeyIndex(int descriptor_number); |
2755 inline void SetSortedKey(int pointer, int descriptor_number); | 2780 inline void SetSortedKey(int pointer, int descriptor_number); |
| 2781 inline void InitializeRepresentations(Representation representation); |
| 2782 inline void SetRepresentation(int descriptor_number, |
| 2783 Representation representation); |
2756 | 2784 |
2757 // Accessor for complete descriptor. | 2785 // Accessor for complete descriptor. |
2758 inline void Get(int descriptor_number, Descriptor* desc); | 2786 inline void Get(int descriptor_number, Descriptor* desc); |
2759 inline void Set(int descriptor_number, | 2787 inline void Set(int descriptor_number, |
2760 Descriptor* desc, | 2788 Descriptor* desc, |
2761 const WhitenessWitness&); | 2789 const WhitenessWitness&); |
2762 inline void Set(int descriptor_number, Descriptor* desc); | 2790 inline void Set(int descriptor_number, Descriptor* desc); |
2763 | 2791 |
2764 // Append automatically sets the enumeration index. This should only be used | 2792 // Append automatically sets the enumeration index. This should only be used |
2765 // to add descriptors in bulk at the end, followed by sorting the descriptor | 2793 // to add descriptors in bulk at the end, followed by sorting the descriptor |
2766 // array. | 2794 // array. |
2767 inline void Append(Descriptor* desc, const WhitenessWitness&); | 2795 inline void Append(Descriptor* desc, const WhitenessWitness&); |
2768 inline void Append(Descriptor* desc); | 2796 inline void Append(Descriptor* desc); |
2769 | 2797 |
2770 // Transfer a complete descriptor from the src descriptor array to this | 2798 // Transfer a complete descriptor from the src descriptor array to this |
2771 // descriptor array. | 2799 // descriptor array. |
2772 void CopyFrom(int dst_index, | 2800 void CopyFrom(int dst_index, |
2773 DescriptorArray* src, | 2801 DescriptorArray* src, |
2774 int src_index, | 2802 int src_index, |
2775 const WhitenessWitness&); | 2803 const WhitenessWitness&); |
| 2804 MUST_USE_RESULT MaybeObject* Merge(int verbatim, |
| 2805 int valid, |
| 2806 int new_size, |
| 2807 DescriptorArray* other); |
2776 | 2808 |
2777 MUST_USE_RESULT MaybeObject* CopyUpTo(int enumeration_index); | 2809 MUST_USE_RESULT MaybeObject* CopyUpTo(int enumeration_index); |
2778 | 2810 |
2779 // Sort the instance descriptors by the hash codes of their keys. | 2811 // Sort the instance descriptors by the hash codes of their keys. |
2780 void Sort(); | 2812 void Sort(); |
2781 | 2813 |
2782 // Search the instance descriptors for given name. | 2814 // Search the instance descriptors for given name. |
2783 INLINE(int Search(Name* name, int number_of_own_descriptors)); | 2815 INLINE(int Search(Name* name, int number_of_own_descriptors)); |
2784 | 2816 |
2785 // As the above, but uses DescriptorLookupCache and updates it when | 2817 // As the above, but uses DescriptorLookupCache and updates it when |
(...skipping 2096 matching lines...) Loading... |
4882 // All code indexes used in the class are counted starting from the first | 4914 // All code indexes used in the class are counted starting from the first |
4883 // code object of the first group. In other words, code index 0 corresponds | 4915 // code object of the first group. In other words, code index 0 corresponds |
4884 // to array index n = kCodesStartIndex. | 4916 // to array index n = kCodesStartIndex. |
4885 | 4917 |
4886 class DependentCode: public FixedArray { | 4918 class DependentCode: public FixedArray { |
4887 public: | 4919 public: |
4888 enum DependencyGroup { | 4920 enum DependencyGroup { |
4889 // Group of code that weakly embed this map and depend on being | 4921 // Group of code that weakly embed this map and depend on being |
4890 // deoptimized when the map is garbage collected. | 4922 // deoptimized when the map is garbage collected. |
4891 kWeaklyEmbeddedGroup, | 4923 kWeaklyEmbeddedGroup, |
| 4924 // Group of code that embed a transition to this map, and depend on being |
| 4925 // deoptimized when the transition is replaced by a new version. |
| 4926 kTransitionGroup, |
4892 // Group of code that omit run-time prototype checks for prototypes | 4927 // Group of code that omit run-time prototype checks for prototypes |
4893 // described by this map. The group is deoptimized whenever an object | 4928 // described by this map. The group is deoptimized whenever an object |
4894 // described by this map changes shape (and transitions to a new map), | 4929 // described by this map changes shape (and transitions to a new map), |
4895 // possibly invalidating the assumptions embedded in the code. | 4930 // possibly invalidating the assumptions embedded in the code. |
4896 kPrototypeCheckGroup, | 4931 kPrototypeCheckGroup, |
4897 kGroupCount = kPrototypeCheckGroup + 1 | 4932 kGroupCount = kPrototypeCheckGroup + 1 |
4898 }; | 4933 }; |
4899 | 4934 |
4900 // Array for holding the index of the first code object of each group. | 4935 // Array for holding the index of the first code object of each group. |
4901 // The last element stores the total number of code objects. | 4936 // The last element stores the total number of code objects. |
(...skipping 73 matching lines...) Loading... |
4975 inline int bit_field3(); | 5010 inline int bit_field3(); |
4976 inline void set_bit_field3(int value); | 5011 inline void set_bit_field3(int value); |
4977 | 5012 |
4978 class EnumLengthBits: public BitField<int, 0, 11> {}; | 5013 class EnumLengthBits: public BitField<int, 0, 11> {}; |
4979 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; | 5014 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; |
4980 class IsShared: public BitField<bool, 22, 1> {}; | 5015 class IsShared: public BitField<bool, 22, 1> {}; |
4981 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; | 5016 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; |
4982 class DictionaryMap: public BitField<bool, 24, 1> {}; | 5017 class DictionaryMap: public BitField<bool, 24, 1> {}; |
4983 class OwnsDescriptors: public BitField<bool, 25, 1> {}; | 5018 class OwnsDescriptors: public BitField<bool, 25, 1> {}; |
4984 class IsObserved: public BitField<bool, 26, 1> {}; | 5019 class IsObserved: public BitField<bool, 26, 1> {}; |
| 5020 class Deprecated: public BitField<bool, 27, 1> {}; |
4985 | 5021 |
4986 // Tells whether the object in the prototype property will be used | 5022 // Tells whether the object in the prototype property will be used |
4987 // for instances created from this function. If the prototype | 5023 // for instances created from this function. If the prototype |
4988 // property is set to a value that is not a JSObject, the prototype | 5024 // property is set to a value that is not a JSObject, the prototype |
4989 // property will not be used to create instances of the function. | 5025 // property will not be used to create instances of the function. |
4990 // See ECMA-262, 13.2.2. | 5026 // See ECMA-262, 13.2.2. |
4991 inline void set_non_instance_prototype(bool value); | 5027 inline void set_non_instance_prototype(bool value); |
4992 inline bool has_non_instance_prototype(); | 5028 inline bool has_non_instance_prototype(); |
4993 | 5029 |
4994 // Tells whether function has special prototype property. If not, prototype | 5030 // Tells whether function has special prototype property. If not, prototype |
(...skipping 122 matching lines...) Loading... |
5117 Map* transitioned_map); | 5153 Map* transitioned_map); |
5118 inline void SetTransition(int transition_index, Map* target); | 5154 inline void SetTransition(int transition_index, Map* target); |
5119 inline Map* GetTransition(int transition_index); | 5155 inline Map* GetTransition(int transition_index); |
5120 MUST_USE_RESULT inline MaybeObject* AddTransition(Name* key, | 5156 MUST_USE_RESULT inline MaybeObject* AddTransition(Name* key, |
5121 Map* target, | 5157 Map* target, |
5122 SimpleTransitionFlag flag); | 5158 SimpleTransitionFlag flag); |
5123 DECL_ACCESSORS(transitions, TransitionArray) | 5159 DECL_ACCESSORS(transitions, TransitionArray) |
5124 inline void ClearTransitions(Heap* heap, | 5160 inline void ClearTransitions(Heap* heap, |
5125 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 5161 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
5126 | 5162 |
| 5163 void DeprecateTransitionTree(); |
| 5164 void DeprecateTarget(Name* key, DescriptorArray* new_descriptors); |
| 5165 |
| 5166 Map* FindRootMap(); |
| 5167 Map* FindUpdatedMap(int verbatim, int length, DescriptorArray* descriptors); |
| 5168 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors); |
| 5169 |
| 5170 int NumberOfFields(); |
| 5171 |
| 5172 bool InstancesNeedRewriting(int target_number_of_fields, |
| 5173 int target_inobject, |
| 5174 int target_unused); |
| 5175 static Handle<Map> GeneralizeRepresentation( |
| 5176 Handle<Map> map, |
| 5177 int modify_index, |
| 5178 Representation new_representation); |
| 5179 MUST_USE_RESULT MaybeObject* GeneralizeRepresentation( |
| 5180 int modify_index, |
| 5181 Representation representation); |
| 5182 MUST_USE_RESULT MaybeObject* CopyGeneralizeAllRepresentations(); |
| 5183 |
5127 // Tells whether the map is attached to SharedFunctionInfo | 5184 // Tells whether the map is attached to SharedFunctionInfo |
5128 // (for inobject slack tracking). | 5185 // (for inobject slack tracking). |
5129 inline void set_attached_to_shared_function_info(bool value); | 5186 inline void set_attached_to_shared_function_info(bool value); |
5130 | 5187 |
5131 inline bool attached_to_shared_function_info(); | 5188 inline bool attached_to_shared_function_info(); |
5132 | 5189 |
5133 // Tells whether the map is shared between objects that may have different | 5190 // Tells whether the map is shared between objects that may have different |
5134 // behavior. If true, the map should never be modified, instead a clone | 5191 // behavior. If true, the map should never be modified, instead a clone |
5135 // should be created and modified. | 5192 // should be created and modified. |
5136 inline void set_is_shared(bool value); | 5193 inline void set_is_shared(bool value); |
(...skipping 118 matching lines...) Loading... |
5255 ASSERT(length <= NumberOfOwnDescriptors()); | 5312 ASSERT(length <= NumberOfOwnDescriptors()); |
5256 } | 5313 } |
5257 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); | 5314 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); |
5258 } | 5315 } |
5259 | 5316 |
5260 inline bool CanTrackAllocationSite(); | 5317 inline bool CanTrackAllocationSite(); |
5261 inline bool owns_descriptors(); | 5318 inline bool owns_descriptors(); |
5262 inline void set_owns_descriptors(bool is_shared); | 5319 inline void set_owns_descriptors(bool is_shared); |
5263 inline bool is_observed(); | 5320 inline bool is_observed(); |
5264 inline void set_is_observed(bool is_observed); | 5321 inline void set_is_observed(bool is_observed); |
| 5322 inline void deprecate(); |
| 5323 inline bool is_deprecated(); |
| 5324 inline bool CanBeDeprecated(); |
5265 | 5325 |
5266 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); | 5326 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); |
5267 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); | 5327 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); |
5268 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); | 5328 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); |
5269 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( | 5329 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( |
5270 DescriptorArray* descriptors, | 5330 DescriptorArray* descriptors, |
5271 Name* name, | 5331 Name* name, |
5272 TransitionFlag flag, | 5332 TransitionFlag flag, |
5273 int descriptor_index); | 5333 int descriptor_index); |
| 5334 MUST_USE_RESULT MaybeObject* CopyInstallDescriptors( |
| 5335 int new_descriptor, |
| 5336 DescriptorArray* descriptors); |
5274 MUST_USE_RESULT MaybeObject* ShareDescriptor(DescriptorArray* descriptors, | 5337 MUST_USE_RESULT MaybeObject* ShareDescriptor(DescriptorArray* descriptors, |
5275 Descriptor* descriptor); | 5338 Descriptor* descriptor); |
5276 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, | 5339 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, |
5277 TransitionFlag flag); | 5340 TransitionFlag flag); |
5278 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, | 5341 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, |
5279 TransitionFlag flag); | 5342 TransitionFlag flag); |
5280 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor( | 5343 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor( |
5281 DescriptorArray* descriptors, | 5344 DescriptorArray* descriptors, |
5282 Descriptor* descriptor, | 5345 Descriptor* descriptor, |
5283 int index, | 5346 int index, |
5284 TransitionFlag flag); | 5347 TransitionFlag flag); |
5285 MUST_USE_RESULT MaybeObject* AsElementsKind(ElementsKind kind); | 5348 MUST_USE_RESULT MaybeObject* AsElementsKind(ElementsKind kind); |
5286 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, | 5349 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, |
5287 TransitionFlag flag); | 5350 TransitionFlag flag); |
5288 | 5351 |
5289 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, | 5352 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, |
5290 NormalizedMapSharingMode sharing); | 5353 NormalizedMapSharingMode sharing); |
5291 | 5354 |
5292 inline void AppendDescriptor(Descriptor* desc, | 5355 inline void AppendDescriptor(Descriptor* desc, |
5293 const DescriptorArray::WhitenessWitness&); | 5356 const DescriptorArray::WhitenessWitness&); |
5294 | 5357 |
5295 // Returns a copy of the map, with all transitions dropped from the | 5358 // Returns a copy of the map, with all transitions dropped from the |
5296 // instance descriptors. | 5359 // instance descriptors. |
5297 MUST_USE_RESULT MaybeObject* Copy(); | 5360 MUST_USE_RESULT MaybeObject* Copy(); |
5298 | 5361 |
5299 // Returns the property index for name (only valid for FAST MODE). | |
5300 int PropertyIndexFor(Name* name); | |
5301 | |
5302 // Returns the next free property index (only valid for FAST MODE). | 5362 // Returns the next free property index (only valid for FAST MODE). |
5303 int NextFreePropertyIndex(); | 5363 int NextFreePropertyIndex(); |
5304 | 5364 |
5305 // Returns the number of properties described in instance_descriptors | 5365 // Returns the number of properties described in instance_descriptors |
5306 // filtering out properties with the specified attributes. | 5366 // filtering out properties with the specified attributes. |
5307 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS, | 5367 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS, |
5308 PropertyAttributes filter = NONE); | 5368 PropertyAttributes filter = NONE); |
5309 | 5369 |
5310 // Casting. | 5370 // Casting. |
5311 static inline Map* cast(Object* obj); | 5371 static inline Map* cast(Object* obj); |
(...skipping 30 matching lines...) Loading... |
5342 void RemoveFromCodeCache(Name* name, Code* code, int index); | 5402 void RemoveFromCodeCache(Name* name, Code* code, int index); |
5343 | 5403 |
5344 // Set all map transitions from this map to dead maps to null. Also clear | 5404 // Set all map transitions from this map to dead maps to null. Also clear |
5345 // back pointers in transition targets so that we do not process this map | 5405 // back pointers in transition targets so that we do not process this map |
5346 // again while following back pointers. | 5406 // again while following back pointers. |
5347 void ClearNonLiveTransitions(Heap* heap); | 5407 void ClearNonLiveTransitions(Heap* heap); |
5348 | 5408 |
5349 // Computes a hash value for this map, to be used in HashTables and such. | 5409 // Computes a hash value for this map, to be used in HashTables and such. |
5350 int Hash(); | 5410 int Hash(); |
5351 | 5411 |
| 5412 bool EquivalentToForTransition(Map* other); |
| 5413 |
5352 // Compares this map to another to see if they describe equivalent objects. | 5414 // Compares this map to another to see if they describe equivalent objects. |
5353 // If |mode| is set to CLEAR_INOBJECT_PROPERTIES, |other| is treated as if | 5415 // If |mode| is set to CLEAR_INOBJECT_PROPERTIES, |other| is treated as if |
5354 // it had exactly zero inobject properties. | 5416 // it had exactly zero inobject properties. |
5355 // The "shared" flags of both this map and |other| are ignored. | 5417 // The "shared" flags of both this map and |other| are ignored. |
5356 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); | 5418 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); |
5357 | 5419 |
5358 // Returns the map that this map transitions to if its elements_kind | 5420 // Returns the map that this map transitions to if its elements_kind |
5359 // is changed to |elements_kind|, or NULL if no such map is cached yet. | 5421 // is changed to |elements_kind|, or NULL if no such map is cached yet. |
5360 // |safe_to_add_transitions| is set to false if adding transitions is not | 5422 // |safe_to_add_transitions| is set to false if adding transitions is not |
5361 // allowed. | 5423 // allowed. |
(...skipping 4067 matching lines...) Loading... |
9429 } else { | 9491 } else { |
9430 value &= ~(1 << bit_position); | 9492 value &= ~(1 << bit_position); |
9431 } | 9493 } |
9432 return value; | 9494 return value; |
9433 } | 9495 } |
9434 }; | 9496 }; |
9435 | 9497 |
9436 } } // namespace v8::internal | 9498 } } // namespace v8::internal |
9437 | 9499 |
9438 #endif // V8_OBJECTS_H_ | 9500 #endif // V8_OBJECTS_H_ |
OLD | NEW |