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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 private: | 974 private: |
975 explicit SerializedCodeData(ScriptData* data); | 975 explicit SerializedCodeData(ScriptData* data); |
976 | 976 |
977 enum SanityCheckResult { | 977 enum SanityCheckResult { |
978 CHECK_SUCCESS = 0, | 978 CHECK_SUCCESS = 0, |
979 MAGIC_NUMBER_MISMATCH = 1, | 979 MAGIC_NUMBER_MISMATCH = 1, |
980 VERSION_MISMATCH = 2, | 980 VERSION_MISMATCH = 2, |
981 SOURCE_MISMATCH = 3, | 981 SOURCE_MISMATCH = 3, |
982 CPU_FEATURES_MISMATCH = 4, | 982 CPU_FEATURES_MISMATCH = 4, |
983 FLAGS_MISMATCH = 5, | 983 FLAGS_MISMATCH = 5, |
984 CHECKSUM_MISMATCH = 6, | 984 CHECKSUM_MISMATCH = 6 |
985 }; | 985 }; |
986 | 986 |
987 SanityCheckResult SanityCheck(String* source) const; | 987 SanityCheckResult SanityCheck(String* source) const; |
988 | 988 |
989 uint32_t SourceHash(String* source) const { return source->length(); } | 989 uint32_t SourceHash(String* source) const { return source->length(); } |
990 | 990 |
991 static const uint32_t kMagicNumber = 0xC0D1F1ED; | 991 static const uint32_t kMagicNumber = 0xC0D1F1ED; |
992 | 992 |
993 // The data header consists of uint32_t-sized entries: | 993 // The data header consists of uint32_t-sized entries: |
994 // [ 0] magic number | 994 // [ 0] magic number |
(...skipping 20 matching lines...) Expand all Loading... |
1015 kNumInternalizedStringsOffset + kInt32Size; | 1015 kNumInternalizedStringsOffset + kInt32Size; |
1016 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; | 1016 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; |
1017 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 1017 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
1018 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 1018 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
1019 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 1019 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
1020 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 1020 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
1021 }; | 1021 }; |
1022 } } // namespace v8::internal | 1022 } } // namespace v8::internal |
1023 | 1023 |
1024 #endif // V8_SERIALIZE_H_ | 1024 #endif // V8_SERIALIZE_H_ |
OLD | NEW |