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

Unified Diff: src/snapshot/serialize.cc

Issue 1440983002: Serializer: attach alignment to deferred objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « src/snapshot/serialize.h ('k') | test/mjsunit/regress/regress-crbug-523919.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « src/snapshot/serialize.h ('k') | test/mjsunit/regress/regress-crbug-523919.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698