| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 Object* reference_; | 340 Object* reference_; |
| 341 DeserializeState state_; | 341 DeserializeState state_; |
| 342 }; | 342 }; |
| 343 | 343 |
| 344 PageSpace* old_space() const { return old_space_; } | 344 PageSpace* old_space() const { return old_space_; } |
| 345 | 345 |
| 346 // Allocate uninitialized objects, this is used when reading a full snapshot. | 346 // Allocate uninitialized objects, this is used when reading a full snapshot. |
| 347 RawObject* AllocateUninitialized(intptr_t class_id, intptr_t size); | 347 RawObject* AllocateUninitialized(intptr_t class_id, intptr_t size); |
| 348 | 348 |
| 349 RawClass* ReadClassId(intptr_t object_id); | 349 RawClass* ReadClassId(intptr_t object_id); |
| 350 RawObject* ReadStaticImplicitClosure(intptr_t object_id, intptr_t cls_header); |
| 350 RawObject* ReadObjectImpl(); | 351 RawObject* ReadObjectImpl(); |
| 351 RawObject* ReadObjectImpl(intptr_t header); | 352 RawObject* ReadObjectImpl(intptr_t header); |
| 352 RawObject* ReadObjectRef(); | 353 RawObject* ReadObjectRef(); |
| 353 | 354 |
| 354 // Read a VM isolate object that was serialized as an Id. | 355 // Read a VM isolate object that was serialized as an Id. |
| 355 RawObject* ReadVMIsolateObject(intptr_t object_id); | 356 RawObject* ReadVMIsolateObject(intptr_t object_id); |
| 356 | 357 |
| 357 // Read an object that was serialized as an Id (singleton in object store, | 358 // Read an object that was serialized as an Id (singleton in object store, |
| 358 // or an object that was already serialized before). | 359 // or an object that was already serialized before). |
| 359 RawObject* ReadIndexedObject(intptr_t object_id); | 360 RawObject* ReadIndexedObject(intptr_t object_id); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 forward_list_.UnmarkAll(); | 605 forward_list_.UnmarkAll(); |
| 605 unmarked_objects_ = true; | 606 unmarked_objects_ = true; |
| 606 } | 607 } |
| 607 } | 608 } |
| 608 | 609 |
| 609 bool CheckAndWritePredefinedObject(RawObject* raw); | 610 bool CheckAndWritePredefinedObject(RawObject* raw); |
| 610 void HandleVMIsolateObject(RawObject* raw); | 611 void HandleVMIsolateObject(RawObject* raw); |
| 611 | 612 |
| 612 void WriteObjectRef(RawObject* raw); | 613 void WriteObjectRef(RawObject* raw); |
| 613 void WriteClassId(RawClass* cls); | 614 void WriteClassId(RawClass* cls); |
| 615 void WriteStaticImplicitClosure(intptr_t object_id, |
| 616 RawFunction* func, |
| 617 intptr_t tags); |
| 614 void WriteObjectImpl(RawObject* raw); | 618 void WriteObjectImpl(RawObject* raw); |
| 615 void WriteInlinedObject(RawObject* raw); | 619 void WriteInlinedObject(RawObject* raw); |
| 616 void WriteForwardedObjects(); | 620 void WriteForwardedObjects(); |
| 617 void ArrayWriteTo(intptr_t object_id, | 621 void ArrayWriteTo(intptr_t object_id, |
| 618 intptr_t array_kind, | 622 intptr_t array_kind, |
| 619 intptr_t tags, | 623 intptr_t tags, |
| 620 RawSmi* length, | 624 RawSmi* length, |
| 621 RawTypeArguments* type_arguments, | 625 RawTypeArguments* type_arguments, |
| 622 RawObject* data[]); | 626 RawObject* data[]); |
| 623 void CheckIfSerializable(RawClass* cls); | 627 RawFunction* IsSerializableClosure(RawClass* cls, RawObject* obj); |
| 628 RawClass* GetFunctionOwner(RawFunction* func); |
| 629 void CheckForNativeFields(RawClass* cls); |
| 624 void SetWriteException(Exceptions::ExceptionType type, const char* msg); | 630 void SetWriteException(Exceptions::ExceptionType type, const char* msg); |
| 625 void WriteInstance(intptr_t object_id, | 631 void WriteInstance(intptr_t object_id, |
| 626 RawObject* raw, | 632 RawObject* raw, |
| 627 RawClass* cls, | 633 RawClass* cls, |
| 628 intptr_t tags); | 634 intptr_t tags); |
| 629 void WriteInstanceRef(RawObject* raw, RawClass* cls); | 635 void WriteInstanceRef(RawObject* raw, RawClass* cls); |
| 630 bool AllowObjectsInDartLibrary(RawLibrary* library); | 636 bool AllowObjectsInDartLibrary(RawLibrary* library); |
| 631 | 637 |
| 632 Isolate* isolate() const { return isolate_; } | 638 Isolate* isolate() const { return isolate_; } |
| 633 ObjectStore* object_store() const { return object_store_; } | 639 ObjectStore* object_store() const { return object_store_; } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 private: | 747 private: |
| 742 SnapshotWriter* writer_; | 748 SnapshotWriter* writer_; |
| 743 bool as_references_; | 749 bool as_references_; |
| 744 | 750 |
| 745 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 751 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
| 746 }; | 752 }; |
| 747 | 753 |
| 748 } // namespace dart | 754 } // namespace dart |
| 749 | 755 |
| 750 #endif // VM_SNAPSHOT_H_ | 756 #endif // VM_SNAPSHOT_H_ |
| OLD | NEW |