Index: src/serialize.cc |
diff --git a/src/serialize.cc b/src/serialize.cc |
index 8222ff66d85cfb11cc542ff6c0b6e850303ccdff..bcc168ffa7ce1e5a606d493e748be6f483ff63f7 100644 |
--- a/src/serialize.cc |
+++ b/src/serialize.cc |
@@ -1657,14 +1657,17 @@ void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space, |
} |
back_reference = serializer_->AllocateLargeObject(size); |
} else { |
+ bool needs_double_align = false; |
if (object_->NeedsToEnsureDoubleAlignment()) { |
// Add wriggle room for double alignment padding. |
back_reference = serializer_->Allocate(space, size + kPointerSize); |
- sink_->PutInt(kDoubleAlignmentSentinel, "DoubleAlignSentinel"); |
+ needs_double_align = true; |
} else { |
back_reference = serializer_->Allocate(space, size); |
} |
sink_->Put(kNewObject + reference_representation_ + space, "NewObject"); |
Yang
2014/12/10 20:47:58
How about we simply put this line (outputting the
Slava Chigrin
2014/12/11 09:16:40
I am afraid this will not work - Serializer::Alloc
|
+ if (needs_double_align) |
Slava Chigrin
2014/12/10 18:13:58
Deserializer::ReadObject expects DoubleAlignmentSe
Yang
2014/12/10 20:45:48
Thanks for catching this! I guess I got confused w
|
+ sink_->PutInt(kDoubleAlignmentSentinel, "DoubleAlignSentinel"); |
int encoded_size = size >> kObjectAlignmentBits; |
DCHECK_NE(kDoubleAlignmentSentinel, encoded_size); |
sink_->PutInt(encoded_size, "ObjectSizeInWords"); |