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

Unified Diff: src/snapshot/serialize.cc

Issue 1667063002: [serializer] add synchronize codes to detect mismatch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@snapshotignition
Patch Set: Created 4 years, 10 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/serialize.h ('k') | no next file » | 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 7ba1c278a0d9ae24ae39c7df1015e1d312960fdf..4d2f9590b86136ef5d01012500699223d0068a6e 100644
--- a/src/snapshot/serialize.cc
+++ b/src/snapshot/serialize.cc
@@ -643,6 +643,10 @@ void Deserializer::VisitPointers(Object** start, Object** end) {
ReadData(start, end, NEW_SPACE, NULL);
}
+void Deserializer::Synchronize(VisitorSynchronization::SyncTag tag) {
+ static const byte expected = kSynchronize;
+ CHECK_EQ(expected, source_.Get());
+}
void Deserializer::DeserializeDeferredObjects() {
for (int code = source_.Get(); code != kSynchronize; code = source_.Get()) {
@@ -1743,6 +1747,7 @@ void StartupSerializer::Synchronize(VisitorSynchronization::SyncTag tag) {
// We expect the builtins tag after builtins have been serialized.
DCHECK(!serializing_builtins_ || tag == VisitorSynchronization::kBuiltins);
serializing_builtins_ = (tag == VisitorSynchronization::kHandleScope);
+ sink_->Put(kSynchronize, "Synchronize");
}
void Serializer::PutRoot(int root_index,
« no previous file with comments | « src/snapshot/serialize.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698