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

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

Issue 2051043003: [snapshot] pass arguments as pointers, not references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@snapshotcreator
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/snapshot.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 8eab571cab9339d873f4a516d8469545c1eab69d..c767ca555934b091e26b769171f498d3ff318339 100644
--- a/src/snapshot/code-serializer.cc
+++ b/src/snapshot/code-serializer.cc
@@ -34,7 +34,7 @@ ScriptData* CodeSerializer::Serialize(Isolate* isolate,
cs.SerializeDeferredObjects();
cs.Pad();
- SerializedCodeData data(sink.data(), cs);
+ SerializedCodeData data(sink.data(), &cs);
ScriptData* script_data = data.GetScriptData();
if (FLAG_profile_deserialization) {
@@ -235,13 +235,13 @@ class Checksum {
DISALLOW_COPY_AND_ASSIGN(Checksum);
};
-SerializedCodeData::SerializedCodeData(const List<byte>& payload,
- const CodeSerializer& cs) {
+SerializedCodeData::SerializedCodeData(const List<byte>* payload,
+ const CodeSerializer* cs) {
DisallowHeapAllocation no_gc;
- const List<uint32_t>* stub_keys = cs.stub_keys();
+ const List<uint32_t>* stub_keys = cs->stub_keys();
List<Reservation> reservations;
- cs.EncodeReservations(&reservations);
+ cs->EncodeReservations(&reservations);
// Calculate sizes.
int reservation_size = reservations.length() * kInt32Size;
@@ -249,23 +249,23 @@ SerializedCodeData::SerializedCodeData(const List<byte>& payload,
int stub_keys_size = stub_keys->length() * kInt32Size;
int payload_offset = kHeaderSize + reservation_size + stub_keys_size;
int padded_payload_offset = POINTER_SIZE_ALIGN(payload_offset);
- int size = padded_payload_offset + payload.length();
+ int size = padded_payload_offset + payload->length();
// Allocate backing store and create result data.
AllocateData(size);
// Set header values.
- SetMagicNumber(cs.isolate());
+ SetMagicNumber(cs->isolate());
SetHeaderValue(kVersionHashOffset, Version::Hash());
- SetHeaderValue(kSourceHashOffset, SourceHash(cs.source()));
+ SetHeaderValue(kSourceHashOffset, SourceHash(cs->source()));
SetHeaderValue(kCpuFeaturesOffset,
static_cast<uint32_t>(CpuFeatures::SupportedFeatures()));
SetHeaderValue(kFlagHashOffset, FlagList::Hash());
SetHeaderValue(kNumReservationsOffset, reservations.length());
SetHeaderValue(kNumCodeStubKeysOffset, num_stub_keys);
- SetHeaderValue(kPayloadLengthOffset, payload.length());
+ SetHeaderValue(kPayloadLengthOffset, payload->length());
- Checksum checksum(payload.ToConstVector());
+ Checksum checksum(payload->ToConstVector());
SetHeaderValue(kChecksum1Offset, checksum.a());
SetHeaderValue(kChecksum2Offset, checksum.b());
@@ -280,8 +280,8 @@ SerializedCodeData::SerializedCodeData(const List<byte>& payload,
memset(data_ + payload_offset, 0, padded_payload_offset - payload_offset);
// Copy serialized data.
- CopyBytes(data_ + padded_payload_offset, payload.begin(),
- static_cast<size_t>(payload.length()));
+ CopyBytes(data_ + padded_payload_offset, payload->begin(),
+ static_cast<size_t>(payload->length()));
}
SerializedCodeData::SanityCheckResult SerializedCodeData::SanityCheck(
« no previous file with comments | « src/snapshot/code-serializer.h ('k') | src/snapshot/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698