| Index: src/serialize.h
|
| ===================================================================
|
| --- src/serialize.h (revision 3575)
|
| +++ src/serialize.h (working copy)
|
| @@ -199,7 +199,8 @@
|
| SYNCHRONIZE = 36,
|
| START_NEW_PAGE_SERIALIZATION = 37,
|
| NATIVES_STRING_RESOURCE = 38,
|
| - // Free: 39-47.
|
| + ROOT_SERIALIZATION = 39,
|
| + // Free: 40-47.
|
| BACKREF_SERIALIZATION = 48,
|
| // One per space, must be kSpaceMask aligned.
|
| // Free: 57-63.
|
| @@ -293,10 +294,17 @@
|
| class Serializer : public SerDes {
|
| public:
|
| explicit Serializer(SnapshotByteSink* sink);
|
| - // Serialize the current state of the heap. This operation destroys the
|
| - // heap contents.
|
| + // Serialize the current state of the heap.
|
| void Serialize();
|
| + // Serialize a single object and the objects reachable from it.
|
| + void SerializePartial(Object** obj);
|
| void VisitPointers(Object** start, Object** end);
|
| + // You can call this after serialization to find out how much space was used
|
| + // in each space.
|
| + int CurrentAllocationAddress(int space) {
|
| + if (SpaceIsLarge(space)) space = LO_SPACE;
|
| + return fullness_[space];
|
| + }
|
|
|
| static void Enable() {
|
| if (!serialization_enabled_) {
|
| @@ -366,13 +374,11 @@
|
| // once the map has been used for the serialization address.
|
| static int SpaceOfAlreadySerializedObject(HeapObject* object);
|
| int Allocate(int space, int size, bool* new_page_started);
|
| - int CurrentAllocationAddress(int space) {
|
| - if (SpaceIsLarge(space)) space = LO_SPACE;
|
| - return fullness_[space];
|
| - }
|
| int EncodeExternalReference(Address addr) {
|
| return external_reference_encoder_->Encode(addr);
|
| }
|
| + int RootIndex(HeapObject* heap_object);
|
| + static const int kInvalidRootIndex = -1;
|
|
|
| // Keep track of the fullness of each space in order to generate
|
| // relative addresses for back references. Large objects are
|
| @@ -382,6 +388,7 @@
|
| SnapshotByteSink* sink_;
|
| int current_root_index_;
|
| ExternalReferenceEncoder* external_reference_encoder_;
|
| + bool partial_;
|
| static bool serialization_enabled_;
|
| // Did we already make use of the fact that serialization was not enabled?
|
| static bool too_late_to_enable_now_;
|
|
|