Index: src/snapshot/serializer.cc |
diff --git a/src/snapshot/serializer.cc b/src/snapshot/serializer.cc |
index 94124a789d24a759017a200985202c7834fd3901..9ccfaac3f734d537df21255a29c4cadb9afa3e22 100644 |
--- a/src/snapshot/serializer.cc |
+++ b/src/snapshot/serializer.cc |
@@ -96,20 +96,10 @@ void Serializer::SerializeDeferredObjects() { |
sink_->Put(kSynchronize, "Finished with deferred objects"); |
} |
-bool Serializer::ShouldBeSkipped(Object** current) { |
- Object** roots = isolate()->heap()->roots_array_start(); |
Michael Starzinger
2016/03/17 12:27:29
Woot! I love this, this was one of the last remain
|
- return current == &roots[Heap::kStoreBufferTopRootIndex] || |
- current == &roots[Heap::kStackLimitRootIndex] || |
- current == &roots[Heap::kRealStackLimitRootIndex]; |
-} |
- |
void Serializer::VisitPointers(Object** start, Object** end) { |
for (Object** current = start; current < end; current++) { |
if ((*current)->IsSmi()) { |
- sink_->Put(kOnePointerRawData, "Smi"); |
- for (int i = 0; i < kPointerSize; i++) { |
- sink_->Put(reinterpret_cast<byte*>(current)[i], "Byte"); |
- } |
+ PutSmi(Smi::cast(*current)); |
} else { |
SerializeObject(HeapObject::cast(*current), kPlain, kStartOfObject, 0); |
} |
@@ -240,6 +230,12 @@ void Serializer::PutRoot(int root_index, HeapObject* object, |
} |
} |
+void Serializer::PutSmi(Smi* smi) { |
+ sink_->Put(kOnePointerRawData, "Smi"); |
+ byte* bytes = reinterpret_cast<byte*>(&smi); |
+ for (int i = 0; i < kPointerSize; i++) sink_->Put(bytes[i], "Byte"); |
+} |
+ |
void Serializer::PutBackReference(HeapObject* object, BackReference reference) { |
DCHECK(BackReferenceIsAlreadyAllocated(reference)); |
sink_->PutInt(reference.reference(), "BackRefValue"); |
@@ -308,6 +304,13 @@ Code* Serializer::CopyCode(Code* code) { |
return Code::cast(HeapObject::FromAddress(&code_buffer_.first())); |
} |
+bool Serializer::HasNotExceededFirstPageOfEachSpace() { |
+ for (int i = 0; i < kNumberOfPreallocatedSpaces; i++) { |
+ if (!completed_chunks_[i].is_empty()) return false; |
+ } |
+ return true; |
+} |
+ |
void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space, |
int size, Map* map) { |
if (serializer_->code_address_map_) { |