| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #ifndef VM_SNAPSHOT_H_ | 5 #ifndef VM_SNAPSHOT_H_ |
| 6 #define VM_SNAPSHOT_H_ | 6 #define VM_SNAPSHOT_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/bitfield.h" | 10 #include "vm/bitfield.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 kIsNotDeserialized = 1, | 93 kIsNotDeserialized = 1, |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 | 96 |
| 97 enum SerializeState { | 97 enum SerializeState { |
| 98 kIsSerialized = 0, | 98 kIsSerialized = 0, |
| 99 kIsNotSerialized = 1, | 99 kIsNotSerialized = 1, |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 | 102 |
| 103 #define HEAP_SPACE(kind) (kind == Snapshot::kMessage) ? Heap::kNew : Heap::kOld |
| 104 |
| 105 |
| 103 // Structure capturing the raw snapshot. | 106 // Structure capturing the raw snapshot. |
| 104 class Snapshot { | 107 class Snapshot { |
| 105 public: | 108 public: |
| 106 enum Kind { | 109 enum Kind { |
| 107 kFull = 0, // Full snapshot of the current dart heap. | 110 kFull = 0, // Full snapshot of the current dart heap. |
| 108 kScript, // A partial snapshot of only the application script. | 111 kScript, // A partial snapshot of only the application script. |
| 109 kMessage, // A partial snapshot used only for isolate messaging. | 112 kMessage, // A partial snapshot used only for isolate messaging. |
| 110 }; | 113 }; |
| 111 | 114 |
| 112 static const int kHeaderSize = 2 * sizeof(int32_t); | 115 static const int kHeaderSize = 2 * sizeof(int32_t); |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 private: | 516 private: |
| 514 SnapshotWriter* writer_; | 517 SnapshotWriter* writer_; |
| 515 bool as_references_; | 518 bool as_references_; |
| 516 | 519 |
| 517 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 520 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
| 518 }; | 521 }; |
| 519 | 522 |
| 520 } // namespace dart | 523 } // namespace dart |
| 521 | 524 |
| 522 #endif // VM_SNAPSHOT_H_ | 525 #endif // VM_SNAPSHOT_H_ |
| OLD | NEW |