| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return static_cast<Kind>(ReadUnaligned(&unaligned_kind_)); | 180 return static_cast<Kind>(ReadUnaligned(&unaligned_kind_)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 static bool IsFull(Kind kind) { | 183 static bool IsFull(Kind kind) { |
| 184 return (kind == kCore) || (kind == kAppWithJIT) || (kind == kAppNoJIT); | 184 return (kind == kCore) || (kind == kAppWithJIT) || (kind == kAppNoJIT); |
| 185 } | 185 } |
| 186 static bool IncludesCode(Kind kind) { | 186 static bool IncludesCode(Kind kind) { |
| 187 return (kind == kAppWithJIT) || (kind == kAppNoJIT); | 187 return (kind == kAppWithJIT) || (kind == kAppNoJIT); |
| 188 } | 188 } |
| 189 | 189 |
| 190 bool IsMessageSnapshot() const { return kind() == kMessage; } | |
| 191 bool IsScriptSnapshot() const { return kind() == kScript; } | |
| 192 bool IsCoreSnapshot() const { return kind() == kCore; } | |
| 193 bool IsAppSnapshotWithJIT() const { return kind() == kAppWithJIT; } | |
| 194 bool IsAppSnapshotNoJIT() const { return kind() == kAppNoJIT; } | |
| 195 uint8_t* Addr() { return reinterpret_cast<uint8_t*>(this); } | 190 uint8_t* Addr() { return reinterpret_cast<uint8_t*>(this); } |
| 196 | 191 |
| 197 static intptr_t length_offset() { | 192 static intptr_t length_offset() { |
| 198 return OFFSET_OF(Snapshot, unaligned_length_); | 193 return OFFSET_OF(Snapshot, unaligned_length_); |
| 199 } | 194 } |
| 200 static intptr_t kind_offset() { | 195 static intptr_t kind_offset() { |
| 201 return OFFSET_OF(Snapshot, unaligned_kind_); | 196 return OFFSET_OF(Snapshot, unaligned_kind_); |
| 202 } | 197 } |
| 203 | 198 |
| 204 private: | 199 private: |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 private: | 1210 private: |
| 1216 SnapshotWriter* writer_; | 1211 SnapshotWriter* writer_; |
| 1217 bool as_references_; | 1212 bool as_references_; |
| 1218 | 1213 |
| 1219 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 1214 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
| 1220 }; | 1215 }; |
| 1221 | 1216 |
| 1222 } // namespace dart | 1217 } // namespace dart |
| 1223 | 1218 |
| 1224 #endif // VM_SNAPSHOT_H_ | 1219 #endif // VM_SNAPSHOT_H_ |
| OLD | NEW |