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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 // Return ScriptData object and relinquish ownership over it to the caller. | 107 // Return ScriptData object and relinquish ownership over it to the caller. |
108 ScriptData* GetScriptData(); | 108 ScriptData* GetScriptData(); |
109 | 109 |
110 Vector<const Reservation> Reservations() const; | 110 Vector<const Reservation> Reservations() const; |
111 Vector<const byte> Payload() const; | 111 Vector<const byte> Payload() const; |
112 | 112 |
113 Vector<const uint32_t> CodeStubKeys() const; | 113 Vector<const uint32_t> CodeStubKeys() const; |
114 | 114 |
115 static uint32_t SourceHash(Handle<String> source); | 115 static uint32_t SourceHash(Handle<String> source); |
| 116 static void InvalidateVersionForTest(byte* buffer, size_t buffer_size); |
116 | 117 |
117 private: | 118 private: |
118 explicit SerializedCodeData(ScriptData* data); | 119 explicit SerializedCodeData(ScriptData* data); |
119 SerializedCodeData(const byte* data, int size) | 120 SerializedCodeData(const byte* data, int size) |
120 : SerializedData(const_cast<byte*>(data), size) {} | 121 : SerializedData(const_cast<byte*>(data), size) {} |
121 | 122 |
122 Vector<const byte> DataWithoutHeader() const { | 123 Vector<const byte> DataWithoutHeader() const { |
123 return Vector<const byte>(data_ + kHeaderSize, size_ - kHeaderSize); | 124 return Vector<const byte>(data_ + kHeaderSize, size_ - kHeaderSize); |
124 } | 125 } |
125 | 126 |
(...skipping 22 matching lines...) Expand all Loading... |
148 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 149 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
149 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 150 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
150 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 151 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
151 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 152 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
152 }; | 153 }; |
153 | 154 |
154 } // namespace internal | 155 } // namespace internal |
155 } // namespace v8 | 156 } // namespace v8 |
156 | 157 |
157 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ | 158 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ |
OLD | NEW |