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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 } | 709 } |
710 | 710 |
711 void WriteDouble(double value) { | 711 void WriteDouble(double value) { |
712 stream_.WriteBytes(reinterpret_cast<const uint8_t*>(&value), sizeof(value)); | 712 stream_.WriteBytes(reinterpret_cast<const uint8_t*>(&value), sizeof(value)); |
713 } | 713 } |
714 | 714 |
715 protected: | 715 protected: |
716 BaseWriter(uint8_t** buffer, | 716 BaseWriter(uint8_t** buffer, |
717 ReAlloc alloc, | 717 ReAlloc alloc, |
718 intptr_t initial_size) | 718 intptr_t initial_size) |
719 : StackResource(Isolate::Current()), | 719 : StackResource(Thread::Current()), |
720 stream_(buffer, alloc, initial_size) { | 720 stream_(buffer, alloc, initial_size) { |
721 ASSERT(buffer != NULL); | 721 ASSERT(buffer != NULL); |
722 ASSERT(alloc != NULL); | 722 ASSERT(alloc != NULL); |
723 } | 723 } |
724 ~BaseWriter() { } | 724 ~BaseWriter() { } |
725 | 725 |
726 void ReserveHeader() { | 726 void ReserveHeader() { |
727 // Make room for recording snapshot buffer size. | 727 // Make room for recording snapshot buffer size. |
728 stream_.set_current(stream_.buffer() + Snapshot::kHeaderSize); | 728 stream_.set_current(stream_.buffer() + Snapshot::kHeaderSize); |
729 } | 729 } |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 private: | 1121 private: |
1122 SnapshotWriter* writer_; | 1122 SnapshotWriter* writer_; |
1123 bool as_references_; | 1123 bool as_references_; |
1124 | 1124 |
1125 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 1125 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
1126 }; | 1126 }; |
1127 | 1127 |
1128 } // namespace dart | 1128 } // namespace dart |
1129 | 1129 |
1130 #endif // VM_SNAPSHOT_H_ | 1130 #endif // VM_SNAPSHOT_H_ |
OLD | NEW |