| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/snapshot.h" | 5 #include "vm/snapshot.h" |
| 6 | 6 |
| 7 #include "vm/assert.h" | 7 #include "vm/assert.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 | 280 |
| 281 // Check if it is a singleton boolean false value. | 281 // Check if it is a singleton boolean false value. |
| 282 if (rawobj == object_store()->false_value()) { | 282 if (rawobj == object_store()->false_value()) { |
| 283 WriteObjectHeader(kObjectId, ObjectStore::kFalseValue); | 283 WriteObjectHeader(kObjectId, ObjectStore::kFalseValue); |
| 284 return; | 284 return; |
| 285 } | 285 } |
| 286 | 286 |
| 287 // Check if classes are not being serialized and it is preinitialized type. | 287 // Check if classes are not being serialized and it is preinitialized type. |
| 288 if (!serialize_classes_) { | 288 if (!serialize_classes_) { |
| 289 RawType* raw_type = reinterpret_cast<RawType*>(rawobj); | 289 RawParameterizedType* raw_type = |
| 290 reinterpret_cast<RawParameterizedType*>(rawobj); |
| 290 index = object_store()->GetTypeIndex(raw_type); | 291 index = object_store()->GetTypeIndex(raw_type); |
| 291 if (index != ObjectStore::kInvalidIndex) { | 292 if (index != ObjectStore::kInvalidIndex) { |
| 292 WriteObjectHeader(kObjectId, index); | 293 WriteObjectHeader(kObjectId, index); |
| 293 return; | 294 return; |
| 294 } | 295 } |
| 295 } | 296 } |
| 296 | 297 |
| 297 // Now write the object out inline in the stream. | 298 // Now write the object out inline in the stream. |
| 298 WriteInlinedObject(rawobj); | 299 WriteInlinedObject(rawobj); |
| 299 } | 300 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 428 |
| 428 | 429 |
| 429 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { | 430 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { |
| 430 for (RawObject** current = first; current <= last; current++) { | 431 for (RawObject** current = first; current <= last; current++) { |
| 431 RawObject* raw_obj = *current; | 432 RawObject* raw_obj = *current; |
| 432 writer_->WriteObject(raw_obj); | 433 writer_->WriteObject(raw_obj); |
| 433 } | 434 } |
| 434 } | 435 } |
| 435 | 436 |
| 436 } // namespace dart | 437 } // namespace dart |
| OLD | NEW |