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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 return backward_references_; | 435 return backward_references_; |
436 } | 436 } |
437 void ResetBackwardReferenceTable() { backward_references_ = NULL; } | 437 void ResetBackwardReferenceTable() { backward_references_ = NULL; } |
438 PageSpace* old_space() const { return old_space_; } | 438 PageSpace* old_space() const { return old_space_; } |
439 | 439 |
440 private: | 440 private: |
441 // Allocate uninitialized objects, this is used when reading a full snapshot. | 441 // Allocate uninitialized objects, this is used when reading a full snapshot. |
442 RawObject* AllocateUninitialized(intptr_t class_id, intptr_t size); | 442 RawObject* AllocateUninitialized(intptr_t class_id, intptr_t size); |
443 | 443 |
444 RawClass* ReadClassId(intptr_t object_id); | 444 RawClass* ReadClassId(intptr_t object_id); |
| 445 RawFunction* ReadFunctionId(intptr_t object_id); |
445 RawObject* ReadStaticImplicitClosure(intptr_t object_id, intptr_t cls_header); | 446 RawObject* ReadStaticImplicitClosure(intptr_t object_id, intptr_t cls_header); |
446 | 447 |
447 // Implementation to read an object. | 448 // Implementation to read an object. |
448 RawObject* ReadObjectImpl(bool as_reference, | 449 RawObject* ReadObjectImpl(bool as_reference, |
449 intptr_t patch_object_id = kInvalidPatchIndex, | 450 intptr_t patch_object_id = kInvalidPatchIndex, |
450 intptr_t patch_offset = 0); | 451 intptr_t patch_offset = 0); |
451 RawObject* ReadObjectImpl(intptr_t header, | 452 RawObject* ReadObjectImpl(intptr_t header, |
452 bool as_reference, | 453 bool as_reference, |
453 intptr_t patch_object_id, | 454 intptr_t patch_object_id, |
454 intptr_t patch_offset); | 455 intptr_t patch_offset); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 static intptr_t FirstObjectId(); | 870 static intptr_t FirstObjectId(); |
870 | 871 |
871 int32_t GetInstructionsId(RawInstructions* instructions) { | 872 int32_t GetInstructionsId(RawInstructions* instructions) { |
872 return instructions_writer_->GetOffsetFor(instructions); | 873 return instructions_writer_->GetOffsetFor(instructions); |
873 } | 874 } |
874 | 875 |
875 void SetInstructionsCode(RawInstructions* instructions, RawCode* code) { | 876 void SetInstructionsCode(RawInstructions* instructions, RawCode* code) { |
876 return instructions_writer_->SetInstructionsCode(instructions, code); | 877 return instructions_writer_->SetInstructionsCode(instructions, code); |
877 } | 878 } |
878 | 879 |
| 880 void WriteFunctionId(RawFunction* func, bool owner_is_class); |
| 881 |
879 protected: | 882 protected: |
880 void UnmarkAll() { | 883 void UnmarkAll() { |
881 if (!unmarked_objects_ && forward_list_ != NULL) { | 884 if (!unmarked_objects_ && forward_list_ != NULL) { |
882 forward_list_->UnmarkAll(); | 885 forward_list_->UnmarkAll(); |
883 unmarked_objects_ = true; | 886 unmarked_objects_ = true; |
884 } | 887 } |
885 } | 888 } |
886 | 889 |
887 bool CheckAndWritePredefinedObject(RawObject* raw); | 890 bool CheckAndWritePredefinedObject(RawObject* raw); |
888 bool HandleVMIsolateObject(RawObject* raw); | 891 bool HandleVMIsolateObject(RawObject* raw); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 private: | 1091 private: |
1089 SnapshotWriter* writer_; | 1092 SnapshotWriter* writer_; |
1090 bool as_references_; | 1093 bool as_references_; |
1091 | 1094 |
1092 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 1095 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
1093 }; | 1096 }; |
1094 | 1097 |
1095 } // namespace dart | 1098 } // namespace dart |
1096 | 1099 |
1097 #endif // VM_SNAPSHOT_H_ | 1100 #endif // VM_SNAPSHOT_H_ |
OLD | NEW |