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