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

Unified Diff: src/serialize.cc

Issue 8467010: Refactor embedded pointer visitors for the serializer (Closed)
Patch Set: Rebased on r9943, updated based on code review comments Created 9 years, 1 month 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/serialize.h ('k') | src/x64/assembler-x64-inl.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 ba7b2a5184825acd41a9b5e9f7619c8aac9aee7b..9a628aab958859c07ccc4c1d67db2f543f99c99e 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -1471,6 +1471,16 @@ void Serializer::ObjectSerializer::VisitPointers(Object** start,
}
+void Serializer::ObjectSerializer::VisitEmbeddedPointer(RelocInfo* rinfo) {
+ Object** current = rinfo->target_object_address();
+
+ OutputRawData(rinfo->target_address_address());
+ HowToCode representation = rinfo->IsCodedSpecially() ? kFromCode : kPlain;
+ serializer_->SerializeObject(*current, representation, kStartOfObject);
+ bytes_processed_so_far_ += rinfo->target_address_size();
+}
+
+
void Serializer::ObjectSerializer::VisitExternalReferences(Address* start,
Address* end) {
Address references_start = reinterpret_cast<Address>(start);
@@ -1485,6 +1495,20 @@ void Serializer::ObjectSerializer::VisitExternalReferences(Address* start,
}
+void Serializer::ObjectSerializer::VisitExternalReference(RelocInfo* rinfo) {
+ Address references_start = rinfo->target_address_address();
+ OutputRawData(references_start);
+
+ Address* current = rinfo->target_reference_address();
+ int representation = rinfo->IsCodedSpecially() ?
+ kFromCode + kStartOfObject : kPlain + kStartOfObject;
+ sink_->Put(kExternalReference + representation, "ExternalRef");
+ int reference_id = serializer_->EncodeExternalReference(*current);
+ sink_->PutInt(reference_id, "reference id");
+ bytes_processed_so_far_ += rinfo->target_address_size();
+}
+
+
void Serializer::ObjectSerializer::VisitRuntimeEntry(RelocInfo* rinfo) {
Address target_start = rinfo->target_address_address();
OutputRawData(target_start);
« no previous file with comments | « src/serialize.h ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698