Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/objects.h

Issue 14146005: Track representations of fields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make double support consistent. Now DOUBLE always contains smi or heapnumber Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ic.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 StorageType RequiredStorage() {
1064 if (IsTheHole()) return ANY;
1065 if (IsSmi()) return SMI;
1066 if (IsHeapNumber()) return DOUBLE;
1067 return TAGGED;
1068 }
1069
1070 inline bool FitsStorage(StorageType storage) {
1071 if (!FLAG_track_fields) return true;
1072 if (storage == ANY) return false;
1073 if (storage == SMI) {
1074 return IsSmi();
1075 } else if (storage == DOUBLE) {
1076 return IsNumber();
1077 }
1078 return true;
1079 }
1080
1063 // Returns true if the object is of the correct type to be used as a 1081 // Returns true if the object is of the correct type to be used as a
1064 // implementation of a JSObject's elements. 1082 // implementation of a JSObject's elements.
1065 inline bool HasValidElements(); 1083 inline bool HasValidElements();
1066 1084
1067 inline bool HasSpecificClassOf(String* name); 1085 inline bool HasSpecificClassOf(String* name);
1068 1086
1069 MUST_USE_RESULT MaybeObject* ToObject(); // ECMA-262 9.9. 1087 MUST_USE_RESULT MaybeObject* ToObject(); // ECMA-262 9.9.
1070 bool BooleanValue(); // ECMA-262 9.2. 1088 bool BooleanValue(); // ECMA-262 9.2.
1071 1089
1072 // Convert to a JSObject if needed. 1090 // Convert to a JSObject if needed.
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1799 1817
1800 // Try to follow an existing transition to a field with attributes NONE. The 1818 // Try to follow an existing transition to a field with attributes NONE. The
1801 // return value indicates whether the transition was successful. 1819 // return value indicates whether the transition was successful.
1802 static inline Handle<Map> FindTransitionToField(Handle<Map> map, 1820 static inline Handle<Map> FindTransitionToField(Handle<Map> map,
1803 Handle<Name> key); 1821 Handle<Name> key);
1804 1822
1805 inline int LastAddedFieldIndex(); 1823 inline int LastAddedFieldIndex();
1806 1824
1807 // Extend the receiver with a single fast property appeared first in the 1825 // Extend the receiver with a single fast property appeared first in the
1808 // passed map. This also extends the property backing store if necessary. 1826 // 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); 1827 static void TransitionToMap(Handle<JSObject> object, Handle<Map> map);
1812 inline MUST_USE_RESULT MaybeObject* TransitionToMap(Map* map); 1828 inline MUST_USE_RESULT MaybeObject* TransitionToMap(Map* map);
1813 1829
1830 static void MigrateInstance(Handle<JSObject> instance);
1831 inline MUST_USE_RESULT MaybeObject* MigrateInstance();
1832
1814 // Can cause GC. 1833 // Can cause GC.
1815 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( 1834 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes(
1816 Name* key, 1835 Name* key,
1817 Object* value, 1836 Object* value,
1818 PropertyAttributes attributes); 1837 PropertyAttributes attributes);
1819 1838
1820 // Retrieve a value in a normalized object given a lookup result. 1839 // Retrieve a value in a normalized object given a lookup result.
1821 // Handles the special representation of JS global objects. 1840 // Handles the special representation of JS global objects.
1822 Object* GetNormalizedProperty(LookupResult* result); 1841 Object* GetNormalizedProperty(LookupResult* result);
1823 1842
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 Object* new_value, 2176 Object* new_value,
2158 PropertyAttributes attributes); 2177 PropertyAttributes attributes);
2159 2178
2160 // Converts a descriptor of any other type to a real field, backed by the 2179 // Converts a descriptor of any other type to a real field, backed by the
2161 // properties array. 2180 // properties array.
2162 MUST_USE_RESULT MaybeObject* ConvertDescriptorToField( 2181 MUST_USE_RESULT MaybeObject* ConvertDescriptorToField(
2163 Name* name, 2182 Name* name,
2164 Object* new_value, 2183 Object* new_value,
2165 PropertyAttributes attributes); 2184 PropertyAttributes attributes);
2166 2185
2186 MUST_USE_RESULT MaybeObject* MigrateToMap(Map* new_map);
2187 MUST_USE_RESULT MaybeObject* GeneralizeFieldStorage(int modify_index,
2188 StorageType new_storage);
2189
2167 // Add a property to a fast-case object. 2190 // Add a property to a fast-case object.
2168 MUST_USE_RESULT MaybeObject* AddFastProperty( 2191 MUST_USE_RESULT MaybeObject* AddFastProperty(
2169 Name* name, 2192 Name* name,
2170 Object* value, 2193 Object* value,
2171 PropertyAttributes attributes, 2194 PropertyAttributes attributes,
2172 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); 2195 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED);
2173 2196
2174 // Add a property to a slow-case object. 2197 // Add a property to a slow-case object.
2175 MUST_USE_RESULT MaybeObject* AddSlowProperty(Name* name, 2198 MUST_USE_RESULT MaybeObject* AddSlowProperty(Name* name,
2176 Object* value, 2199 Object* value,
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
2746 inline PropertyDetails GetDetails(int descriptor_number); 2769 inline PropertyDetails GetDetails(int descriptor_number);
2747 inline PropertyType GetType(int descriptor_number); 2770 inline PropertyType GetType(int descriptor_number);
2748 inline int GetFieldIndex(int descriptor_number); 2771 inline int GetFieldIndex(int descriptor_number);
2749 inline JSFunction* GetConstantFunction(int descriptor_number); 2772 inline JSFunction* GetConstantFunction(int descriptor_number);
2750 inline Object* GetCallbacksObject(int descriptor_number); 2773 inline Object* GetCallbacksObject(int descriptor_number);
2751 inline AccessorDescriptor* GetCallbacks(int descriptor_number); 2774 inline AccessorDescriptor* GetCallbacks(int descriptor_number);
2752 2775
2753 inline Name* GetSortedKey(int descriptor_number); 2776 inline Name* GetSortedKey(int descriptor_number);
2754 inline int GetSortedKeyIndex(int descriptor_number); 2777 inline int GetSortedKeyIndex(int descriptor_number);
2755 inline void SetSortedKey(int pointer, int descriptor_number); 2778 inline void SetSortedKey(int pointer, int descriptor_number);
2779 inline void InitializeStorageTypes(StorageType storage_type);
2780 inline void SetStorageType(int descriptor_number, StorageType type);
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
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 field transition is replaced by a new version.
4923 kFieldTransitionGroup,
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
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
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 bool TransitionsTo(Map* map);
5163
5164 Map* FindRootMap();
5165 Map* FindUpdatedMap(int length, DescriptorArray* descriptors);
5166 Map* FindLastMatchMap(DescriptorArray* descriptors);
5167
5168 int NumberOfFields();
5169
5170 MUST_USE_RESULT MaybeObject* GeneralizeStorage(int modify_index,
5171 StorageType storage);
5172 MUST_USE_RESULT MaybeObject* CopyGeneralizeStorage(int modify_index,
5173 StorageType storage);
5174
5127 // Tells whether the map is attached to SharedFunctionInfo 5175 // Tells whether the map is attached to SharedFunctionInfo
5128 // (for inobject slack tracking). 5176 // (for inobject slack tracking).
5129 inline void set_attached_to_shared_function_info(bool value); 5177 inline void set_attached_to_shared_function_info(bool value);
5130 5178
5131 inline bool attached_to_shared_function_info(); 5179 inline bool attached_to_shared_function_info();
5132 5180
5133 // Tells whether the map is shared between objects that may have different 5181 // 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 5182 // behavior. If true, the map should never be modified, instead a clone
5135 // should be created and modified. 5183 // should be created and modified.
5136 inline void set_is_shared(bool value); 5184 inline void set_is_shared(bool value);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
5255 ASSERT(length <= NumberOfOwnDescriptors()); 5303 ASSERT(length <= NumberOfOwnDescriptors());
5256 } 5304 }
5257 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); 5305 set_bit_field3(EnumLengthBits::update(bit_field3(), length));
5258 } 5306 }
5259 5307
5260 inline bool CanTrackAllocationSite(); 5308 inline bool CanTrackAllocationSite();
5261 inline bool owns_descriptors(); 5309 inline bool owns_descriptors();
5262 inline void set_owns_descriptors(bool is_shared); 5310 inline void set_owns_descriptors(bool is_shared);
5263 inline bool is_observed(); 5311 inline bool is_observed();
5264 inline void set_is_observed(bool is_observed); 5312 inline void set_is_observed(bool is_observed);
5313 inline void invalidate_transition();
5314 inline bool is_invalid_transition();
5315 inline bool CanTransitionBeInvalidated();
5265 5316
5266 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); 5317 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size);
5267 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); 5318 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors();
5268 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); 5319 MUST_USE_RESULT MaybeObject* CopyDropDescriptors();
5269 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( 5320 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors(
5270 DescriptorArray* descriptors, 5321 DescriptorArray* descriptors,
5271 Name* name, 5322 Name* name,
5272 TransitionFlag flag, 5323 TransitionFlag flag,
5273 int descriptor_index); 5324 int descriptor_index);
5325 MUST_USE_RESULT MaybeObject* CopyInstallDescriptors(
5326 int new_descriptor,
5327 DescriptorArray* descriptors);
5274 MUST_USE_RESULT MaybeObject* ShareDescriptor(DescriptorArray* descriptors, 5328 MUST_USE_RESULT MaybeObject* ShareDescriptor(DescriptorArray* descriptors,
5275 Descriptor* descriptor); 5329 Descriptor* descriptor);
5276 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, 5330 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor,
5277 TransitionFlag flag); 5331 TransitionFlag flag);
5278 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, 5332 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor,
5279 TransitionFlag flag); 5333 TransitionFlag flag);
5280 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor( 5334 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor(
5281 DescriptorArray* descriptors, 5335 DescriptorArray* descriptors,
5282 Descriptor* descriptor, 5336 Descriptor* descriptor,
5283 int index, 5337 int index,
5284 TransitionFlag flag); 5338 TransitionFlag flag);
5285 MUST_USE_RESULT MaybeObject* AsElementsKind(ElementsKind kind); 5339 MUST_USE_RESULT MaybeObject* AsElementsKind(ElementsKind kind);
5286 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, 5340 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind,
5287 TransitionFlag flag); 5341 TransitionFlag flag);
5288 5342
5289 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, 5343 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode,
5290 NormalizedMapSharingMode sharing); 5344 NormalizedMapSharingMode sharing);
5291 5345
5292 inline void AppendDescriptor(Descriptor* desc, 5346 inline void AppendDescriptor(Descriptor* desc,
5293 const DescriptorArray::WhitenessWitness&); 5347 const DescriptorArray::WhitenessWitness&);
5294 5348
5295 // Returns a copy of the map, with all transitions dropped from the 5349 // Returns a copy of the map, with all transitions dropped from the
5296 // instance descriptors. 5350 // instance descriptors.
5297 MUST_USE_RESULT MaybeObject* Copy(); 5351 MUST_USE_RESULT MaybeObject* Copy();
5298 5352
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). 5353 // Returns the next free property index (only valid for FAST MODE).
5303 int NextFreePropertyIndex(); 5354 int NextFreePropertyIndex();
5304 5355
5305 // Returns the number of properties described in instance_descriptors 5356 // Returns the number of properties described in instance_descriptors
5306 // filtering out properties with the specified attributes. 5357 // filtering out properties with the specified attributes.
5307 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS, 5358 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS,
5308 PropertyAttributes filter = NONE); 5359 PropertyAttributes filter = NONE);
5309 5360
5310 // Casting. 5361 // Casting.
5311 static inline Map* cast(Object* obj); 5362 static inline Map* cast(Object* obj);
(...skipping 30 matching lines...) Expand all
5342 void RemoveFromCodeCache(Name* name, Code* code, int index); 5393 void RemoveFromCodeCache(Name* name, Code* code, int index);
5343 5394
5344 // Set all map transitions from this map to dead maps to null. Also clear 5395 // 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 5396 // back pointers in transition targets so that we do not process this map
5346 // again while following back pointers. 5397 // again while following back pointers.
5347 void ClearNonLiveTransitions(Heap* heap); 5398 void ClearNonLiveTransitions(Heap* heap);
5348 5399
5349 // Computes a hash value for this map, to be used in HashTables and such. 5400 // Computes a hash value for this map, to be used in HashTables and such.
5350 int Hash(); 5401 int Hash();
5351 5402
5403 bool EquivalentToForTransition(Map* other);
5404
5352 // Compares this map to another to see if they describe equivalent objects. 5405 // 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 5406 // If |mode| is set to CLEAR_INOBJECT_PROPERTIES, |other| is treated as if
5354 // it had exactly zero inobject properties. 5407 // it had exactly zero inobject properties.
5355 // The "shared" flags of both this map and |other| are ignored. 5408 // The "shared" flags of both this map and |other| are ignored.
5356 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); 5409 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode);
5357 5410
5358 // Returns the map that this map transitions to if its elements_kind 5411 // 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. 5412 // 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 5413 // |safe_to_add_transitions| is set to false if adding transitions is not
5361 // allowed. 5414 // allowed.
(...skipping 4067 matching lines...) Expand 10 before | Expand all | Expand 10 after
9429 } else { 9482 } else {
9430 value &= ~(1 << bit_position); 9483 value &= ~(1 << bit_position);
9431 } 9484 }
9432 return value; 9485 return value;
9433 } 9486 }
9434 }; 9487 };
9435 9488
9436 } } // namespace v8::internal 9489 } } // namespace v8::internal
9437 9490
9438 #endif // V8_OBJECTS_H_ 9491 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698