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

Side by Side Diff: src/snapshot/code-serializer.h

Issue 2237883002: [serializer] checksum a larger part of the code snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . Created 4 years, 4 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/snapshot/code-serializer.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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_SNAPSHOT_CODE_SERIALIZER_H_ 5 #ifndef V8_SNAPSHOT_CODE_SERIALIZER_H_
6 #define V8_SNAPSHOT_CODE_SERIALIZER_H_ 6 #define V8_SNAPSHOT_CODE_SERIALIZER_H_
7 7
8 #include "src/parsing/preparse-data.h" 8 #include "src/parsing/preparse-data.h"
9 #include "src/snapshot/serializer.h" 9 #include "src/snapshot/serializer.h"
10 10
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 Vector<const uint32_t> CodeStubKeys() const; 109 Vector<const uint32_t> CodeStubKeys() const;
110 110
111 static uint32_t SourceHash(Handle<String> source); 111 static uint32_t SourceHash(Handle<String> source);
112 112
113 private: 113 private:
114 explicit SerializedCodeData(ScriptData* data); 114 explicit SerializedCodeData(ScriptData* data);
115 SerializedCodeData(const byte* data, int size) 115 SerializedCodeData(const byte* data, int size)
116 : SerializedData(const_cast<byte*>(data), size) {} 116 : SerializedData(const_cast<byte*>(data), size) {}
117 117
118 Vector<const byte> DataWithoutHeader() const {
119 return Vector<const byte>(data_ + kHeaderSize, size_ - kHeaderSize);
120 }
121
118 SanityCheckResult SanityCheck(Isolate* isolate, 122 SanityCheckResult SanityCheck(Isolate* isolate,
119 uint32_t expected_source_hash) const; 123 uint32_t expected_source_hash) const;
120 // The data header consists of uint32_t-sized entries: 124 // The data header consists of uint32_t-sized entries:
121 // [0] magic number and external reference count 125 // [0] magic number and external reference count
122 // [1] version hash 126 // [1] version hash
123 // [2] source hash 127 // [2] source hash
124 // [3] cpu features 128 // [3] cpu features
125 // [4] flag hash 129 // [4] flag hash
126 // [5] number of code stub keys 130 // [5] number of code stub keys
127 // [6] number of reservation size entries 131 // [6] number of reservation size entries
(...skipping 12 matching lines...) Expand all
140 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; 144 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size;
141 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; 145 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size;
142 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; 146 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size;
143 static const int kHeaderSize = kChecksum2Offset + kInt32Size; 147 static const int kHeaderSize = kChecksum2Offset + kInt32Size;
144 }; 148 };
145 149
146 } // namespace internal 150 } // namespace internal
147 } // namespace v8 151 } // namespace v8
148 152
149 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ 153 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_
OLDNEW
« no previous file with comments | « no previous file | src/snapshot/code-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698