Commit d439296e authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

Revert "[cleanup] Cleanup handling of padding field in Map"

This reverts commit 6f763280.

Reason for revert: speculative revert for MSAN failure:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/25398

Original change's description:
> [cleanup] Cleanup handling of padding field in Map
> 
> Bug: v8:8834
> Change-Id: Iae9cbcccb8747298c5680ac1e865efebee85acec
> Reviewed-on: https://chromium-review.googlesource.com/c/1480385
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59774}

TBR=ulan@chromium.org,ishell@chromium.org,verwaest@chromium.org

Change-Id: Icf42e4566382c8539c8d7fb709a91bf0c6353858
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8834
Reviewed-on: https://chromium-review.googlesource.com/c/1481025Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59776}
parent 6c22ae69
......@@ -2040,7 +2040,6 @@ Map Factory::InitializeMap(Map map, InstanceType type, int instance_size,
Map::OwnsDescriptorsBit::encode(true) |
Map::ConstructionCounterBits::encode(Map::kNoSlackTracking);
map->set_bit_field3(bit_field3);
map->clear_padding();
map->set_elements_kind(elements_kind);
map->set_new_target_is_base(true);
isolate()->counters()->maps_created()->Increment();
......
......@@ -618,6 +618,9 @@ void Map::InitializeDescriptors(Isolate* isolate, DescriptorArray descriptors,
}
void Map::set_bit_field3(uint32_t bits) {
if (kInt32Size != kTaggedSize) {
RELAXED_WRITE_UINT32_FIELD(*this, kBitField3Offset + kInt32Size, 0);
}
RELAXED_WRITE_UINT32_FIELD(*this, kBitField3Offset, bits);
}
......@@ -625,13 +628,6 @@ uint32_t Map::bit_field3() const {
return RELAXED_READ_UINT32_FIELD(*this, kBitField3Offset);
}
void Map::clear_padding() {
if (FIELD_SIZE(kOptionalPaddingOffset) == 0) return;
DCHECK_EQ(4, FIELD_SIZE(kOptionalPaddingOffset));
memset(reinterpret_cast<void*>(address() + kOptionalPaddingOffset), 0,
FIELD_SIZE(kOptionalPaddingOffset));
}
LayoutDescriptor Map::GetLayoutDescriptor() const {
return FLAG_unbox_double_fields ? layout_descriptor()
: LayoutDescriptor::FastPointerLayout();
......
......@@ -275,10 +275,6 @@ class Map : public HeapObject {
//
DECL_PRIMITIVE_ACCESSORS(bit_field3, uint32_t)
// Clear uninitialized padding space. This ensures that the snapshot content
// is deterministic. Depending on the V8 build mode there could be no padding.
V8_INLINE void clear_padding();
// Bit positions for |bit_field3|.
#define MAP_BIT_FIELD3_FIELDS(V, _) \
V(EnumLengthBits, int, kDescriptorIndexBitCount, _) \
......@@ -827,29 +823,29 @@ class Map : public HeapObject {
static const int kMaxPreAllocatedPropertyFields = 255;
// Layout description.
#define MAP_FIELDS(V) \
/* Raw data fields. */ \
V(kInstanceSizeInWordsOffset, kUInt8Size) \
V(kInObjectPropertiesStartOrConstructorFunctionIndexOffset, kUInt8Size) \
V(kUsedOrUnusedInstanceSizeInWordsOffset, kUInt8Size) \
V(kVisitorIdOffset, kUInt8Size) \
V(kInstanceTypeOffset, kUInt16Size) \
V(kBitFieldOffset, kUInt8Size) \
V(kBitField2Offset, kUInt8Size) \
V(kBitField3Offset, kUInt32Size) \
/* Adds padding to make tagged fields kTaggedSize-aligned. */ \
V(kOptionalPaddingOffset, OBJECT_POINTER_PADDING(kOptionalPaddingOffset)) \
/* Pointer fields. */ \
V(kPointerFieldsBeginOffset, 0) \
V(kPrototypeOffset, kTaggedSize) \
V(kConstructorOrBackPointerOffset, kTaggedSize) \
V(kTransitionsOrPrototypeInfoOffset, kTaggedSize) \
V(kDescriptorsOffset, kTaggedSize) \
V(kLayoutDescriptorOffset, FLAG_unbox_double_fields ? kTaggedSize : 0) \
V(kDependentCodeOffset, kTaggedSize) \
V(kPrototypeValidityCellOffset, kTaggedSize) \
V(kPointerFieldsEndOffset, 0) \
/* Total size. */ \
#define MAP_FIELDS(V) \
/* Raw data fields. */ \
V(kInstanceSizeInWordsOffset, kUInt8Size) \
V(kInObjectPropertiesStartOrConstructorFunctionIndexOffset, kUInt8Size) \
V(kUsedOrUnusedInstanceSizeInWordsOffset, kUInt8Size) \
V(kVisitorIdOffset, kUInt8Size) \
V(kInstanceTypeOffset, kUInt16Size) \
V(kBitFieldOffset, kUInt8Size) \
V(kBitField2Offset, kUInt8Size) \
V(kBitField3Offset, kUInt32Size) \
V(k64BitArchPaddingOffset, \
kSystemPointerSize == kUInt32Size ? 0 : kUInt32Size) \
/* Pointer fields. */ \
V(kPointerFieldsBeginOffset, 0) \
V(kPrototypeOffset, kTaggedSize) \
V(kConstructorOrBackPointerOffset, kTaggedSize) \
V(kTransitionsOrPrototypeInfoOffset, kTaggedSize) \
V(kDescriptorsOffset, kTaggedSize) \
V(kLayoutDescriptorOffset, FLAG_unbox_double_fields ? kTaggedSize : 0) \
V(kDependentCodeOffset, kTaggedSize) \
V(kPrototypeValidityCellOffset, kTaggedSize) \
V(kPointerFieldsEndOffset, 0) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, MAP_FIELDS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment