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

Unified Diff: src/serialize.h

Issue 909473002: Add hash fields to code cache header. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test case 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flags.cc ('k') | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.h
diff --git a/src/serialize.h b/src/serialize.h
index 9aaf38182db6ea28383fbfd8cb1ff72897d262f7..444e881e25b23b596b595a3f8504e55087724b31 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -494,12 +494,12 @@ class SerializedData {
class IsLastChunkBits : public BitField<bool, 31, 1> {};
protected:
- void SetHeaderValue(int offset, int value) {
- memcpy(reinterpret_cast<int*>(data_) + offset, &value, sizeof(value));
+ void SetHeaderValue(int offset, uint32_t value) {
+ memcpy(reinterpret_cast<uint32_t*>(data_) + offset, &value, sizeof(value));
}
- int GetHeaderValue(int offset) const {
- int value;
+ uint32_t GetHeaderValue(int offset) const {
+ uint32_t value;
memcpy(&value, reinterpret_cast<int*>(data_) + offset, sizeof(value));
return value;
}
@@ -948,19 +948,25 @@ class SerializedCodeData : public SerializedData {
bool IsSane(String* source);
- int CheckSum(String* source);
+ uint32_t SourceHash(String* source) { return source->length(); }
// The data header consists of int-sized entries:
// [0] version hash
- // [1] number of internalized strings
- // [2] number of code stub keys
- // [3] number of reservation size entries
- // [4] payload length
- static const int kCheckSumOffset = 0;
- static const int kNumInternalizedStringsOffset = 1;
- static const int kReservationsOffset = 2;
- static const int kNumCodeStubKeysOffset = 3;
- static const int kPayloadLengthOffset = 4;
+ // [1] source hash
+ // [2] cpu features
+ // [3] flag hash
+ // [4] number of internalized strings
+ // [5] number of code stub keys
+ // [6] number of reservation size entries
+ // [7] payload length
+ static const int kVersionHashOffset = 0;
+ static const int kSourceHashOffset = 1;
+ static const int kCpuFeaturesOffset = 2;
+ static const int kFlagHashOffset = 3;
+ static const int kNumInternalizedStringsOffset = 4;
+ static const int kReservationsOffset = 5;
+ static const int kNumCodeStubKeysOffset = 6;
+ static const int kPayloadLengthOffset = 7;
static const int kHeaderSize = (kPayloadLengthOffset + 1) * kIntSize;
};
} } // namespace v8::internal
« no previous file with comments | « src/flags.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698