Commit 6f6f1f62 authored by yangguo's avatar yangguo Committed by Commit bot

[snapshot] make snapshot sink a non-dynamic member of the serializer.

R=vogelheim@chromium.org

Review-Url: https://codereview.chromium.org/2052433003
Cr-Commit-Position: refs/heads/master@{#36890}
parent 235ed54a
...@@ -461,14 +461,10 @@ StartupData SnapshotCreator::CreateBlob( ...@@ -461,14 +461,10 @@ StartupData SnapshotCreator::CreateBlob(
} }
data->contexts_.Clear(); data->contexts_.Clear();
i::SnapshotByteSink snapshot_sink; i::StartupSerializer startup_serializer(isolate, function_code_handling);
i::StartupSerializer startup_serializer(isolate, &snapshot_sink,
function_code_handling);
startup_serializer.SerializeStrongReferences(); startup_serializer.SerializeStrongReferences();
i::SnapshotByteSink context_sink; i::PartialSerializer context_serializer(isolate, &startup_serializer);
i::PartialSerializer context_serializer(isolate, &startup_serializer,
&context_sink);
context_serializer.Serialize(&contexts[0]); context_serializer.Serialize(&contexts[0]);
startup_serializer.SerializeWeakReferencesAndDeferred(); startup_serializer.SerializeWeakReferencesAndDeferred();
......
...@@ -26,15 +26,14 @@ ScriptData* CodeSerializer::Serialize(Isolate* isolate, ...@@ -26,15 +26,14 @@ ScriptData* CodeSerializer::Serialize(Isolate* isolate,
} }
// Serialize code object. // Serialize code object.
SnapshotByteSink sink(info->code()->CodeSize() * 2); CodeSerializer cs(isolate, *source);
CodeSerializer cs(isolate, &sink, *source);
DisallowHeapAllocation no_gc; DisallowHeapAllocation no_gc;
Object** location = Handle<Object>::cast(info).location(); Object** location = Handle<Object>::cast(info).location();
cs.VisitPointer(location); cs.VisitPointer(location);
cs.SerializeDeferredObjects(); cs.SerializeDeferredObjects();
cs.Pad(); cs.Pad();
SerializedCodeData data(sink.data(), &cs); SerializedCodeData data(cs.sink()->data(), &cs);
ScriptData* script_data = data.GetScriptData(); ScriptData* script_data = data.GetScriptData();
if (FLAG_profile_deserialization) { if (FLAG_profile_deserialization) {
...@@ -105,7 +104,7 @@ void CodeSerializer::SerializeGeneric(HeapObject* heap_object, ...@@ -105,7 +104,7 @@ void CodeSerializer::SerializeGeneric(HeapObject* heap_object,
HowToCode how_to_code, HowToCode how_to_code,
WhereToPoint where_to_point) { WhereToPoint where_to_point) {
// Object has not yet been serialized. Serialize it here. // Object has not yet been serialized. Serialize it here.
ObjectSerializer serializer(this, heap_object, sink_, how_to_code, ObjectSerializer serializer(this, heap_object, &sink_, how_to_code,
where_to_point); where_to_point);
serializer.Serialize(); serializer.Serialize();
} }
...@@ -123,8 +122,8 @@ void CodeSerializer::SerializeBuiltin(int builtin_index, HowToCode how_to_code, ...@@ -123,8 +122,8 @@ void CodeSerializer::SerializeBuiltin(int builtin_index, HowToCode how_to_code,
isolate()->builtins()->name(builtin_index)); isolate()->builtins()->name(builtin_index));
} }
sink_->Put(kBuiltin + how_to_code + where_to_point, "Builtin"); sink_.Put(kBuiltin + how_to_code + where_to_point, "Builtin");
sink_->PutInt(builtin_index, "builtin_index"); sink_.PutInt(builtin_index, "builtin_index");
} }
void CodeSerializer::SerializeCodeStub(Code* code_stub, HowToCode how_to_code, void CodeSerializer::SerializeCodeStub(Code* code_stub, HowToCode how_to_code,
......
...@@ -28,8 +28,8 @@ class CodeSerializer : public Serializer { ...@@ -28,8 +28,8 @@ class CodeSerializer : public Serializer {
const List<uint32_t>* stub_keys() const { return &stub_keys_; } const List<uint32_t>* stub_keys() const { return &stub_keys_; }
private: private:
CodeSerializer(Isolate* isolate, SnapshotByteSink* sink, String* source) CodeSerializer(Isolate* isolate, String* source)
: Serializer(isolate, sink), source_(source) { : Serializer(isolate), source_(source) {
reference_map_.AddAttachedReference(source); reference_map_.AddAttachedReference(source);
} }
......
...@@ -10,9 +10,8 @@ namespace v8 { ...@@ -10,9 +10,8 @@ namespace v8 {
namespace internal { namespace internal {
PartialSerializer::PartialSerializer(Isolate* isolate, PartialSerializer::PartialSerializer(Isolate* isolate,
Serializer* startup_snapshot_serializer, Serializer* startup_snapshot_serializer)
SnapshotByteSink* sink) : Serializer(isolate),
: Serializer(isolate, sink),
startup_serializer_(startup_snapshot_serializer), startup_serializer_(startup_snapshot_serializer),
next_partial_cache_index_(0) { next_partial_cache_index_(0) {
InitializeCodeAddressMap(); InitializeCodeAddressMap();
...@@ -63,9 +62,9 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, ...@@ -63,9 +62,9 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
FlushSkip(skip); FlushSkip(skip);
int cache_index = PartialSnapshotCacheIndex(obj); int cache_index = PartialSnapshotCacheIndex(obj);
sink_->Put(kPartialSnapshotCache + how_to_code + where_to_point, sink_.Put(kPartialSnapshotCache + how_to_code + where_to_point,
"PartialSnapshotCache"); "PartialSnapshotCache");
sink_->PutInt(cache_index, "partial_snapshot_cache_index"); sink_.PutInt(cache_index, "partial_snapshot_cache_index");
return; return;
} }
...@@ -90,7 +89,7 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, ...@@ -90,7 +89,7 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
} }
// Object has not yet been serialized. Serialize it here. // Object has not yet been serialized. Serialize it here.
ObjectSerializer serializer(this, obj, sink_, how_to_code, where_to_point); ObjectSerializer serializer(this, obj, &sink_, how_to_code, where_to_point);
serializer.Serialize(); serializer.Serialize();
} }
......
...@@ -13,8 +13,7 @@ namespace internal { ...@@ -13,8 +13,7 @@ namespace internal {
class PartialSerializer : public Serializer { class PartialSerializer : public Serializer {
public: public:
PartialSerializer(Isolate* isolate, Serializer* startup_snapshot_serializer, PartialSerializer(Isolate* isolate, Serializer* startup_snapshot_serializer);
SnapshotByteSink* sink);
~PartialSerializer() override; ~PartialSerializer() override;
......
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
Serializer::Serializer(Isolate* isolate, SnapshotByteSink* sink) Serializer::Serializer(Isolate* isolate)
: isolate_(isolate), : isolate_(isolate),
sink_(sink),
external_reference_encoder_(isolate), external_reference_encoder_(isolate),
root_index_map_(isolate), root_index_map_(isolate),
recursion_depth_(0), recursion_depth_(0),
...@@ -90,10 +89,10 @@ void Serializer::OutputStatistics(const char* name) { ...@@ -90,10 +89,10 @@ void Serializer::OutputStatistics(const char* name) {
void Serializer::SerializeDeferredObjects() { void Serializer::SerializeDeferredObjects() {
while (deferred_objects_.length() > 0) { while (deferred_objects_.length() > 0) {
HeapObject* obj = deferred_objects_.RemoveLast(); HeapObject* obj = deferred_objects_.RemoveLast();
ObjectSerializer obj_serializer(this, obj, sink_, kPlain, kStartOfObject); ObjectSerializer obj_serializer(this, obj, &sink_, kPlain, kStartOfObject);
obj_serializer.SerializeDeferred(); obj_serializer.SerializeDeferred();
} }
sink_->Put(kSynchronize, "Finished with deferred objects"); sink_.Put(kSynchronize, "Finished with deferred objects");
} }
void Serializer::VisitPointers(Object** start, Object** end) { void Serializer::VisitPointers(Object** start, Object** end) {
...@@ -154,10 +153,10 @@ bool Serializer::SerializeKnownObject(HeapObject* obj, HowToCode how_to_code, ...@@ -154,10 +153,10 @@ bool Serializer::SerializeKnownObject(HeapObject* obj, HowToCode how_to_code,
PrintF("\n"); PrintF("\n");
} }
if (skip != 0) { if (skip != 0) {
sink_->Put(kHotObjectWithSkip + index, "HotObjectWithSkip"); sink_.Put(kHotObjectWithSkip + index, "HotObjectWithSkip");
sink_->PutInt(skip, "HotObjectSkipDistance"); sink_.PutInt(skip, "HotObjectSkipDistance");
} else { } else {
sink_->Put(kHotObject + index, "HotObject"); sink_.Put(kHotObject + index, "HotObject");
} }
return true; return true;
} }
...@@ -186,11 +185,11 @@ bool Serializer::SerializeKnownObject(HeapObject* obj, HowToCode how_to_code, ...@@ -186,11 +185,11 @@ bool Serializer::SerializeKnownObject(HeapObject* obj, HowToCode how_to_code,
PutAlignmentPrefix(obj); PutAlignmentPrefix(obj);
AllocationSpace space = reference.space(); AllocationSpace space = reference.space();
if (skip == 0) { if (skip == 0) {
sink_->Put(kBackref + how_to_code + where_to_point + space, "BackRef"); sink_.Put(kBackref + how_to_code + where_to_point + space, "BackRef");
} else { } else {
sink_->Put(kBackrefWithSkip + how_to_code + where_to_point + space, sink_.Put(kBackrefWithSkip + how_to_code + where_to_point + space,
"BackRefWithSkip"); "BackRefWithSkip");
sink_->PutInt(skip, "BackRefSkipDistance"); sink_.PutInt(skip, "BackRefSkipDistance");
} }
PutBackReference(obj, reference); PutBackReference(obj, reference);
} }
...@@ -213,28 +212,28 @@ void Serializer::PutRoot(int root_index, HeapObject* object, ...@@ -213,28 +212,28 @@ void Serializer::PutRoot(int root_index, HeapObject* object,
root_index < kNumberOfRootArrayConstants && root_index < kNumberOfRootArrayConstants &&
!isolate()->heap()->InNewSpace(object)) { !isolate()->heap()->InNewSpace(object)) {
if (skip == 0) { if (skip == 0) {
sink_->Put(kRootArrayConstants + root_index, "RootConstant"); sink_.Put(kRootArrayConstants + root_index, "RootConstant");
} else { } else {
sink_->Put(kRootArrayConstantsWithSkip + root_index, "RootConstant"); sink_.Put(kRootArrayConstantsWithSkip + root_index, "RootConstant");
sink_->PutInt(skip, "SkipInPutRoot"); sink_.PutInt(skip, "SkipInPutRoot");
} }
} else { } else {
FlushSkip(skip); FlushSkip(skip);
sink_->Put(kRootArray + how_to_code + where_to_point, "RootSerialization"); sink_.Put(kRootArray + how_to_code + where_to_point, "RootSerialization");
sink_->PutInt(root_index, "root_index"); sink_.PutInt(root_index, "root_index");
} }
} }
void Serializer::PutSmi(Smi* smi) { void Serializer::PutSmi(Smi* smi) {
sink_->Put(kOnePointerRawData, "Smi"); sink_.Put(kOnePointerRawData, "Smi");
byte* bytes = reinterpret_cast<byte*>(&smi); byte* bytes = reinterpret_cast<byte*>(&smi);
for (int i = 0; i < kPointerSize; i++) sink_->Put(bytes[i], "Byte"); for (int i = 0; i < kPointerSize; i++) sink_.Put(bytes[i], "Byte");
} }
void Serializer::PutBackReference(HeapObject* object, void Serializer::PutBackReference(HeapObject* object,
SerializerReference reference) { SerializerReference reference) {
DCHECK(BackReferenceIsAlreadyAllocated(reference)); DCHECK(BackReferenceIsAlreadyAllocated(reference));
sink_->PutInt(reference.back_reference(), "BackRefValue"); sink_.PutInt(reference.back_reference(), "BackRefValue");
hot_objects_.Add(object); hot_objects_.Add(object);
} }
...@@ -245,8 +244,8 @@ void Serializer::PutAttachedReference(SerializerReference reference, ...@@ -245,8 +244,8 @@ void Serializer::PutAttachedReference(SerializerReference reference,
DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) || DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) ||
(how_to_code == kPlain && where_to_point == kInnerPointer) || (how_to_code == kPlain && where_to_point == kInnerPointer) ||
(how_to_code == kFromCode && where_to_point == kInnerPointer)); (how_to_code == kFromCode && where_to_point == kInnerPointer));
sink_->Put(kAttachedReference + how_to_code + where_to_point, "AttachedRef"); sink_.Put(kAttachedReference + how_to_code + where_to_point, "AttachedRef");
sink_->PutInt(reference.attached_reference_index(), "AttachedRefIndex"); sink_.PutInt(reference.attached_reference_index(), "AttachedRefIndex");
} }
int Serializer::PutAlignmentPrefix(HeapObject* object) { int Serializer::PutAlignmentPrefix(HeapObject* object) {
...@@ -254,7 +253,7 @@ int Serializer::PutAlignmentPrefix(HeapObject* object) { ...@@ -254,7 +253,7 @@ int Serializer::PutAlignmentPrefix(HeapObject* object) {
if (alignment != kWordAligned) { if (alignment != kWordAligned) {
DCHECK(1 <= alignment && alignment <= 3); DCHECK(1 <= alignment && alignment <= 3);
byte prefix = (kAlignmentPrefix - 1) + alignment; byte prefix = (kAlignmentPrefix - 1) + alignment;
sink_->Put(prefix, "Alignment"); sink_.Put(prefix, "Alignment");
return Heap::GetMaximumFillToAlign(alignment); return Heap::GetMaximumFillToAlign(alignment);
} }
return 0; return 0;
...@@ -274,8 +273,8 @@ SerializerReference Serializer::Allocate(AllocationSpace space, int size) { ...@@ -274,8 +273,8 @@ SerializerReference Serializer::Allocate(AllocationSpace space, int size) {
if (new_chunk_size > max_chunk_size(space)) { if (new_chunk_size > max_chunk_size(space)) {
// The new chunk size would not fit onto a single page. Complete the // The new chunk size would not fit onto a single page. Complete the
// current chunk and start a new one. // current chunk and start a new one.
sink_->Put(kNextChunk, "NextChunk"); sink_.Put(kNextChunk, "NextChunk");
sink_->Put(space, "NextChunkSpace"); sink_.Put(space, "NextChunkSpace");
completed_chunks_[space].Add(pending_chunk_[space]); completed_chunks_[space].Add(pending_chunk_[space]);
pending_chunk_[space] = 0; pending_chunk_[space] = 0;
new_chunk_size = size; new_chunk_size = size;
...@@ -290,11 +289,11 @@ void Serializer::Pad() { ...@@ -290,11 +289,11 @@ void Serializer::Pad() {
// The non-branching GetInt will read up to 3 bytes too far, so we need // The non-branching GetInt will read up to 3 bytes too far, so we need
// to pad the snapshot to make sure we don't read over the end. // to pad the snapshot to make sure we don't read over the end.
for (unsigned i = 0; i < sizeof(int32_t) - 1; i++) { for (unsigned i = 0; i < sizeof(int32_t) - 1; i++) {
sink_->Put(kNop, "Padding"); sink_.Put(kNop, "Padding");
} }
// Pad up to pointer size for checksum. // Pad up to pointer size for checksum.
while (!IsAligned(sink_->Position(), kPointerAlignment)) { while (!IsAligned(sink_.Position(), kPointerAlignment)) {
sink_->Put(kNop, "Padding"); sink_.Put(kNop, "Padding");
} }
} }
......
...@@ -120,7 +120,7 @@ class CodeAddressMap : public CodeEventLogger { ...@@ -120,7 +120,7 @@ class CodeAddressMap : public CodeEventLogger {
// There can be only one serializer per V8 process. // There can be only one serializer per V8 process.
class Serializer : public SerializerDeserializer { class Serializer : public SerializerDeserializer {
public: public:
Serializer(Isolate* isolate, SnapshotByteSink* sink); explicit Serializer(Isolate* isolate);
~Serializer() override; ~Serializer() override;
void EncodeReservations(List<SerializedData::Reservation>* out) const; void EncodeReservations(List<SerializedData::Reservation>* out) const;
...@@ -177,8 +177,8 @@ class Serializer : public SerializerDeserializer { ...@@ -177,8 +177,8 @@ class Serializer : public SerializerDeserializer {
inline void FlushSkip(int skip) { inline void FlushSkip(int skip) {
if (skip != 0) { if (skip != 0) {
sink_->Put(kSkip, "SkipFromSerializeObject"); sink_.Put(kSkip, "SkipFromSerializeObject");
sink_->PutInt(skip, "SkipDistanceFromSerializeObject"); sink_.PutInt(skip, "SkipDistanceFromSerializeObject");
} }
} }
...@@ -208,7 +208,7 @@ class Serializer : public SerializerDeserializer { ...@@ -208,7 +208,7 @@ class Serializer : public SerializerDeserializer {
return max_chunk_size_[space]; return max_chunk_size_[space];
} }
SnapshotByteSink* sink() const { return sink_; } const SnapshotByteSink* sink() const { return &sink_; }
void QueueDeferredObject(HeapObject* obj) { void QueueDeferredObject(HeapObject* obj) {
DCHECK(reference_map_.Lookup(obj).is_back_reference()); DCHECK(reference_map_.Lookup(obj).is_back_reference());
...@@ -219,7 +219,7 @@ class Serializer : public SerializerDeserializer { ...@@ -219,7 +219,7 @@ class Serializer : public SerializerDeserializer {
Isolate* isolate_; Isolate* isolate_;
SnapshotByteSink* sink_; SnapshotByteSink sink_;
ExternalReferenceEncoder external_reference_encoder_; ExternalReferenceEncoder external_reference_encoder_;
SerializerReferenceMap reference_map_; SerializerReferenceMap reference_map_;
......
...@@ -11,9 +11,9 @@ namespace v8 { ...@@ -11,9 +11,9 @@ namespace v8 {
namespace internal { namespace internal {
StartupSerializer::StartupSerializer( StartupSerializer::StartupSerializer(
Isolate* isolate, SnapshotByteSink* sink, Isolate* isolate,
v8::SnapshotCreator::FunctionCodeHandling function_code_handling) v8::SnapshotCreator::FunctionCodeHandling function_code_handling)
: Serializer(isolate, sink), : Serializer(isolate),
clear_function_code_(function_code_handling == clear_function_code_(function_code_handling ==
v8::SnapshotCreator::FunctionCodeHandling::kClear), v8::SnapshotCreator::FunctionCodeHandling::kClear),
serializing_builtins_(false) { serializing_builtins_(false) {
...@@ -65,7 +65,7 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, ...@@ -65,7 +65,7 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
FlushSkip(skip); FlushSkip(skip);
// Object has not yet been serialized. Serialize it here. // Object has not yet been serialized. Serialize it here.
ObjectSerializer object_serializer(this, obj, sink_, how_to_code, ObjectSerializer object_serializer(this, obj, &sink_, how_to_code,
where_to_point); where_to_point);
object_serializer.Serialize(); object_serializer.Serialize();
...@@ -94,7 +94,7 @@ void StartupSerializer::Synchronize(VisitorSynchronization::SyncTag tag) { ...@@ -94,7 +94,7 @@ void StartupSerializer::Synchronize(VisitorSynchronization::SyncTag tag) {
// We expect the builtins tag after builtins have been serialized. // We expect the builtins tag after builtins have been serialized.
DCHECK(!serializing_builtins_ || tag == VisitorSynchronization::kBuiltins); DCHECK(!serializing_builtins_ || tag == VisitorSynchronization::kBuiltins);
serializing_builtins_ = (tag == VisitorSynchronization::kHandleScope); serializing_builtins_ = (tag == VisitorSynchronization::kHandleScope);
sink_->Put(kSynchronize, "Synchronize"); sink_.Put(kSynchronize, "Synchronize");
} }
void StartupSerializer::SerializeStrongReferences() { void StartupSerializer::SerializeStrongReferences() {
......
...@@ -15,7 +15,7 @@ namespace internal { ...@@ -15,7 +15,7 @@ namespace internal {
class StartupSerializer : public Serializer { class StartupSerializer : public Serializer {
public: public:
StartupSerializer( StartupSerializer(
Isolate* isolate, SnapshotByteSink* sink, Isolate* isolate,
v8::SnapshotCreator::FunctionCodeHandling function_code_handling); v8::SnapshotCreator::FunctionCodeHandling function_code_handling);
~StartupSerializer() override; ~StartupSerializer() override;
......
...@@ -92,8 +92,7 @@ static Vector<const byte> Serialize(v8::Isolate* isolate) { ...@@ -92,8 +92,7 @@ static Vector<const byte> Serialize(v8::Isolate* isolate) {
Isolate* internal_isolate = reinterpret_cast<Isolate*>(isolate); Isolate* internal_isolate = reinterpret_cast<Isolate*>(isolate);
internal_isolate->heap()->CollectAllAvailableGarbage("serialize"); internal_isolate->heap()->CollectAllAvailableGarbage("serialize");
SnapshotByteSink sink; StartupSerializer ser(internal_isolate,
StartupSerializer ser(internal_isolate, &sink,
v8::SnapshotCreator::FunctionCodeHandling::kClear); v8::SnapshotCreator::FunctionCodeHandling::kClear);
ser.SerializeStrongReferences(); ser.SerializeStrongReferences();
ser.SerializeWeakReferencesAndDeferred(); ser.SerializeWeakReferencesAndDeferred();
...@@ -282,15 +281,11 @@ static void PartiallySerializeObject(Vector<const byte>* startup_blob_out, ...@@ -282,15 +281,11 @@ static void PartiallySerializeObject(Vector<const byte>* startup_blob_out,
} }
env.Reset(); env.Reset();
SnapshotByteSink startup_sink;
StartupSerializer startup_serializer( StartupSerializer startup_serializer(
isolate, &startup_sink, isolate, v8::SnapshotCreator::FunctionCodeHandling::kClear);
v8::SnapshotCreator::FunctionCodeHandling::kClear);
startup_serializer.SerializeStrongReferences(); startup_serializer.SerializeStrongReferences();
SnapshotByteSink partial_sink; PartialSerializer partial_serializer(isolate, &startup_serializer);
PartialSerializer partial_serializer(isolate, &startup_serializer,
&partial_sink);
partial_serializer.Serialize(&raw_foo); partial_serializer.Serialize(&raw_foo);
startup_serializer.SerializeWeakReferencesAndDeferred(); startup_serializer.SerializeWeakReferencesAndDeferred();
...@@ -385,13 +380,11 @@ static void PartiallySerializeContext(Vector<const byte>* startup_blob_out, ...@@ -385,13 +380,11 @@ static void PartiallySerializeContext(Vector<const byte>* startup_blob_out,
SnapshotByteSink startup_sink; SnapshotByteSink startup_sink;
StartupSerializer startup_serializer( StartupSerializer startup_serializer(
isolate, &startup_sink, isolate, v8::SnapshotCreator::FunctionCodeHandling::kClear);
v8::SnapshotCreator::FunctionCodeHandling::kClear);
startup_serializer.SerializeStrongReferences(); startup_serializer.SerializeStrongReferences();
SnapshotByteSink partial_sink; SnapshotByteSink partial_sink;
PartialSerializer partial_serializer(isolate, &startup_serializer, PartialSerializer partial_serializer(isolate, &startup_serializer);
&partial_sink);
partial_serializer.Serialize(&raw_context); partial_serializer.Serialize(&raw_context);
startup_serializer.SerializeWeakReferencesAndDeferred(); startup_serializer.SerializeWeakReferencesAndDeferred();
...@@ -505,13 +498,11 @@ static void PartiallySerializeCustomContext( ...@@ -505,13 +498,11 @@ static void PartiallySerializeCustomContext(
SnapshotByteSink startup_sink; SnapshotByteSink startup_sink;
StartupSerializer startup_serializer( StartupSerializer startup_serializer(
isolate, &startup_sink, isolate, v8::SnapshotCreator::FunctionCodeHandling::kClear);
v8::SnapshotCreator::FunctionCodeHandling::kClear);
startup_serializer.SerializeStrongReferences(); startup_serializer.SerializeStrongReferences();
SnapshotByteSink partial_sink; SnapshotByteSink partial_sink;
PartialSerializer partial_serializer(isolate, &startup_serializer, PartialSerializer partial_serializer(isolate, &startup_serializer);
&partial_sink);
partial_serializer.Serialize(&raw_context); partial_serializer.Serialize(&raw_context);
startup_serializer.SerializeWeakReferencesAndDeferred(); startup_serializer.SerializeWeakReferencesAndDeferred();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment