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 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 kCanReturnSkipInsteadOfSkipping); | 1673 kCanReturnSkipInsteadOfSkipping); |
1674 HowToCode how_to_code = rinfo->IsCodedSpecially() ? kFromCode : kPlain; | 1674 HowToCode how_to_code = rinfo->IsCodedSpecially() ? kFromCode : kPlain; |
1675 sink_->Put(kExternalReference + how_to_code + kStartOfObject, "ExternalRef"); | 1675 sink_->Put(kExternalReference + how_to_code + kStartOfObject, "ExternalRef"); |
1676 sink_->PutInt(skip, "SkipB4ExternalRef"); | 1676 sink_->PutInt(skip, "SkipB4ExternalRef"); |
1677 Address target = rinfo->target_address(); | 1677 Address target = rinfo->target_address(); |
1678 sink_->PutInt(serializer_->EncodeExternalReference(target), "reference id"); | 1678 sink_->PutInt(serializer_->EncodeExternalReference(target), "reference id"); |
1679 bytes_processed_so_far_ += rinfo->target_address_size(); | 1679 bytes_processed_so_far_ += rinfo->target_address_size(); |
1680 } | 1680 } |
1681 | 1681 |
1682 | 1682 |
| 1683 void Serializer::ObjectSerializer::VisitCodeTarget( |
| 1684 Address target_address_pointer) { |
| 1685 int skip = OutputRawData(target_address_pointer, |
| 1686 kCanReturnSkipInsteadOfSkipping); |
| 1687 Code* object = Code::GetCodeFromTargetAddress( |
| 1688 Memory::Address_at(target_address_pointer)); |
| 1689 serializer_->SerializeObject(object, kFromCode, kInnerPointer, skip); |
| 1690 bytes_processed_so_far_ += kPointerSize; |
| 1691 } |
| 1692 |
| 1693 |
1683 void Serializer::ObjectSerializer::VisitCodeTarget(RelocInfo* rinfo) { | 1694 void Serializer::ObjectSerializer::VisitCodeTarget(RelocInfo* rinfo) { |
1684 int skip = OutputRawData(rinfo->target_address_address(), | 1695 int skip = OutputRawData(rinfo->target_address_address(), |
1685 kCanReturnSkipInsteadOfSkipping); | 1696 kCanReturnSkipInsteadOfSkipping); |
1686 Code* object = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 1697 Code* object = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
1687 serializer_->SerializeObject(object, kFromCode, kInnerPointer, skip); | 1698 serializer_->SerializeObject(object, kFromCode, kInnerPointer, skip); |
1688 bytes_processed_so_far_ += rinfo->target_address_size(); | 1699 bytes_processed_so_far_ += rinfo->target_address_size(); |
1689 } | 1700 } |
1690 | 1701 |
1691 | 1702 |
1692 void Serializer::ObjectSerializer::VisitCodeEntry(Address entry_address) { | 1703 void Serializer::ObjectSerializer::VisitCodeEntry(Address entry_address) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1848 | 1859 |
1849 bool SnapshotByteSource::AtEOF() { | 1860 bool SnapshotByteSource::AtEOF() { |
1850 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; | 1861 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; |
1851 for (int x = position_; x < length_; x++) { | 1862 for (int x = position_; x < length_; x++) { |
1852 if (data_[x] != SerializerDeserializer::nop()) return false; | 1863 if (data_[x] != SerializerDeserializer::nop()) return false; |
1853 } | 1864 } |
1854 return true; | 1865 return true; |
1855 } | 1866 } |
1856 | 1867 |
1857 } } // namespace v8::internal | 1868 } } // namespace v8::internal |
OLD | NEW |