OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_SERIALIZE_H_ | 5 #ifndef V8_SERIALIZE_H_ |
6 #define V8_SERIALIZE_H_ | 6 #define V8_SERIALIZE_H_ |
7 | 7 |
8 #include "src/hashmap.h" | 8 #include "src/hashmap.h" |
9 #include "src/heap-profiler.h" | 9 #include "src/heap-profiler.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 inline void FlushSkip(int skip) { | 725 inline void FlushSkip(int skip) { |
726 if (skip != 0) { | 726 if (skip != 0) { |
727 sink_->Put(kSkip, "SkipFromSerializeObject"); | 727 sink_->Put(kSkip, "SkipFromSerializeObject"); |
728 sink_->PutInt(skip, "SkipDistanceFromSerializeObject"); | 728 sink_->PutInt(skip, "SkipDistanceFromSerializeObject"); |
729 } | 729 } |
730 } | 730 } |
731 | 731 |
732 bool BackReferenceIsAlreadyAllocated(BackReference back_reference); | 732 bool BackReferenceIsAlreadyAllocated(BackReference back_reference); |
733 | 733 |
734 // This will return the space for an object. | 734 // This will return the space for an object. |
735 static AllocationSpace SpaceOfObject(HeapObject* object); | |
736 BackReference AllocateLargeObject(int size); | 735 BackReference AllocateLargeObject(int size); |
737 BackReference Allocate(AllocationSpace space, int size); | 736 BackReference Allocate(AllocationSpace space, int size); |
738 int EncodeExternalReference(Address addr) { | 737 int EncodeExternalReference(Address addr) { |
739 return external_reference_encoder_->Encode(addr); | 738 return external_reference_encoder_->Encode(addr); |
740 } | 739 } |
741 | 740 |
742 // GetInt reads 4 bytes at once, requiring padding at the end. | 741 // GetInt reads 4 bytes at once, requiring padding at the end. |
743 void Pad(); | 742 void Pad(); |
744 | 743 |
745 // Some roots should not be serialized, because their actual value depends on | 744 // Some roots should not be serialized, because their actual value depends on |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 kNumInternalizedStringsOffset + kInt32Size; | 1015 kNumInternalizedStringsOffset + kInt32Size; |
1017 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; | 1016 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; |
1018 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 1017 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
1019 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 1018 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
1020 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 1019 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
1021 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 1020 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
1022 }; | 1021 }; |
1023 } } // namespace v8::internal | 1022 } } // namespace v8::internal |
1024 | 1023 |
1025 #endif // V8_SERIALIZE_H_ | 1024 #endif // V8_SERIALIZE_H_ |
OLD | NEW |