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

Side by Side Diff: src/serialize.h

Issue 944923005: Use easier method to determine allocation space when serializing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comment Created 5 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/serialize.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698