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

Unified Diff: src/serialize.cc

Issue 1008923003: Serializer: micro-optimizations for the deserializer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add assertion Created 5 years, 9 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 | « no previous file | src/snapshot-source-sink.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index a7cfda8667b2306fcf2db63ff7e9ab50f17eb2e2..00405dda91a2999739b6fa45fcff3ce435c90e35 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -508,9 +508,7 @@ void Deserializer::DecodeReservation(
DCHECK_EQ(0, reservations_[NEW_SPACE].length());
STATIC_ASSERT(NEW_SPACE == 0);
int current_space = NEW_SPACE;
- for (int i = 0; i < res.length(); i++) {
- SerializedData::Reservation r(0);
- memcpy(&r, res.start() + i, sizeof(r));
+ for (auto& r : res) {
reservations_[current_space].Add({r.chunk_size(), NULL, NULL});
if (r.is_last()) current_space++;
}
« no previous file with comments | « no previous file | src/snapshot-source-sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698