OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 int reference_id = serializer_->EncodeExternalReference(*p); | 1687 int reference_id = serializer_->EncodeExternalReference(*p); |
1688 sink_->PutInt(reference_id, "reference id"); | 1688 sink_->PutInt(reference_id, "reference id"); |
1689 bytes_processed_so_far_ += kPointerSize; | 1689 bytes_processed_so_far_ += kPointerSize; |
1690 } | 1690 } |
1691 | 1691 |
1692 | 1692 |
1693 void Serializer::ObjectSerializer::VisitExternalReference(RelocInfo* rinfo) { | 1693 void Serializer::ObjectSerializer::VisitExternalReference(RelocInfo* rinfo) { |
1694 Address references_start = rinfo->target_address_address(); | 1694 Address references_start = rinfo->target_address_address(); |
1695 int skip = OutputRawData(references_start, kCanReturnSkipInsteadOfSkipping); | 1695 int skip = OutputRawData(references_start, kCanReturnSkipInsteadOfSkipping); |
1696 | 1696 |
1697 Address* current = rinfo->target_reference_address(); | 1697 Address current = rinfo->target_reference(); |
1698 int representation = rinfo->IsCodedSpecially() ? | 1698 int representation = rinfo->IsCodedSpecially() ? |
1699 kFromCode + kStartOfObject : kPlain + kStartOfObject; | 1699 kFromCode + kStartOfObject : kPlain + kStartOfObject; |
1700 sink_->Put(kExternalReference + representation, "ExternalRef"); | 1700 sink_->Put(kExternalReference + representation, "ExternalRef"); |
1701 sink_->PutInt(skip, "SkipB4ExternalRef"); | 1701 sink_->PutInt(skip, "SkipB4ExternalRef"); |
1702 int reference_id = serializer_->EncodeExternalReference(*current); | 1702 int reference_id = serializer_->EncodeExternalReference(current); |
1703 sink_->PutInt(reference_id, "reference id"); | 1703 sink_->PutInt(reference_id, "reference id"); |
1704 bytes_processed_so_far_ += rinfo->target_address_size(); | 1704 bytes_processed_so_far_ += rinfo->target_address_size(); |
1705 } | 1705 } |
1706 | 1706 |
1707 | 1707 |
1708 void Serializer::ObjectSerializer::VisitRuntimeEntry(RelocInfo* rinfo) { | 1708 void Serializer::ObjectSerializer::VisitRuntimeEntry(RelocInfo* rinfo) { |
1709 Address target_start = rinfo->target_address_address(); | 1709 Address target_start = rinfo->target_address_address(); |
1710 int skip = OutputRawData(target_start, kCanReturnSkipInsteadOfSkipping); | 1710 int skip = OutputRawData(target_start, kCanReturnSkipInsteadOfSkipping); |
1711 Address target = rinfo->target_address(); | 1711 Address target = rinfo->target_address(); |
1712 uint32_t encoding = serializer_->EncodeExternalReference(target); | 1712 uint32_t encoding = serializer_->EncodeExternalReference(target); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1864 | 1864 |
1865 bool SnapshotByteSource::AtEOF() { | 1865 bool SnapshotByteSource::AtEOF() { |
1866 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; | 1866 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; |
1867 for (int x = position_; x < length_; x++) { | 1867 for (int x = position_; x < length_; x++) { |
1868 if (data_[x] != SerializerDeserializer::nop()) return false; | 1868 if (data_[x] != SerializerDeserializer::nop()) return false; |
1869 } | 1869 } |
1870 return true; | 1870 return true; |
1871 } | 1871 } |
1872 | 1872 |
1873 } } // namespace v8::internal | 1873 } } // namespace v8::internal |
OLD | NEW |