OLD | NEW |
---|---|
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 // Wrapper around ScriptData to provide code-serializer-specific functionality. | 85 // Wrapper around ScriptData to provide code-serializer-specific functionality. |
86 class SerializedCodeData : public SerializedData { | 86 class SerializedCodeData : public SerializedData { |
87 public: | 87 public: |
88 enum SanityCheckResult { | 88 enum SanityCheckResult { |
89 CHECK_SUCCESS = 0, | 89 CHECK_SUCCESS = 0, |
90 MAGIC_NUMBER_MISMATCH = 1, | 90 MAGIC_NUMBER_MISMATCH = 1, |
91 VERSION_MISMATCH = 2, | 91 VERSION_MISMATCH = 2, |
92 SOURCE_MISMATCH = 3, | 92 SOURCE_MISMATCH = 3, |
93 CPU_FEATURES_MISMATCH = 4, | 93 CPU_FEATURES_MISMATCH = 4, |
94 FLAGS_MISMATCH = 5, | 94 FLAGS_MISMATCH = 5, |
95 CHECKSUM_MISMATCH = 6 | 95 CHECKSUM_MISMATCH = 6, |
96 INVALID_HEADER = 7 | |
Yang
2016/10/06 07:35:34
Don't forget to add this item to chromium/src/tool
Mircea Trofin
2016/10/06 16:17:47
Acknowledged. Didn't know about that entire area,
| |
96 }; | 97 }; |
97 | 98 |
98 // Used when consuming. | 99 // Used when consuming. |
99 static const SerializedCodeData FromCachedData( | 100 static const SerializedCodeData FromCachedData( |
100 Isolate* isolate, ScriptData* cached_data, uint32_t expected_source_hash, | 101 Isolate* isolate, ScriptData* cached_data, uint32_t expected_source_hash, |
101 SanityCheckResult* rejection_result); | 102 SanityCheckResult* rejection_result); |
102 | 103 |
103 // Used when producing. | 104 // Used when producing. |
104 SerializedCodeData(const List<byte>* payload, const CodeSerializer* cs); | 105 SerializedCodeData(const List<byte>* payload, const CodeSerializer* cs); |
105 | 106 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 148 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
148 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 149 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
149 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 150 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
150 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 151 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
151 }; | 152 }; |
152 | 153 |
153 } // namespace internal | 154 } // namespace internal |
154 } // namespace v8 | 155 } // namespace v8 |
155 | 156 |
156 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ | 157 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ |
OLD | NEW |