OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
850 | 850 |
851 class AccessorPair; | 851 class AccessorPair; |
852 class AllocationSite; | 852 class AllocationSite; |
853 class AllocationSiteCreationContext; | 853 class AllocationSiteCreationContext; |
854 class AllocationSiteUsageContext; | 854 class AllocationSiteUsageContext; |
855 class DictionaryElementsAccessor; | 855 class DictionaryElementsAccessor; |
856 class ElementsAccessor; | 856 class ElementsAccessor; |
857 class FixedArrayBase; | 857 class FixedArrayBase; |
858 class GlobalObject; | 858 class GlobalObject; |
859 class ObjectVisitor; | 859 class ObjectVisitor; |
860 class LayoutDescriptor; | |
860 class LookupIterator; | 861 class LookupIterator; |
861 class StringStream; | 862 class StringStream; |
862 class TypeFeedbackVector; | 863 class TypeFeedbackVector; |
863 class WeakCell; | 864 class WeakCell; |
864 // We cannot just say "class HeapType;" if it is created from a template... =8-? | 865 // We cannot just say "class HeapType;" if it is created from a template... =8-? |
865 template<class> class TypeImpl; | 866 template<class> class TypeImpl; |
866 struct HeapTypeConfig; | 867 struct HeapTypeConfig; |
867 typedef TypeImpl<HeapTypeConfig> HeapType; | 868 typedef TypeImpl<HeapTypeConfig> HeapType; |
868 | 869 |
869 | 870 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
925 V(FixedFloat32Array) \ | 926 V(FixedFloat32Array) \ |
926 V(FixedFloat64Array) \ | 927 V(FixedFloat64Array) \ |
927 V(FixedUint8ClampedArray) \ | 928 V(FixedUint8ClampedArray) \ |
928 V(ByteArray) \ | 929 V(ByteArray) \ |
929 V(FreeSpace) \ | 930 V(FreeSpace) \ |
930 V(JSReceiver) \ | 931 V(JSReceiver) \ |
931 V(JSObject) \ | 932 V(JSObject) \ |
932 V(JSContextExtensionObject) \ | 933 V(JSContextExtensionObject) \ |
933 V(JSGeneratorObject) \ | 934 V(JSGeneratorObject) \ |
934 V(JSModule) \ | 935 V(JSModule) \ |
936 V(LayoutDescriptor) \ | |
935 V(Map) \ | 937 V(Map) \ |
936 V(DescriptorArray) \ | 938 V(DescriptorArray) \ |
937 V(TransitionArray) \ | 939 V(TransitionArray) \ |
938 V(TypeFeedbackVector) \ | 940 V(TypeFeedbackVector) \ |
939 V(DeoptimizationInputData) \ | 941 V(DeoptimizationInputData) \ |
940 V(DeoptimizationOutputData) \ | 942 V(DeoptimizationOutputData) \ |
941 V(DependentCode) \ | 943 V(DependentCode) \ |
942 V(FixedArray) \ | 944 V(FixedArray) \ |
943 V(FixedDoubleArray) \ | 945 V(FixedDoubleArray) \ |
944 V(ConstantPoolArray) \ | 946 V(ConstantPoolArray) \ |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2052 | 2054 |
2053 // Convert and update the elements backing store to be a | 2055 // Convert and update the elements backing store to be a |
2054 // SeededNumberDictionary dictionary. Returns the backing after conversion. | 2056 // SeededNumberDictionary dictionary. Returns the backing after conversion. |
2055 static Handle<SeededNumberDictionary> NormalizeElements( | 2057 static Handle<SeededNumberDictionary> NormalizeElements( |
2056 Handle<JSObject> object); | 2058 Handle<JSObject> object); |
2057 | 2059 |
2058 // Transform slow named properties to fast variants. | 2060 // Transform slow named properties to fast variants. |
2059 static void MigrateSlowToFast(Handle<JSObject> object, | 2061 static void MigrateSlowToFast(Handle<JSObject> object, |
2060 int unused_property_fields); | 2062 int unused_property_fields); |
2061 | 2063 |
2064 inline bool IsUnboxedDoubleField(FieldIndex index); | |
2065 | |
2062 // Access fast-case object properties at index. | 2066 // Access fast-case object properties at index. |
2063 static Handle<Object> FastPropertyAt(Handle<JSObject> object, | 2067 static Handle<Object> FastPropertyAt(Handle<JSObject> object, |
2064 Representation representation, | 2068 Representation representation, |
2065 FieldIndex index); | 2069 FieldIndex index); |
2066 inline Object* RawFastPropertyAt(FieldIndex index); | 2070 inline Object* RawFastPropertyAt(FieldIndex index); |
2071 inline double RawFastDoublePropertyAt(FieldIndex index); | |
2072 | |
2067 inline void FastPropertyAtPut(FieldIndex index, Object* value); | 2073 inline void FastPropertyAtPut(FieldIndex index, Object* value); |
2074 inline void RawFastPropertyAtPut(FieldIndex index, Object* value); | |
2075 inline void RawFastDoublePropertyAtPut(FieldIndex index, double value); | |
2068 void WriteToField(int descriptor, Object* value); | 2076 void WriteToField(int descriptor, Object* value); |
2069 | 2077 |
2070 // Access to in object properties. | 2078 // Access to in object properties. |
2071 inline int GetInObjectPropertyOffset(int index); | 2079 inline int GetInObjectPropertyOffset(int index); |
2072 inline Object* InObjectPropertyAt(int index); | 2080 inline Object* InObjectPropertyAt(int index); |
2073 inline Object* InObjectPropertyAtPut(int index, | 2081 inline Object* InObjectPropertyAtPut(int index, |
2074 Object* value, | 2082 Object* value, |
2075 WriteBarrierMode mode | 2083 WriteBarrierMode mode |
2076 = UPDATE_WRITE_BARRIER); | 2084 = UPDATE_WRITE_BARRIER); |
2077 | 2085 |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3121 } | 3129 } |
3122 | 3130 |
3123 static int ToValueIndex(int descriptor_number) { | 3131 static int ToValueIndex(int descriptor_number) { |
3124 return kFirstIndex + | 3132 return kFirstIndex + |
3125 (descriptor_number * kDescriptorSize) + | 3133 (descriptor_number * kDescriptorSize) + |
3126 kDescriptorValue; | 3134 kDescriptorValue; |
3127 } | 3135 } |
3128 | 3136 |
3129 // Transfer a complete descriptor from the src descriptor array to this | 3137 // Transfer a complete descriptor from the src descriptor array to this |
3130 // descriptor array. | 3138 // descriptor array. |
3131 void CopyFrom(int index, | 3139 void CopyFrom(int index, DescriptorArray* src, const WhitenessWitness&); |
3132 DescriptorArray* src, | |
3133 const WhitenessWitness&); | |
3134 | 3140 |
3135 inline void Set(int descriptor_number, | 3141 inline void Set(int descriptor_number, |
3136 Descriptor* desc, | 3142 Descriptor* desc, |
3137 const WhitenessWitness&); | 3143 const WhitenessWitness&); |
3138 | 3144 |
3139 // Swap first and second descriptor. | 3145 // Swap first and second descriptor. |
3140 inline void SwapSortedKeys(int first, int second); | 3146 inline void SwapSortedKeys(int first, int second); |
3141 | 3147 |
3142 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); | 3148 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); |
3143 }; | 3149 }; |
(...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4806 elementType scalar); \ | 4812 elementType scalar); \ |
4807 static inline elementType defaultValue(); \ | 4813 static inline elementType defaultValue(); \ |
4808 }; \ | 4814 }; \ |
4809 \ | 4815 \ |
4810 typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array; | 4816 typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array; |
4811 | 4817 |
4812 TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS) | 4818 TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS) |
4813 | 4819 |
4814 #undef FIXED_TYPED_ARRAY_TRAITS | 4820 #undef FIXED_TYPED_ARRAY_TRAITS |
4815 | 4821 |
4822 | |
4823 // LayoutDescriptor is a bit vector defining which fields contain non-tagged | |
4824 // values. It could either be a fixed typed array (slow form) or a Smi | |
4825 // if the length fits (fast form). | |
4826 // Each bit in the layout represents a FIELD. The bits are referenced by | |
4827 // field_index which is a field number. If the bit is set then corresponding | |
4828 // field contains non tagged value and therefore must be skipped by GC. | |
4829 // Otherwise the field is considered tagged. If the queried bit lays "outside" | |
4830 // of the descriptor then the field is also considered tagged. | |
4831 // TODO(ishell): replace INLINE with V8_INLINE | |
4832 class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> { | |
Toon Verwaest
2014/10/31 16:23:41
What about putting this in a separate file?
| |
4833 public: | |
4834 V8_INLINE MUST_USE_RESULT LayoutDescriptor* SetTagged(int field_index, | |
4835 bool tagged); | |
4836 V8_INLINE bool IsTagged(int field_index); | |
4837 | |
4838 // Returns true if this is a layout of the object having only tagged fields. | |
4839 V8_INLINE bool IsFastPointerLayout(); | |
4840 | |
4841 // Returns true if the layout descriptor is in non-Smi form. | |
4842 V8_INLINE bool IsSlowLayout(); | |
4843 | |
4844 DECLARE_CAST(LayoutDescriptor) | |
4845 V8_INLINE static LayoutDescriptor* cast_gc_safe(Object* object); | |
4846 | |
4847 // Builds layout descriptor for given |map| by |num_descriptors| elements of | |
4848 // given descriptors array. The |map|'s descriptors could be different. | |
4849 static Handle<LayoutDescriptor> New(Handle<Map> map, | |
4850 Handle<DescriptorArray> descriptors, | |
4851 int num_descriptors); | |
4852 | |
4853 // Creates new layout descriptor by appending property with |details| to | |
4854 // |map|'s layout descriptor. | |
4855 static Handle<LayoutDescriptor> Append(Handle<Map> map, | |
4856 PropertyDetails details); | |
4857 | |
4858 // Creates new layout descriptor by appending property with |details| to | |
4859 // |map|'s layout descriptor and if it is still fast then returns it. | |
4860 // Otherwise the |full_layout_descriptor| is returned. | |
4861 static Handle<LayoutDescriptor> AppendIfFastOrUseFull( | |
4862 Handle<Map> map, PropertyDetails details, | |
4863 Handle<LayoutDescriptor> full_layout_descriptor); | |
4864 | |
4865 // Layout descriptor that corresponds to an object all fields of which are | |
4866 // tagged (FastPointerLayout). | |
4867 V8_INLINE static LayoutDescriptor* FastPointerLayout(); | |
4868 | |
4869 #ifdef DEBUG | |
4870 // Check that this layout descriptor corresponds to given map. | |
4871 bool IsConsistentWithMap(Map* map); | |
4872 #endif | |
4873 | |
4874 #ifdef OBJECT_PRINT | |
4875 // For our gdb macros, we should perhaps change these in the future. | |
4876 void Print(); | |
4877 | |
4878 void Print(std::ostream& os); // NOLINT | |
4879 #endif | |
4880 | |
4881 private: | |
4882 static const int kNumberOfBits = 32; | |
4883 | |
4884 V8_INLINE static Handle<LayoutDescriptor> New(Isolate* isolate, int length); | |
4885 V8_INLINE static LayoutDescriptor* FromSmi(Smi* smi); | |
4886 | |
4887 V8_INLINE static bool InobjectUnboxedField(int inobject_properties, | |
4888 PropertyDetails details); | |
4889 | |
4890 static Handle<LayoutDescriptor> EnsureCapacity( | |
4891 Isolate* isolate, Handle<LayoutDescriptor> layout_descriptor, | |
4892 int new_capacity); | |
4893 | |
4894 // Returns false if requested field_index out of bounds. | |
4895 V8_INLINE bool GetIndexes(int field_index, int* layout_word_index, | |
4896 uint32_t* layout_mask); | |
4897 | |
4898 // Capacity of layout descriptors in bits. | |
4899 V8_INLINE int capacity(); | |
4900 }; | |
4901 | |
4816 // DeoptimizationInputData is a fixed array used to hold the deoptimization | 4902 // DeoptimizationInputData is a fixed array used to hold the deoptimization |
4817 // data for code generated by the Hydrogen/Lithium compiler. It also | 4903 // data for code generated by the Hydrogen/Lithium compiler. It also |
4818 // contains information about functions that were inlined. If N different | 4904 // contains information about functions that were inlined. If N different |
4819 // functions were inlined then first N elements of the literal array will | 4905 // functions were inlined then first N elements of the literal array will |
4820 // contain these functions. | 4906 // contain these functions. |
4821 // | 4907 // |
4822 // It can be empty. | 4908 // It can be empty. |
4823 class DeoptimizationInputData: public FixedArray { | 4909 class DeoptimizationInputData: public FixedArray { |
4824 public: | 4910 public: |
4825 // Layout description. Indices in the array. | 4911 // Layout description. Indices in the array. |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5896 inline bool has_code_cache(); | 5982 inline bool has_code_cache(); |
5897 | 5983 |
5898 // [prototype]: implicit prototype object. | 5984 // [prototype]: implicit prototype object. |
5899 DECL_ACCESSORS(prototype, Object) | 5985 DECL_ACCESSORS(prototype, Object) |
5900 | 5986 |
5901 // [constructor]: points back to the function responsible for this map. | 5987 // [constructor]: points back to the function responsible for this map. |
5902 DECL_ACCESSORS(constructor, Object) | 5988 DECL_ACCESSORS(constructor, Object) |
5903 | 5989 |
5904 // [instance descriptors]: describes the object. | 5990 // [instance descriptors]: describes the object. |
5905 DECL_ACCESSORS(instance_descriptors, DescriptorArray) | 5991 DECL_ACCESSORS(instance_descriptors, DescriptorArray) |
5906 inline void InitializeDescriptors(DescriptorArray* descriptors); | 5992 |
5993 // [layout descriptor]: describes the object layout. | |
5994 DECL_ACCESSORS(layout_descriptor, LayoutDescriptor) | |
5995 // |layout descriptor| accessor which can be used from GC. | |
5996 inline LayoutDescriptor* layout_descriptor_gc_safe(); | |
5997 | |
5998 // |layout descriptor| accessor that returns a handle. | |
5999 inline Handle<LayoutDescriptor> GetLayoutDescriptor(); | |
6000 | |
6001 inline void UpdateDescriptors(DescriptorArray* descriptors, | |
6002 LayoutDescriptor* layout_descriptor); | |
6003 inline void InitializeDescriptors(DescriptorArray* descriptors, | |
6004 LayoutDescriptor* layout_descriptor); | |
5907 | 6005 |
5908 // [stub cache]: contains stubs compiled for this map. | 6006 // [stub cache]: contains stubs compiled for this map. |
5909 DECL_ACCESSORS(code_cache, Object) | 6007 DECL_ACCESSORS(code_cache, Object) |
5910 | 6008 |
5911 // [dependent code]: list of optimized codes that weakly embed this map. | 6009 // [dependent code]: list of optimized codes that weakly embed this map. |
5912 DECL_ACCESSORS(dependent_code, DependentCode) | 6010 DECL_ACCESSORS(dependent_code, DependentCode) |
5913 | 6011 |
5914 // [back pointer]: points back to the parent map from which a transition | 6012 // [back pointer]: points back to the parent map from which a transition |
5915 // leads to this map. The field overlaps with prototype transitions and the | 6013 // leads to this map. The field overlaps with prototype transitions and the |
5916 // back pointer will be moved into the prototype transitions array if | 6014 // back pointer will be moved into the prototype transitions array if |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6224 static const int kPrototypeOffset = kBitField3Offset + kPointerSize; | 6322 static const int kPrototypeOffset = kBitField3Offset + kPointerSize; |
6225 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; | 6323 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; |
6226 // Storage for the transition array is overloaded to directly contain a back | 6324 // Storage for the transition array is overloaded to directly contain a back |
6227 // pointer if unused. When the map has transitions, the back pointer is | 6325 // pointer if unused. When the map has transitions, the back pointer is |
6228 // transferred to the transition array and accessed through an extra | 6326 // transferred to the transition array and accessed through an extra |
6229 // indirection. | 6327 // indirection. |
6230 static const int kTransitionsOrBackPointerOffset = | 6328 static const int kTransitionsOrBackPointerOffset = |
6231 kConstructorOffset + kPointerSize; | 6329 kConstructorOffset + kPointerSize; |
6232 static const int kDescriptorsOffset = | 6330 static const int kDescriptorsOffset = |
6233 kTransitionsOrBackPointerOffset + kPointerSize; | 6331 kTransitionsOrBackPointerOffset + kPointerSize; |
6332 #if V8_DOUBLE_FIELDS_UNBOXING | |
6333 static const int kLayoutDecriptorOffset = kDescriptorsOffset + kPointerSize; | |
6334 static const int kCodeCacheOffset = kLayoutDecriptorOffset + kPointerSize; | |
6335 #else | |
6336 static const int kLayoutDecriptorOffset = 1; // Must not be ever accessed. | |
6234 static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; | 6337 static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; |
6338 #endif | |
6235 static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize; | 6339 static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize; |
6236 static const int kSize = kDependentCodeOffset + kPointerSize; | 6340 static const int kSize = kDependentCodeOffset + kPointerSize; |
6237 | 6341 |
6238 // Layout of pointer fields. Heap iteration code relies on them | 6342 // Layout of pointer fields. Heap iteration code relies on them |
6239 // being continuously allocated. | 6343 // being continuously allocated. |
6240 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset; | 6344 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset; |
6241 static const int kPointerFieldsEndOffset = kSize; | 6345 static const int kPointerFieldsEndOffset = kSize; |
6242 | 6346 |
6243 // Byte offsets within kInstanceSizesOffset. | 6347 // Byte offsets within kInstanceSizesOffset. |
6244 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; | 6348 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6302 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, | 6406 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, |
6303 kPointerFieldsEndOffset, | 6407 kPointerFieldsEndOffset, |
6304 kSize> BodyDescriptor; | 6408 kSize> BodyDescriptor; |
6305 | 6409 |
6306 // Compares this map to another to see if they describe equivalent objects. | 6410 // Compares this map to another to see if they describe equivalent objects. |
6307 // If |mode| is set to CLEAR_INOBJECT_PROPERTIES, |other| is treated as if | 6411 // If |mode| is set to CLEAR_INOBJECT_PROPERTIES, |other| is treated as if |
6308 // it had exactly zero inobject properties. | 6412 // it had exactly zero inobject properties. |
6309 // The "shared" flags of both this map and |other| are ignored. | 6413 // The "shared" flags of both this map and |other| are ignored. |
6310 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); | 6414 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); |
6311 | 6415 |
6416 // Returns true if given field is unboxed double. | |
6417 inline bool IsUnboxedDoubleField(FieldIndex index); | |
6418 | |
6312 private: | 6419 private: |
6313 static void ConnectElementsTransition(Handle<Map> parent, Handle<Map> child); | 6420 static void ConnectElementsTransition(Handle<Map> parent, Handle<Map> child); |
6314 static void ConnectTransition(Handle<Map> parent, Handle<Map> child, | 6421 static void ConnectTransition(Handle<Map> parent, Handle<Map> child, |
6315 Handle<Name> name, SimpleTransitionFlag flag); | 6422 Handle<Name> name, SimpleTransitionFlag flag); |
6316 | 6423 |
6317 bool EquivalentToForTransition(Map* other); | 6424 bool EquivalentToForTransition(Map* other); |
6318 static Handle<Map> RawCopy(Handle<Map> map, int instance_size); | 6425 static Handle<Map> RawCopy(Handle<Map> map, int instance_size); |
6319 static Handle<Map> ShareDescriptor(Handle<Map> map, | 6426 static Handle<Map> ShareDescriptor(Handle<Map> map, |
6320 Handle<DescriptorArray> descriptors, | 6427 Handle<DescriptorArray> descriptors, |
6321 Descriptor* descriptor); | 6428 Descriptor* descriptor); |
6322 static Handle<Map> CopyInstallDescriptors( | 6429 static Handle<Map> CopyInstallDescriptors( |
6323 Handle<Map> map, | 6430 Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors, |
6324 int new_descriptor, | 6431 Handle<LayoutDescriptor> layout_descriptor); |
6325 Handle<DescriptorArray> descriptors); | |
6326 static Handle<Map> CopyAddDescriptor(Handle<Map> map, | 6432 static Handle<Map> CopyAddDescriptor(Handle<Map> map, |
6327 Descriptor* descriptor, | 6433 Descriptor* descriptor, |
6328 TransitionFlag flag); | 6434 TransitionFlag flag); |
6329 static Handle<Map> CopyReplaceDescriptors( | 6435 static Handle<Map> CopyReplaceDescriptors( |
6330 Handle<Map> map, | 6436 Handle<Map> map, Handle<DescriptorArray> descriptors, |
6331 Handle<DescriptorArray> descriptors, | 6437 Handle<LayoutDescriptor> layout_descriptor, TransitionFlag flag, |
6332 TransitionFlag flag, | |
6333 MaybeHandle<Name> maybe_name, | 6438 MaybeHandle<Name> maybe_name, |
6334 SimpleTransitionFlag simple_flag = FULL_TRANSITION); | 6439 SimpleTransitionFlag simple_flag = FULL_TRANSITION); |
6335 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map, | 6440 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map, |
6336 Handle<DescriptorArray> descriptors, | 6441 Handle<DescriptorArray> descriptors, |
6337 Descriptor* descriptor, | 6442 Descriptor* descriptor, |
6338 int index, | 6443 int index, |
6339 TransitionFlag flag); | 6444 TransitionFlag flag); |
6340 | 6445 |
6341 static Handle<Map> CopyNormalized(Handle<Map> map, | 6446 static Handle<Map> CopyNormalized(Handle<Map> map, |
6342 PropertyNormalizationMode mode); | 6447 PropertyNormalizationMode mode); |
6343 | 6448 |
6344 // Fires when the layout of an object with a leaf map changes. | 6449 // Fires when the layout of an object with a leaf map changes. |
6345 // This includes adding transitions to the leaf map or changing | 6450 // This includes adding transitions to the leaf map or changing |
6346 // the descriptor array. | 6451 // the descriptor array. |
6347 inline void NotifyLeafMapLayoutChange(); | 6452 inline void NotifyLeafMapLayoutChange(); |
6348 | 6453 |
6349 static Handle<Map> TransitionElementsToSlow(Handle<Map> object, | 6454 static Handle<Map> TransitionElementsToSlow(Handle<Map> object, |
6350 ElementsKind to_kind); | 6455 ElementsKind to_kind); |
6351 | 6456 |
6352 // Zaps the contents of backing data structures. Note that the | 6457 // Zaps the contents of backing data structures. Note that the |
6353 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects | 6458 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects |
6354 // holding weak references when incremental marking is used, because it also | 6459 // holding weak references when incremental marking is used, because it also |
6355 // iterates over objects that are otherwise unreachable. | 6460 // iterates over objects that are otherwise unreachable. |
6356 // In general we only want to call these functions in release mode when | 6461 // In general we only want to call these functions in release mode when |
6357 // heap verification is turned on. | 6462 // heap verification is turned on. |
6358 void ZapPrototypeTransitions(); | 6463 void ZapPrototypeTransitions(); |
6359 void ZapTransitions(); | 6464 void ZapTransitions(); |
6360 | 6465 |
6361 void DeprecateTransitionTree(); | 6466 void DeprecateTransitionTree(); |
6362 void DeprecateTarget(Name* key, DescriptorArray* new_descriptors); | 6467 void DeprecateTarget(Handle<Name> key, |
6468 Handle<DescriptorArray> new_descriptors, | |
6469 Handle<LayoutDescriptor> new_layout_descriptor); | |
6363 | 6470 |
6364 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors); | 6471 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors); |
6365 | 6472 |
6366 void UpdateFieldType(int descriptor_number, Handle<Name> name, | 6473 void UpdateFieldType(int descriptor_number, Handle<Name> name, |
6367 Handle<HeapType> new_type); | 6474 Handle<HeapType> new_type); |
6368 | 6475 |
6369 void PrintGeneralization(FILE* file, | 6476 void PrintGeneralization(FILE* file, |
6370 const char* reason, | 6477 const char* reason, |
6371 int modify_index, | 6478 int modify_index, |
6372 int split, | 6479 int split, |
(...skipping 4532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10905 static inline int set(int value, int bit_position, bool v) { | 11012 static inline int set(int value, int bit_position, bool v) { |
10906 if (v) { | 11013 if (v) { |
10907 value |= (1 << bit_position); | 11014 value |= (1 << bit_position); |
10908 } else { | 11015 } else { |
10909 value &= ~(1 << bit_position); | 11016 value &= ~(1 << bit_position); |
10910 } | 11017 } |
10911 return value; | 11018 return value; |
10912 } | 11019 } |
10913 }; | 11020 }; |
10914 | 11021 |
11022 | |
11023 // InobjectPropertiesHelper is a helper class for querying layout descriptor | |
11024 // about whether the field at given offset is tagged or not. | |
11025 class InobjectPropertiesHelper { | |
11026 public: | |
11027 inline explicit InobjectPropertiesHelper(Map* map); | |
11028 | |
11029 bool all_fields_tagged() { return all_fields_tagged_; } | |
11030 inline bool IsTagged(int offset_in_bytes); | |
11031 | |
11032 private: | |
11033 bool all_fields_tagged_; | |
11034 int header_size_; | |
11035 int inobject_properties_count_; | |
11036 LayoutDescriptor* layout_descriptor_; | |
11037 }; | |
10915 } } // namespace v8::internal | 11038 } } // namespace v8::internal |
10916 | 11039 |
10917 #endif // V8_OBJECTS_H_ | 11040 #endif // V8_OBJECTS_H_ |
OLD | NEW |