Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Unified Diff: src/snapshot/code-serializer.cc

Issue 2052433003: [snapshot] make snapshot sink a non-dynamic member of the serializer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@noref
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/snapshot/code-serializer.h ('k') | src/snapshot/partial-serializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/code-serializer.cc
diff --git a/src/snapshot/code-serializer.cc b/src/snapshot/code-serializer.cc
index c767ca555934b091e26b769171f498d3ff318339..c8c20fcabb248aad6aa5d92bf0f35daa5337e1d9 100644
--- a/src/snapshot/code-serializer.cc
+++ b/src/snapshot/code-serializer.cc
@@ -26,15 +26,14 @@ ScriptData* CodeSerializer::Serialize(Isolate* isolate,
}
// Serialize code object.
- SnapshotByteSink sink(info->code()->CodeSize() * 2);
- CodeSerializer cs(isolate, &sink, *source);
+ CodeSerializer cs(isolate, *source);
DisallowHeapAllocation no_gc;
Object** location = Handle<Object>::cast(info).location();
cs.VisitPointer(location);
cs.SerializeDeferredObjects();
cs.Pad();
- SerializedCodeData data(sink.data(), &cs);
+ SerializedCodeData data(cs.sink()->data(), &cs);
ScriptData* script_data = data.GetScriptData();
if (FLAG_profile_deserialization) {
@@ -105,7 +104,7 @@ void CodeSerializer::SerializeGeneric(HeapObject* heap_object,
HowToCode how_to_code,
WhereToPoint where_to_point) {
// 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);
serializer.Serialize();
}
@@ -123,8 +122,8 @@ void CodeSerializer::SerializeBuiltin(int builtin_index, HowToCode how_to_code,
isolate()->builtins()->name(builtin_index));
}
- sink_->Put(kBuiltin + how_to_code + where_to_point, "Builtin");
- sink_->PutInt(builtin_index, "builtin_index");
+ sink_.Put(kBuiltin + how_to_code + where_to_point, "Builtin");
+ sink_.PutInt(builtin_index, "builtin_index");
}
void CodeSerializer::SerializeCodeStub(Code* code_stub, HowToCode how_to_code,
« no previous file with comments | « src/snapshot/code-serializer.h ('k') | src/snapshot/partial-serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698