Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1084)

Unified Diff: src/serialize.cc

Issue 793753002: Fix crash in V8 during serializing objects requiring alignment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698