Chromium Code Reviews| 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); |