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

Unified Diff: src/serialize.cc

Issue 8467010: Refactor embedded pointer visitors for the serializer (Closed)
Patch Set: 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
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index ba7b2a5184825acd41a9b5e9f7619c8aac9aee7b..367cb44dcf6d21d8f22cf594ba7f05c702d2851d 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -1471,6 +1471,23 @@ void Serializer::ObjectSerializer::VisitPointers(Object** start,
}
+void Serializer::ObjectSerializer::VisitEmbeddedPointer(RelocInfo* rinfo) {
+ Object** current = rinfo->target_object_address();
+
+ if(!(*current)->IsSmi()) {
Michael Starzinger 2011/11/09 10:46:19 Does the address actually ever get to be a SMI her
+ OutputRawData(reinterpret_cast<Address>(rinfo->target_address_address()));
Michael Starzinger 2011/11/09 10:46:19 No cast should be needed here.
+ HowToCode representation;
+ if(rinfo->IsCodedSpecially()) {
Michael Starzinger 2011/11/09 10:46:19 Using the ternary operator here might make things
+ representation = kFromCode;
+ } else {
+ representation = 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 +1502,25 @@ void Serializer::ObjectSerializer::VisitExternalReferences(Address* start,
}
+void Serializer::ObjectSerializer::VisitExternalReference(RelocInfo* rinfo) {
+ Address references_start =
+ reinterpret_cast<Address>(rinfo->target_address_address());
Michael Starzinger 2011/11/09 10:46:19 No cast should be needed here.
+ OutputRawData(references_start);
+ Address* current =
+ reinterpret_cast<Address*>(rinfo->target_reference_address());
Michael Starzinger 2011/11/09 10:46:19 No cast should be needed here.
+ int representation;
+ if(rinfo->IsCodedSpecially()) {
Michael Starzinger 2011/11/09 10:46:19 Using the ternary operator here might make things
+ representation = kFromCode + kStartOfObject;
+ } else {
+ representation = 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);
« src/objects.cc ('K') | « 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