Chromium Code Reviews| Index: src/snapshot/code-serializer.h |
| diff --git a/src/snapshot/code-serializer.h b/src/snapshot/code-serializer.h |
| index 4d87a731f7587a1462fc506fbe440251762a948a..d290cf9c4b1cf117c30128190c951242983d87b9 100644 |
| --- a/src/snapshot/code-serializer.h |
| +++ b/src/snapshot/code-serializer.h |
| @@ -85,24 +85,27 @@ class SerializedCodeData : public SerializedData { |
| CPU_FEATURES_MISMATCH = 4, |
| FLAGS_MISMATCH = 5, |
| CHECKSUM_MISMATCH = 6, |
| - INVALID_HEADER = 7 |
| + INVALID_HEADER = 7, |
| + LENGTH_MISMATCH = 8 |
| }; |
| // The data header consists of uint32_t-sized entries: |
| - // [0] magic number and external reference count |
| - // [1] version hash |
| - // [2] source hash |
| - // [3] cpu features |
| - // [4] flag hash |
| - // [5] number of code stub keys |
| - // [6] number of reservation size entries |
| - // [7] payload length |
| - // [8] payload checksum part 1 |
| - // [9] payload checksum part 2 |
| + // [0] magic number and (internally provided) external reference count |
| + // [1] extra (API-provided) external reference count |
| + // [2] version hash |
| + // [3] source hash |
| + // [4] cpu features |
| + // [5] flag hash |
| + // [6] number of code stub keys |
| + // [7] number of reservation size entries |
| + // [8] payload length |
| + // [9] payload checksum part 1 |
| + // [10] payload checksum part 2 |
| // ... reservations |
| // ... code stub keys |
| // ... serialized payload |
| - static const int kVersionHashOffset = kMagicNumberOffset + kInt32Size; |
| + static const int kVersionHashOffset = |
| + kExtraExternalReferencesOffset + kInt32Size; |
| static const int kSourceHashOffset = kVersionHashOffset + kInt32Size; |
| static const int kCpuFeaturesOffset = kSourceHashOffset + kInt32Size; |
| static const int kFlagHashOffset = kCpuFeaturesOffset + kInt32Size; |
| @@ -137,7 +140,8 @@ class SerializedCodeData : public SerializedData { |
| : SerializedData(const_cast<byte*>(data), size) {} |
| Vector<const byte> DataWithoutHeader() const { |
| - return Vector<const byte>(data_ + kHeaderSize, size_ - kHeaderSize); |
| + const int kPaddedStart = POINTER_SIZE_ALIGN(kHeaderSize); |
|
Yang
2017/03/07 11:28:11
Let's define kHeaderSize to be padded. Also see re
Jakob Kummerow
2017/03/07 12:39:15
Done.
|
| + return Vector<const byte>(data_ + kPaddedStart, size_ - kPaddedStart); |
| } |
| SanityCheckResult SanityCheck(Isolate* isolate, |