| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 static const int kHeaderSize = 2 * sizeof(int64_t); | 136 static const int kHeaderSize = 2 * sizeof(int64_t); |
| 137 static const int kLengthIndex = 0; | 137 static const int kLengthIndex = 0; |
| 138 static const int kSnapshotFlagIndex = 1; | 138 static const int kSnapshotFlagIndex = 1; |
| 139 | 139 |
| 140 static const Snapshot* SetupFromBuffer(const void* raw_memory); | 140 static const Snapshot* SetupFromBuffer(const void* raw_memory); |
| 141 | 141 |
| 142 // Getters. | 142 // Getters. |
| 143 const uint8_t* content() const { return content_; } | 143 const uint8_t* content() const { return content_; } |
| 144 int64_t length() const { return length_; } | 144 intptr_t length() const { return static_cast<intptr_t>(length_); } |
| 145 Kind kind() const { return static_cast<Kind>(kind_); } | 145 Kind kind() const { return static_cast<Kind>(kind_); } |
| 146 | 146 |
| 147 bool IsMessageSnapshot() const { return kind_ == kMessage; } | 147 bool IsMessageSnapshot() const { return kind_ == kMessage; } |
| 148 bool IsScriptSnapshot() const { return kind_ == kScript; } | 148 bool IsScriptSnapshot() const { return kind_ == kScript; } |
| 149 bool IsFullSnapshot() const { return kind_ == kFull; } | 149 bool IsFullSnapshot() const { return kind_ == kFull; } |
| 150 uint8_t* Addr() { return reinterpret_cast<uint8_t*>(this); } | 150 uint8_t* Addr() { return reinterpret_cast<uint8_t*>(this); } |
| 151 | 151 |
| 152 static intptr_t length_offset() { return OFFSET_OF(Snapshot, length_); } | 152 static intptr_t length_offset() { return OFFSET_OF(Snapshot, length_); } |
| 153 static intptr_t kind_offset() { | 153 static intptr_t kind_offset() { |
| 154 return OFFSET_OF(Snapshot, kind_); | 154 return OFFSET_OF(Snapshot, kind_); |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 private: | 702 private: |
| 703 SnapshotWriter* writer_; | 703 SnapshotWriter* writer_; |
| 704 bool as_references_; | 704 bool as_references_; |
| 705 | 705 |
| 706 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 706 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
| 707 }; | 707 }; |
| 708 | 708 |
| 709 } // namespace dart | 709 } // namespace dart |
| 710 | 710 |
| 711 #endif // VM_SNAPSHOT_H_ | 711 #endif // VM_SNAPSHOT_H_ |
| OLD | NEW |