| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 static bool IsObjectStoreClassId(intptr_t index) { | 27 static bool IsObjectStoreClassId(intptr_t index) { |
| 28 // Check if this is a class which is stored in the object store. | 28 // Check if this is a class which is stored in the object store. |
| 29 return (index >= ObjectStore::kObjectClass && index < ObjectStore::kMaxId); | 29 return (index >= ObjectStore::kObjectClass && index < ObjectStore::kMaxId); |
| 30 } | 30 } |
| 31 | 31 |
| 32 | 32 |
| 33 static bool IsObjectStoreTypeId(intptr_t index) { | 33 static bool IsObjectStoreTypeId(intptr_t index) { |
| 34 // Check if this is a type which is stored in the object store. | 34 // Check if this is a type which is stored in the object store. |
| 35 return (index >= ObjectStore::kObjectType && | 35 return (index >= ObjectStore::kObjectType && |
| 36 index <= ObjectStore::kBoolInterface); | 36 index <= ObjectStore::kListInterface); |
| 37 } | 37 } |
| 38 | 38 |
| 39 | 39 |
| 40 // TODO(5411462): Temporary setup of snapshot for testing purposes, | 40 // TODO(5411462): Temporary setup of snapshot for testing purposes, |
| 41 // the actual creation of a snapshot maybe done differently. | 41 // the actual creation of a snapshot maybe done differently. |
| 42 const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) { | 42 const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) { |
| 43 ASSERT(raw_memory != NULL); | 43 ASSERT(raw_memory != NULL); |
| 44 ASSERT(kHeaderSize == sizeof(Snapshot)); | 44 ASSERT(kHeaderSize == sizeof(Snapshot)); |
| 45 ASSERT(kLengthIndex == length_offset()); | 45 ASSERT(kLengthIndex == length_offset()); |
| 46 ASSERT((kSnapshotFlagIndex * sizeof(int32_t)) == full_snapshot_offset()); | 46 ASSERT((kSnapshotFlagIndex * sizeof(int32_t)) == full_snapshot_offset()); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 427 |
| 428 | 428 |
| 429 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { | 429 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { |
| 430 for (RawObject** current = first; current <= last; current++) { | 430 for (RawObject** current = first; current <= last; current++) { |
| 431 RawObject* raw_obj = *current; | 431 RawObject* raw_obj = *current; |
| 432 writer_->WriteObject(raw_obj); | 432 writer_->WriteObject(raw_obj); |
| 433 } | 433 } |
| 434 } | 434 } |
| 435 | 435 |
| 436 } // namespace dart | 436 } // namespace dart |
| OLD | NEW |