@@ -86,7 +86,7 @@ typedef std::vector<Handle<Map>> MapHandles;
8686// +---------------+---------------------------------------------+
8787// | TaggedPointer | map - Always a pointer to the MetaMap root |
8888// +---------------+---------------------------------------------+
89- // | Int | instance_sizes (the first int field) |
89+ // | Int | The first int field |
9090// `---+----------+---------------------------------------------+
9191// | Byte | [instance_size] |
9292// +----------+---------------------------------------------+
@@ -102,10 +102,14 @@ typedef std::vector<Handle<Map>> MapHandles;
102102// +----------+---------------------------------------------+
103103// | Byte | [visitor_id] |
104104// +----+----------+---------------------------------------------+
105- // | Int | instance_attributes ( second int field) |
105+ // | Int | The second int field |
106106// `---+----------+---------------------------------------------+
107- // | Word16 | [instance_type] in low byte |
108- // | | [bit_field] in high byte |
107+ // | Byte | [instance_type] |
108+ // +----------+---------------------------------------------+
109+ // | Byte | [unused_property_fields] number of unused |
110+ // | | property fields in JSObject (for fast-mode) |
111+ // +----------+---------------------------------------------+
112+ // | Byte | [bit_field] |
109113// | | - has_non_instance_prototype (bit 0) |
110114// | | - is_callable (bit 1) |
111115// | | - has_named_interceptor (bit 2) |
@@ -119,11 +123,8 @@ typedef std::vector<Handle<Map>> MapHandles;
119123// | | - is_extensible (bit 0) |
120124// | | - is_prototype_map (bit 2) |
121125// | | - elements_kind (bits 3..7) |
122- // +----------+---------------------------------------------+
123- // | Byte | [unused_property_fields] number of unused |
124- // | | property fields in JSObject (for fast-mode) |
125126// +----+----------+---------------------------------------------+
126- // | Word | [bit_field3] |
127+ // | Int | [bit_field3] |
127128// | | - number_of_own_descriptors (bit 0..19) |
128129// | | - is_dictionary_map (bit 20) |
129130// | | - owns_descriptors (bit 21) |
@@ -136,9 +137,10 @@ typedef std::vector<Handle<Map>> MapHandles;
136137// | | - may_have_interesting_symbols (bit 28) |
137138// | | - construction_counter (bit 29..31) |
138139// | | |
139- // | | On systems with 64bit pointer types, there |
140+ // +*************************************************************+
141+ // | Int | On systems with 64bit pointer types, there |
140142// | | is an unused 32bits after bit_field3 |
141- // +---------------+--------------------------------------------- +
143+ // +************************************************************* +
142144// | TaggedPointer | [prototype] |
143145// +---------------+---------------------------------------------+
144146// | TaggedPointer | [constructor_or_backpointer] |
@@ -733,15 +735,21 @@ class Map : public HeapObject {
733735 V (kInObjectPropertiesOrConstructorFunctionIndexOffset , kUInt8Size ) \
734736 V (kUsedInstanceSizeInWordsOffset , kUInt8Size ) \
735737 V (kVisitorIdOffset , kUInt8Size ) \
736- V (kInstanceAttributesOffset , kInt32Size ) \
737- V (kBitField3Offset , kPointerSize ) \
738+ V (kInstanceTypeOffset , kUInt8Size ) \
739+ /* TODO(ulan): Free this byte after unused_property_fields are */ \
740+ /* computed using the used_instance_size_in_words() byte. */ \
741+ V (kUnusedPropertyFieldsOffset , kUInt8Size ) \
742+ V (kBitFieldOffset , kUInt8Size ) \
743+ V (kBitField2Offset , kUInt8Size ) \
744+ V (kBitField3Offset , kUInt32Size ) \
745+ V (k64BitArchPaddingOffset, kPointerSize == kUInt32Size ? 0 : kUInt32Size ) \
738746 /* Pointer fields. */ \
739747 V (kPointerFieldsBeginOffset , 0 ) \
740748 V (kPrototypeOffset , kPointerSize ) \
741749 V (kConstructorOrBackPointerOffset , kPointerSize ) \
742750 V (kTransitionsOrPrototypeInfoOffset , kPointerSize ) \
743751 V (kDescriptorsOffset , kPointerSize ) \
744- V (kLayoutDescriptorOffset , ( FLAG_unbox_double_fields ? kPointerSize : 0 )) \
752+ V (kLayoutDescriptorOffset , FLAG_unbox_double_fields ? kPointerSize : 0 ) \
745753 V (kDependentCodeOffset , kPointerSize ) \
746754 V (kWeakCellCacheOffset , kPointerSize ) \
747755 V (kPointerFieldsEndOffset , 0 ) \
@@ -751,26 +759,7 @@ class Map : public HeapObject {
751759 DEFINE_FIELD_OFFSET_CONSTANTS (HeapObject::kHeaderSize , MAP_FIELDS)
752760#undef MAP_FIELDS
753761
754- // Byte offsets within kInstanceAttributesOffset attributes.
755- #if V8_TARGET_LITTLE_ENDIAN
756- // Order instance type and bit field together such that they can be loaded
757- // together as a 16-bit word with instance type in the lower 8 bits regardless
758- // of endianess. Also provide endian-independent offset to that 16-bit word.
759- static const int kInstanceTypeOffset = kInstanceAttributesOffset + 0 ;
760- static const int kBitFieldOffset = kInstanceAttributesOffset + 1 ;
761- #else
762- static const int kBitFieldOffset = kInstanceAttributesOffset + 0 ;
763- static const int kInstanceTypeOffset = kInstanceAttributesOffset + 1 ;
764- #endif
765- static const int kInstanceTypeAndBitFieldOffset =
766- kInstanceAttributesOffset + 0 ;
767- static const int kBitField2Offset = kInstanceAttributesOffset + 2 ;
768- // TODO(ulan): Free this byte after unused_property_fields are computed using
769- // the used_instance_size_in_words() byte.
770- static const int kUnusedPropertyFieldsOffset = kInstanceAttributesOffset + 3 ;
771-
772- STATIC_ASSERT (kInstanceTypeAndBitFieldOffset ==
773- Internals::kMapInstanceTypeAndBitFieldOffset );
762+ STATIC_ASSERT (kInstanceTypeOffset == Internals::kMapInstanceTypeOffset );
774763
775764 // Bit positions for bit field.
776765 static const int kHasNonInstancePrototype = 0 ;
0 commit comments