Index: runtime/vm/raw_object_snapshot.cc |
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc |
index fcb7b0a47669edeeab5055c027d7529d6bab092d..541e8a7500eec08fb7c4b76b7e6c2f4b53b8520d 100644 |
--- a/runtime/vm/raw_object_snapshot.cc |
+++ b/runtime/vm/raw_object_snapshot.cc |
@@ -1681,15 +1681,21 @@ void RawInstance::WriteTo(SnapshotWriter* writer, |
} |
-RawMint* Mint::ReadFrom(SnapshotReader* reader, |
- intptr_t object_id, |
- intptr_t tags, |
- Snapshot::Kind kind) { |
+RawInteger* Mint::ReadFrom(SnapshotReader* reader, |
+ intptr_t object_id, |
+ intptr_t tags, |
+ Snapshot::Kind kind) { |
ASSERT(reader != NULL); |
// Read the 64 bit value for the object. |
int64_t value = reader->Read<int64_t>(); |
+ // Check if the value could potentially fit in a Smi in our current |
+ // architecture, if so return the object as a Smi. |
+ if (Smi::IsValid(value)) { |
+ return Smi::New(static_cast<intptr_t>(value)); |
+ } |
+ |
// Create a Mint object or get canonical one if it is a canonical constant. |
Mint& mint = Mint::ZoneHandle(reader->zone(), Mint::null()); |
if (kind == Snapshot::kFull) { |