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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 static const int kFlagHashOffset = kCpuFeaturesOffset + kInt32Size; | 109 static const int kFlagHashOffset = kCpuFeaturesOffset + kInt32Size; |
110 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; | 110 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; |
111 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; | 111 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; |
112 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 112 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
113 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 113 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
114 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 114 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
115 static const int kUnalignedHeaderSize = kChecksum2Offset + kInt32Size; | 115 static const int kUnalignedHeaderSize = kChecksum2Offset + kInt32Size; |
116 static const int kHeaderSize = POINTER_SIZE_ALIGN(kUnalignedHeaderSize); | 116 static const int kHeaderSize = POINTER_SIZE_ALIGN(kUnalignedHeaderSize); |
117 | 117 |
118 // Used when consuming. | 118 // Used when consuming. |
119 static const SerializedCodeData FromCachedData( | 119 static SerializedCodeData FromCachedData(Isolate* isolate, |
120 Isolate* isolate, ScriptData* cached_data, uint32_t expected_source_hash, | 120 ScriptData* cached_data, |
121 SanityCheckResult* rejection_result); | 121 uint32_t expected_source_hash, |
| 122 SanityCheckResult* rejection_result); |
122 | 123 |
123 // Used when producing. | 124 // Used when producing. |
124 SerializedCodeData(const List<byte>* payload, const CodeSerializer* cs); | 125 SerializedCodeData(const List<byte>* payload, const CodeSerializer* cs); |
125 | 126 |
126 // Return ScriptData object and relinquish ownership over it to the caller. | 127 // Return ScriptData object and relinquish ownership over it to the caller. |
127 ScriptData* GetScriptData(); | 128 ScriptData* GetScriptData(); |
128 | 129 |
129 Vector<const Reservation> Reservations() const; | 130 Vector<const Reservation> Reservations() const; |
130 Vector<const byte> Payload() const; | 131 Vector<const byte> Payload() const; |
131 | 132 |
(...skipping 11 matching lines...) Expand all Loading... |
143 } | 144 } |
144 | 145 |
145 SanityCheckResult SanityCheck(Isolate* isolate, | 146 SanityCheckResult SanityCheck(Isolate* isolate, |
146 uint32_t expected_source_hash) const; | 147 uint32_t expected_source_hash) const; |
147 }; | 148 }; |
148 | 149 |
149 } // namespace internal | 150 } // namespace internal |
150 } // namespace v8 | 151 } // namespace v8 |
151 | 152 |
152 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ | 153 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ |
OLD | NEW |