Index: src/serialize.h |
diff --git a/src/serialize.h b/src/serialize.h |
index 64164c803a931c61b4808b64a025ab2c4d4e6e55..02dd07e64eb2676e44007b9b7c5af01d3c3cada7 100644 |
--- a/src/serialize.h |
+++ b/src/serialize.h |
@@ -572,7 +572,7 @@ class Deserializer: public SerializerDeserializer { |
void FlushICacheForNewCodeObjects(); |
// Pass a vector of externally-provided objects referenced by the snapshot. |
- // The ownership to its backing store is handed over as well. |
+ // The ownership to its backing store is not handed over. |
void SetAttachedObjects(Vector<Handle<Object> > attached_objects) { |
attached_objects_ = attached_objects; |
} |
@@ -703,6 +703,8 @@ class Serializer : public SerializerDeserializer { |
// External strings are serialized in a way to resemble sequential strings. |
void SerializeExternalString(); |
+ Address PrepareCode(); |
+ |
Serializer* serializer_; |
HeapObject* object_; |
SnapshotByteSink* sink_; |
@@ -750,6 +752,12 @@ class Serializer : public SerializerDeserializer { |
// of the serializer. Initialize it on demand. |
void InitializeCodeAddressMap(); |
+ inline Address GetCodeBuffer(int size) { |
+ if (size > code_buffer_.length()) code_buffer_.Dispose(); |
+ code_buffer_ = Vector<byte>::New(size); |
+ return code_buffer_.start(); |
+ } |
+ |
inline uint32_t max_chunk_size(int space) const { |
DCHECK_LE(0, space); |
DCHECK_LT(space, kNumberOfSpaces); |
@@ -784,6 +792,8 @@ class Serializer : public SerializerDeserializer { |
uint32_t large_objects_total_size_; |
uint32_t seen_large_objects_index_; |
+ Vector<byte> code_buffer_; |
+ |
DISALLOW_COPY_AND_ASSIGN(Serializer); |
}; |