Index: src/snapshot/serialize.cc |
diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc |
index c0dd30919259520657da1014f9ec3a1c1fb17f5d..4ccadd256d8cf961da126706717813b92a77f126 100644 |
--- a/src/snapshot/serialize.cc |
+++ b/src/snapshot/serialize.cc |
@@ -636,18 +636,27 @@ void Deserializer::VisitPointers(Object** start, Object** end) { |
void Deserializer::DeserializeDeferredObjects() { |
for (int code = source_.Get(); code != kSynchronize; code = source_.Get()) { |
- int space = code & kSpaceMask; |
- DCHECK(space <= kNumberOfSpaces); |
- DCHECK(code - space == kNewObject); |
- HeapObject* object = GetBackReferencedObject(space); |
- int size = source_.GetInt() << kPointerSizeLog2; |
- Address obj_address = object->address(); |
- Object** start = reinterpret_cast<Object**>(obj_address + kPointerSize); |
- Object** end = reinterpret_cast<Object**>(obj_address + size); |
- bool filled = ReadData(start, end, space, obj_address); |
- CHECK(filled); |
- DCHECK(CanBeDeferred(object)); |
- PostProcessNewObject(object, space); |
+ switch (code) { |
+ case kAlignmentPrefix: |
+ case kAlignmentPrefix + 1: |
+ case kAlignmentPrefix + 2: |
+ SetAlignment(code); |
+ break; |
+ default: { |
+ int space = code & kSpaceMask; |
+ DCHECK(space <= kNumberOfSpaces); |
+ DCHECK(code - space == kNewObject); |
+ HeapObject* object = GetBackReferencedObject(space); |
+ int size = source_.GetInt() << kPointerSizeLog2; |
+ Address obj_address = object->address(); |
+ Object** start = reinterpret_cast<Object**>(obj_address + kPointerSize); |
+ Object** end = reinterpret_cast<Object**>(obj_address + size); |
+ bool filled = ReadData(start, end, space, obj_address); |
+ CHECK(filled); |
+ DCHECK(CanBeDeferred(object)); |
+ PostProcessNewObject(object, space); |
+ } |
+ } |
} |
} |
@@ -1188,12 +1197,9 @@ bool Deserializer::ReadData(Object** current, Object** limit, int source_space, |
case kAlignmentPrefix: |
case kAlignmentPrefix + 1: |
- case kAlignmentPrefix + 2: { |
- DCHECK_EQ(kWordAligned, next_alignment_); |
- next_alignment_ = |
- static_cast<AllocationAlignment>(data - (kAlignmentPrefix - 1)); |
+ case kAlignmentPrefix + 2: |
+ SetAlignment(data); |
break; |
- } |
STATIC_ASSERT(kNumberOfRootArrayConstants == Heap::kOldSpaceRoots); |
STATIC_ASSERT(kNumberOfRootArrayConstants == 32); |
@@ -2057,6 +2063,7 @@ void Serializer::ObjectSerializer::SerializeDeferred() { |
CHECK_EQ(0, bytes_processed_so_far_); |
bytes_processed_so_far_ = kPointerSize; |
+ serializer_->PutAlignmentPrefix(object_); |
sink_->Put(kNewObject + reference.space(), "deferred object"); |
serializer_->PutBackReference(object_, reference); |
sink_->PutInt(size >> kPointerSizeLog2, "deferred object size"); |