Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index d2aadabbcf95d3acdb6409e22f6d91be7b554346..ed266436f190d18637170c15226fa180cf314fe2 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3617,6 +3617,17 @@ bool Map::is_deprecated() { |
} |
+void Map::set_migration_target(bool value) { |
+ set_bit_field3(IsMigrationTarget::update(bit_field3(), value)); |
+} |
+ |
+ |
+bool Map::is_migration_target() { |
+ if (!FLAG_track_fields) return false; |
+ return IsMigrationTarget::decode(bit_field3()); |
+} |
+ |
+ |
void Map::freeze() { |
set_bit_field3(IsFrozen::update(bit_field3(), true)); |
} |
@@ -4215,7 +4226,20 @@ void Map::InitializeDescriptors(DescriptorArray* descriptors) { |
ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) |
-SMI_ACCESSORS(Map, bit_field3, kBitField3Offset) |
+ |
+ |
+void Map::set_bit_field3(uint32_t bits) { |
+ // Ensure the upper 2 bits have the same value by sign extending it. This is |
+ // necessary to be able to use the 31st bit. |
+ int value = bits << 1; |
+ WRITE_FIELD(this, kBitField3Offset, Smi::FromInt(value >> 1)); |
+} |
+ |
+ |
+uint32_t Map::bit_field3() { |
+ Object* value = READ_FIELD(this, kBitField3Offset); |
+ return Smi::cast(value)->value(); |
+} |
void Map::ClearTransitions(Heap* heap, WriteBarrierMode mode) { |