| 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 DISALLOW_COPY_AND_ASSIGN(Node); | 619 DISALLOW_COPY_AND_ASSIGN(Node); |
| 620 }; | 620 }; |
| 621 | 621 |
| 622 Node* NodeForObjectId(intptr_t object_id) const { | 622 Node* NodeForObjectId(intptr_t object_id) const { |
| 623 return nodes_[object_id - first_object_id_]; | 623 return nodes_[object_id - first_object_id_]; |
| 624 } | 624 } |
| 625 | 625 |
| 626 // Returns the id for the added object. | 626 // Returns the id for the added object. |
| 627 intptr_t MarkAndAddObject(RawObject* raw, SerializeState state); | 627 intptr_t MarkAndAddObject(RawObject* raw, SerializeState state); |
| 628 | 628 |
| 629 // Returns the id for the added object without marking it. |
| 630 intptr_t AddObject(RawObject* raw, SerializeState state); |
| 631 |
| 632 // Returns the id for the object it it exists in the list. |
| 633 intptr_t FindObject(RawObject* raw); |
| 634 |
| 629 // Exhaustively processes all unserialized objects in this list. 'writer' may | 635 // Exhaustively processes all unserialized objects in this list. 'writer' may |
| 630 // concurrently add more objects. | 636 // concurrently add more objects. |
| 631 void SerializeAll(ObjectVisitor* writer); | 637 void SerializeAll(ObjectVisitor* writer); |
| 632 | 638 |
| 633 // Restores the tags of all objects in this list. | 639 // Restores the tags of all objects in this list. |
| 634 void UnmarkAll() const; | 640 void UnmarkAll() const; |
| 635 | 641 |
| 636 private: | 642 private: |
| 637 intptr_t first_object_id() const { return first_object_id_; } | 643 intptr_t first_object_id() const { return first_object_id_; } |
| 638 intptr_t next_object_id() const { return nodes_.length() + first_object_id_; } | 644 intptr_t next_object_id() const { return nodes_.length() + first_object_id_; } |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 private: | 868 private: |
| 863 SnapshotWriter* writer_; | 869 SnapshotWriter* writer_; |
| 864 bool as_references_; | 870 bool as_references_; |
| 865 | 871 |
| 866 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 872 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
| 867 }; | 873 }; |
| 868 | 874 |
| 869 } // namespace dart | 875 } // namespace dart |
| 870 | 876 |
| 871 #endif // VM_SNAPSHOT_H_ | 877 #endif // VM_SNAPSHOT_H_ |
| OLD | NEW |