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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 kObjectId = 0x3, | 114 kObjectId = 0x3, |
115 }; | 115 }; |
116 static const int8_t kHeaderTagBits = 2; | 116 static const int8_t kHeaderTagBits = 2; |
117 static const int8_t kObjectIdBits = (kBitsPerInt32 - (kHeaderTagBits + 1)); | 117 static const int8_t kObjectIdBits = (kBitsPerInt32 - (kHeaderTagBits + 1)); |
118 static const intptr_t kMaxObjectId = (kMaxUint32 >> (kHeaderTagBits + 1)); | 118 static const intptr_t kMaxObjectId = (kMaxUint32 >> (kHeaderTagBits + 1)); |
119 static const bool kAsReference = true; | 119 static const bool kAsReference = true; |
120 static const bool kAsInlinedObject = false; | 120 static const bool kAsInlinedObject = false; |
121 static const intptr_t kInvalidPatchIndex = -1; | 121 static const intptr_t kInvalidPatchIndex = -1; |
122 | 122 |
123 | 123 |
124 class SerializedHeaderTag : public BitField<enum SerializedHeaderType, | 124 class SerializedHeaderTag : |
125 0, | 125 public BitField<intptr_t, enum SerializedHeaderType, 0, kHeaderTagBits> {}; |
126 kHeaderTagBits> { | |
127 }; | |
128 | 126 |
129 | 127 |
130 class SerializedHeaderData : public BitField<intptr_t, | 128 class SerializedHeaderData : |
131 kHeaderTagBits, | 129 public BitField<intptr_t, intptr_t, kHeaderTagBits, kObjectIdBits> {}; |
132 kObjectIdBits> { | |
133 }; | |
134 | 130 |
135 | 131 |
136 enum DeserializeState { | 132 enum DeserializeState { |
137 kIsDeserialized = 0, | 133 kIsDeserialized = 0, |
138 kIsNotDeserialized = 1, | 134 kIsNotDeserialized = 1, |
139 }; | 135 }; |
140 | 136 |
141 | 137 |
142 enum SerializeState { | 138 enum SerializeState { |
143 kIsSerialized = 0, | 139 kIsSerialized = 0, |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 private: | 1135 private: |
1140 SnapshotWriter* writer_; | 1136 SnapshotWriter* writer_; |
1141 bool as_references_; | 1137 bool as_references_; |
1142 | 1138 |
1143 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 1139 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
1144 }; | 1140 }; |
1145 | 1141 |
1146 } // namespace dart | 1142 } // namespace dart |
1147 | 1143 |
1148 #endif // VM_SNAPSHOT_H_ | 1144 #endif // VM_SNAPSHOT_H_ |
OLD | NEW |