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

Side by Side Diff: src/objects.h

Issue 391693002: In-object double fields unboxing (for 64-bit only). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comments Created 6 years, 1 month 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
OLDNEW
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
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
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
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
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
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 // Once a layout descriptor is created it is allowed only to append properties
4832 // to it.
4833 class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> {
4834 public:
4835 V8_INLINE bool IsTagged(int field_index);
4836
4837 // Returns true if this is a layout of the object having only tagged fields.
4838 V8_INLINE bool IsFastPointerLayout();
4839
4840 // Returns true if the layout descriptor is in non-Smi form.
4841 V8_INLINE bool IsSlowLayout();
4842
4843 DECLARE_CAST(LayoutDescriptor)
4844 V8_INLINE static LayoutDescriptor* cast_gc_safe(Object* object);
4845
4846 // Builds layout descriptor optimized for given |map| by |num_descriptors|
4847 // elements of given descriptors array. The |map|'s descriptors could be
4848 // 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 is out of bounds.
4895 V8_INLINE bool GetIndexes(int field_index, int* layout_word_index,
4896 uint32_t* layout_mask);
4897
4898 V8_INLINE MUST_USE_RESULT LayoutDescriptor* SetTagged(int field_index,
4899 bool tagged);
4900 // Capacity of layout descriptors in bits.
4901 V8_INLINE int capacity();
4902
4903 friend class TestAccessor;
4904 };
4905
4906
4816 // DeoptimizationInputData is a fixed array used to hold the deoptimization 4907 // DeoptimizationInputData is a fixed array used to hold the deoptimization
4817 // data for code generated by the Hydrogen/Lithium compiler. It also 4908 // data for code generated by the Hydrogen/Lithium compiler. It also
4818 // contains information about functions that were inlined. If N different 4909 // contains information about functions that were inlined. If N different
4819 // functions were inlined then first N elements of the literal array will 4910 // functions were inlined then first N elements of the literal array will
4820 // contain these functions. 4911 // contain these functions.
4821 // 4912 //
4822 // It can be empty. 4913 // It can be empty.
4823 class DeoptimizationInputData: public FixedArray { 4914 class DeoptimizationInputData: public FixedArray {
4824 public: 4915 public:
4825 // Layout description. Indices in the array. 4916 // Layout description. Indices in the array.
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
5896 inline bool has_code_cache(); 5987 inline bool has_code_cache();
5897 5988
5898 // [prototype]: implicit prototype object. 5989 // [prototype]: implicit prototype object.
5899 DECL_ACCESSORS(prototype, Object) 5990 DECL_ACCESSORS(prototype, Object)
5900 5991
5901 // [constructor]: points back to the function responsible for this map. 5992 // [constructor]: points back to the function responsible for this map.
5902 DECL_ACCESSORS(constructor, Object) 5993 DECL_ACCESSORS(constructor, Object)
5903 5994
5904 // [instance descriptors]: describes the object. 5995 // [instance descriptors]: describes the object.
5905 DECL_ACCESSORS(instance_descriptors, DescriptorArray) 5996 DECL_ACCESSORS(instance_descriptors, DescriptorArray)
5906 inline void InitializeDescriptors(DescriptorArray* descriptors); 5997
5998 // [layout descriptor]: describes the object layout.
5999 DECL_ACCESSORS(layout_descriptor, LayoutDescriptor)
6000 // |layout descriptor| accessor which can be used from GC.
6001 inline LayoutDescriptor* layout_descriptor_gc_safe();
6002
6003 // |layout descriptor| accessor that returns a handle.
6004 inline Handle<LayoutDescriptor> GetLayoutDescriptor();
6005
6006 inline void UpdateDescriptors(DescriptorArray* descriptors,
6007 LayoutDescriptor* layout_descriptor);
6008 inline void InitializeDescriptors(DescriptorArray* descriptors,
6009 LayoutDescriptor* layout_descriptor);
5907 6010
5908 // [stub cache]: contains stubs compiled for this map. 6011 // [stub cache]: contains stubs compiled for this map.
5909 DECL_ACCESSORS(code_cache, Object) 6012 DECL_ACCESSORS(code_cache, Object)
5910 6013
5911 // [dependent code]: list of optimized codes that weakly embed this map. 6014 // [dependent code]: list of optimized codes that weakly embed this map.
5912 DECL_ACCESSORS(dependent_code, DependentCode) 6015 DECL_ACCESSORS(dependent_code, DependentCode)
5913 6016
5914 // [back pointer]: points back to the parent map from which a transition 6017 // [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 6018 // leads to this map. The field overlaps with prototype transitions and the
5916 // back pointer will be moved into the prototype transitions array if 6019 // back pointer will be moved into the prototype transitions array if
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
6224 static const int kPrototypeOffset = kBitField3Offset + kPointerSize; 6327 static const int kPrototypeOffset = kBitField3Offset + kPointerSize;
6225 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; 6328 static const int kConstructorOffset = kPrototypeOffset + kPointerSize;
6226 // Storage for the transition array is overloaded to directly contain a back 6329 // 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 6330 // pointer if unused. When the map has transitions, the back pointer is
6228 // transferred to the transition array and accessed through an extra 6331 // transferred to the transition array and accessed through an extra
6229 // indirection. 6332 // indirection.
6230 static const int kTransitionsOrBackPointerOffset = 6333 static const int kTransitionsOrBackPointerOffset =
6231 kConstructorOffset + kPointerSize; 6334 kConstructorOffset + kPointerSize;
6232 static const int kDescriptorsOffset = 6335 static const int kDescriptorsOffset =
6233 kTransitionsOrBackPointerOffset + kPointerSize; 6336 kTransitionsOrBackPointerOffset + kPointerSize;
6337 #if V8_DOUBLE_FIELDS_UNBOXING
6338 static const int kLayoutDecriptorOffset = kDescriptorsOffset + kPointerSize;
6339 static const int kCodeCacheOffset = kLayoutDecriptorOffset + kPointerSize;
6340 #else
6341 static const int kLayoutDecriptorOffset = 1; // Must not be ever accessed.
6234 static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; 6342 static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize;
6343 #endif
6235 static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize; 6344 static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize;
6236 static const int kSize = kDependentCodeOffset + kPointerSize; 6345 static const int kSize = kDependentCodeOffset + kPointerSize;
6237 6346
6238 // Layout of pointer fields. Heap iteration code relies on them 6347 // Layout of pointer fields. Heap iteration code relies on them
6239 // being continuously allocated. 6348 // being continuously allocated.
6240 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset; 6349 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset;
6241 static const int kPointerFieldsEndOffset = kSize; 6350 static const int kPointerFieldsEndOffset = kSize;
6242 6351
6243 // Byte offsets within kInstanceSizesOffset. 6352 // Byte offsets within kInstanceSizesOffset.
6244 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; 6353 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
6302 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, 6411 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset,
6303 kPointerFieldsEndOffset, 6412 kPointerFieldsEndOffset,
6304 kSize> BodyDescriptor; 6413 kSize> BodyDescriptor;
6305 6414
6306 // Compares this map to another to see if they describe equivalent objects. 6415 // 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 6416 // If |mode| is set to CLEAR_INOBJECT_PROPERTIES, |other| is treated as if
6308 // it had exactly zero inobject properties. 6417 // it had exactly zero inobject properties.
6309 // The "shared" flags of both this map and |other| are ignored. 6418 // The "shared" flags of both this map and |other| are ignored.
6310 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); 6419 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode);
6311 6420
6421 // Returns true if given field is unboxed double.
6422 inline bool IsUnboxedDoubleField(FieldIndex index);
6423
6312 private: 6424 private:
6313 static void ConnectElementsTransition(Handle<Map> parent, Handle<Map> child); 6425 static void ConnectElementsTransition(Handle<Map> parent, Handle<Map> child);
6314 static void ConnectTransition(Handle<Map> parent, Handle<Map> child, 6426 static void ConnectTransition(Handle<Map> parent, Handle<Map> child,
6315 Handle<Name> name, SimpleTransitionFlag flag); 6427 Handle<Name> name, SimpleTransitionFlag flag);
6316 6428
6317 bool EquivalentToForTransition(Map* other); 6429 bool EquivalentToForTransition(Map* other);
6318 static Handle<Map> RawCopy(Handle<Map> map, int instance_size); 6430 static Handle<Map> RawCopy(Handle<Map> map, int instance_size);
6319 static Handle<Map> ShareDescriptor(Handle<Map> map, 6431 static Handle<Map> ShareDescriptor(Handle<Map> map,
6320 Handle<DescriptorArray> descriptors, 6432 Handle<DescriptorArray> descriptors,
6321 Descriptor* descriptor); 6433 Descriptor* descriptor);
6322 static Handle<Map> CopyInstallDescriptors( 6434 static Handle<Map> CopyInstallDescriptors(
6323 Handle<Map> map, 6435 Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors,
6324 int new_descriptor, 6436 Handle<LayoutDescriptor> layout_descriptor);
6325 Handle<DescriptorArray> descriptors);
6326 static Handle<Map> CopyAddDescriptor(Handle<Map> map, 6437 static Handle<Map> CopyAddDescriptor(Handle<Map> map,
6327 Descriptor* descriptor, 6438 Descriptor* descriptor,
6328 TransitionFlag flag); 6439 TransitionFlag flag);
6329 static Handle<Map> CopyReplaceDescriptors( 6440 static Handle<Map> CopyReplaceDescriptors(
6330 Handle<Map> map, 6441 Handle<Map> map, Handle<DescriptorArray> descriptors,
6331 Handle<DescriptorArray> descriptors, 6442 Handle<LayoutDescriptor> layout_descriptor, TransitionFlag flag,
6332 TransitionFlag flag,
6333 MaybeHandle<Name> maybe_name, 6443 MaybeHandle<Name> maybe_name,
6334 SimpleTransitionFlag simple_flag = FULL_TRANSITION); 6444 SimpleTransitionFlag simple_flag = FULL_TRANSITION);
6335 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map, 6445 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map,
6336 Handle<DescriptorArray> descriptors, 6446 Handle<DescriptorArray> descriptors,
6337 Descriptor* descriptor, 6447 Descriptor* descriptor,
6338 int index, 6448 int index,
6339 TransitionFlag flag); 6449 TransitionFlag flag);
6340 6450
6341 static Handle<Map> CopyNormalized(Handle<Map> map, 6451 static Handle<Map> CopyNormalized(Handle<Map> map,
6342 PropertyNormalizationMode mode); 6452 PropertyNormalizationMode mode);
6343 6453
6344 // Fires when the layout of an object with a leaf map changes. 6454 // Fires when the layout of an object with a leaf map changes.
6345 // This includes adding transitions to the leaf map or changing 6455 // This includes adding transitions to the leaf map or changing
6346 // the descriptor array. 6456 // the descriptor array.
6347 inline void NotifyLeafMapLayoutChange(); 6457 inline void NotifyLeafMapLayoutChange();
6348 6458
6349 static Handle<Map> TransitionElementsToSlow(Handle<Map> object, 6459 static Handle<Map> TransitionElementsToSlow(Handle<Map> object,
6350 ElementsKind to_kind); 6460 ElementsKind to_kind);
6351 6461
6352 // Zaps the contents of backing data structures. Note that the 6462 // Zaps the contents of backing data structures. Note that the
6353 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects 6463 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects
6354 // holding weak references when incremental marking is used, because it also 6464 // holding weak references when incremental marking is used, because it also
6355 // iterates over objects that are otherwise unreachable. 6465 // iterates over objects that are otherwise unreachable.
6356 // In general we only want to call these functions in release mode when 6466 // In general we only want to call these functions in release mode when
6357 // heap verification is turned on. 6467 // heap verification is turned on.
6358 void ZapPrototypeTransitions(); 6468 void ZapPrototypeTransitions();
6359 void ZapTransitions(); 6469 void ZapTransitions();
6360 6470
6361 void DeprecateTransitionTree(); 6471 void DeprecateTransitionTree();
6362 void DeprecateTarget(Name* key, DescriptorArray* new_descriptors); 6472 void DeprecateTarget(Handle<Name> key,
6473 Handle<DescriptorArray> new_descriptors,
6474 Handle<LayoutDescriptor> new_layout_descriptor);
6363 6475
6364 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors); 6476 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors);
6365 6477
6366 void UpdateFieldType(int descriptor_number, Handle<Name> name, 6478 void UpdateFieldType(int descriptor_number, Handle<Name> name,
6367 Handle<HeapType> new_type); 6479 Handle<HeapType> new_type);
6368 6480
6369 void PrintGeneralization(FILE* file, 6481 void PrintGeneralization(FILE* file,
6370 const char* reason, 6482 const char* reason,
6371 int modify_index, 6483 int modify_index,
6372 int split, 6484 int split,
(...skipping 10 matching lines...) Expand all
6383 6495
6384 static Handle<Map> GetPrototypeTransition(Handle<Map> map, 6496 static Handle<Map> GetPrototypeTransition(Handle<Map> map,
6385 Handle<Object> prototype); 6497 Handle<Object> prototype);
6386 static Handle<Map> PutPrototypeTransition(Handle<Map> map, 6498 static Handle<Map> PutPrototypeTransition(Handle<Map> map,
6387 Handle<Object> prototype, 6499 Handle<Object> prototype,
6388 Handle<Map> target_map); 6500 Handle<Map> target_map);
6389 6501
6390 static const int kFastPropertiesSoftLimit = 12; 6502 static const int kFastPropertiesSoftLimit = 12;
6391 static const int kMaxFastProperties = 128; 6503 static const int kMaxFastProperties = 128;
6392 6504
6505 friend class TestAccessor;
6393 DISALLOW_IMPLICIT_CONSTRUCTORS(Map); 6506 DISALLOW_IMPLICIT_CONSTRUCTORS(Map);
6394 }; 6507 };
6395 6508
6396 6509
6397 // An abstract superclass, a marker class really, for simple structure classes. 6510 // An abstract superclass, a marker class really, for simple structure classes.
6398 // It doesn't carry much functionality but allows struct classes to be 6511 // It doesn't carry much functionality but allows struct classes to be
6399 // identified in the type system. 6512 // identified in the type system.
6400 class Struct: public HeapObject { 6513 class Struct: public HeapObject {
6401 public: 6514 public:
6402 inline void InitializeBody(int object_size); 6515 inline void InitializeBody(int object_size);
(...skipping 4502 matching lines...) Expand 10 before | Expand all | Expand 10 after
10905 static inline int set(int value, int bit_position, bool v) { 11018 static inline int set(int value, int bit_position, bool v) {
10906 if (v) { 11019 if (v) {
10907 value |= (1 << bit_position); 11020 value |= (1 << bit_position);
10908 } else { 11021 } else {
10909 value &= ~(1 << bit_position); 11022 value &= ~(1 << bit_position);
10910 } 11023 }
10911 return value; 11024 return value;
10912 } 11025 }
10913 }; 11026 };
10914 11027
11028
11029 // InobjectPropertiesHelper is a helper class for querying layout descriptor
11030 // about whether the field at given offset is tagged or not.
11031 class InobjectPropertiesHelper {
11032 public:
11033 inline explicit InobjectPropertiesHelper(Map* map);
11034
11035 bool all_fields_tagged() { return all_fields_tagged_; }
11036 inline bool IsTagged(int offset_in_bytes);
11037
11038 private:
11039 bool all_fields_tagged_;
11040 int header_size_;
11041 int inobject_properties_count_;
11042 LayoutDescriptor* layout_descriptor_;
11043 };
10915 } } // namespace v8::internal 11044 } } // namespace v8::internal
10916 11045
10917 #endif // V8_OBJECTS_H_ 11046 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698