| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 // Wrapper around ScriptData to provide code-serializer-specific functionality. | 54 // Wrapper around ScriptData to provide code-serializer-specific functionality. |
| 55 class SerializedCodeData : public SerializedData { | 55 class SerializedCodeData : public SerializedData { |
| 56 public: | 56 public: |
| 57 // Used when consuming. | 57 // Used when consuming. |
| 58 static SerializedCodeData* FromCachedData(Isolate* isolate, | 58 static SerializedCodeData* FromCachedData(Isolate* isolate, |
| 59 ScriptData* cached_data, | 59 ScriptData* cached_data, |
| 60 String* source); | 60 String* source); |
| 61 | 61 |
| 62 // Used when producing. | 62 // Used when producing. |
| 63 SerializedCodeData(const List<byte>& payload, const CodeSerializer& cs); | 63 SerializedCodeData(const List<byte>* payload, const CodeSerializer* cs); |
| 64 | 64 |
| 65 // Return ScriptData object and relinquish ownership over it to the caller. | 65 // Return ScriptData object and relinquish ownership over it to the caller. |
| 66 ScriptData* GetScriptData(); | 66 ScriptData* GetScriptData(); |
| 67 | 67 |
| 68 Vector<const Reservation> Reservations() const; | 68 Vector<const Reservation> Reservations() const; |
| 69 Vector<const byte> Payload() const; | 69 Vector<const byte> Payload() const; |
| 70 | 70 |
| 71 Vector<const uint32_t> CodeStubKeys() const; | 71 Vector<const uint32_t> CodeStubKeys() const; |
| 72 | 72 |
| 73 private: | 73 private: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 110 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
| 111 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 111 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
| 112 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 112 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
| 113 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 113 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace internal | 116 } // namespace internal |
| 117 } // namespace v8 | 117 } // namespace v8 |
| 118 | 118 |
| 119 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ | 119 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ |
| OLD | NEW |