Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 00cd62e818346c16b60fcddb03c6fef5d1ca200f..029e80d9bb96e075f39c14c7d9d93566fc5d4321 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -4033,12 +4033,12 @@ bool Map::has_non_instance_prototype() { |
void Map::set_function_with_prototype(bool value) { |
- set_bit_field(FunctionWithPrototype::update(bit_field(), value)); |
+ set_bit_field3(FunctionWithPrototype::update(bit_field3(), value)); |
} |
bool Map::function_with_prototype() { |
- return FunctionWithPrototype::decode(bit_field()); |
+ return FunctionWithPrototype::decode(bit_field3()); |
} |
@@ -4753,15 +4753,16 @@ ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) |
void Map::set_bit_field3(uint32_t bits) { |
- if (kInt32Size != kPointerSize) { |
- WRITE_UINT32_FIELD(this, kBitField3Offset + kInt32Size, 0); |
- } |
- WRITE_UINT32_FIELD(this, kBitField3Offset, 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() { |
- return READ_UINT32_FIELD(this, kBitField3Offset); |
+ Object* value = READ_FIELD(this, kBitField3Offset); |
+ return Smi::cast(value)->value(); |
} |