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

Unified Diff: src/snapshot/serializer.cc

Issue 1811913002: [serializer] ensure that immortal immovable roots are correctly deserialized. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months 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/serializer.h ('k') | src/snapshot/startup-serializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_) {
« no previous file with comments | « src/snapshot/serializer.h ('k') | src/snapshot/startup-serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698