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

Unified Diff: vm/raw_object_snapshot.cc

Issue 8868001: Add additional asserts in the snapshot writer/reader code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/raw_object_snapshot.cc
===================================================================
--- vm/raw_object_snapshot.cc (revision 2199)
+++ vm/raw_object_snapshot.cc (working copy)
@@ -248,6 +248,7 @@
intptr_t object_id,
Snapshot::Kind kind) {
ASSERT(reader != NULL);
+ ASSERT(kind == Snapshot::kMessage);
// Allocate instantiated type object.
InstantiatedType& instantiated_type =
@@ -270,6 +271,7 @@
intptr_t object_id,
Snapshot::Kind kind) {
ASSERT(writer != NULL);
+ ASSERT(kind == Snapshot::kMessage);
SnapshotWriterVisitor visitor(writer);
// Write out the serialization header value for this object.
@@ -351,6 +353,7 @@
intptr_t object_id,
Snapshot::Kind kind) {
ASSERT(reader != NULL);
+ ASSERT(kind == Snapshot::kMessage);
// Allocate instantiated types object.
InstantiatedTypeArguments& instantiated_type_arguments =
@@ -373,6 +376,7 @@
intptr_t object_id,
Snapshot::Kind kind) {
ASSERT(writer != NULL);
+ ASSERT(kind == Snapshot::kMessage);
SnapshotWriterVisitor visitor(writer);
// Write out the serialization header value for this object.
@@ -798,6 +802,7 @@
intptr_t object_id,
Snapshot::Kind kind) {
ASSERT(reader != NULL);
+ ASSERT(kind == Snapshot::kMessage);
// Allocate context scope object.
intptr_t num_vars = reader->Read<intptr_t>();
@@ -820,6 +825,7 @@
intptr_t object_id,
Snapshot::Kind kind) {
ASSERT(writer != NULL);
+ ASSERT(kind == Snapshot::kMessage);
SnapshotWriterVisitor visitor(writer);
// Write out the serialization header value for this object.
@@ -1344,6 +1350,7 @@
intptr_t object_id,
Snapshot::Kind kind) {
ASSERT(reader != NULL);
+ ASSERT(kind == Snapshot::kMessage);
// Read the length so that we can determine instance size to allocate.
RawSmi* smi_len = GetSmi(reader->Read<intptr_t>());
@@ -1372,6 +1379,7 @@
intptr_t object_id,
Snapshot::Kind kind) {
ASSERT(writer != NULL);
+ ASSERT(kind == Snapshot::kMessage);
// Write out the serialization header value for this object.
writer->WriteObjectHeader(kInlined, object_id);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698