OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef RUNTIME_BIN_SNAPSHOT_UTILS_H_ | 5 #ifndef RUNTIME_BIN_SNAPSHOT_UTILS_H_ |
6 #define RUNTIME_BIN_SNAPSHOT_UTILS_H_ | 6 #define RUNTIME_BIN_SNAPSHOT_UTILS_H_ |
7 | 7 |
8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
11 namespace bin { | 11 namespace bin { |
12 | 12 |
| 13 class AppSnapshot { |
| 14 public: |
| 15 virtual ~AppSnapshot() {} |
| 16 |
| 17 virtual void SetBuffers(const uint8_t** vm_data_buffer, |
| 18 const uint8_t** vm_instructions_buffer, |
| 19 const uint8_t** isolate_data_buffer, |
| 20 const uint8_t** isolate_instructions_buffer) = 0; |
| 21 |
| 22 protected: |
| 23 AppSnapshot() {} |
| 24 |
| 25 private: |
| 26 DISALLOW_COPY_AND_ASSIGN(AppSnapshot); |
| 27 }; |
| 28 |
13 class Snapshot { | 29 class Snapshot { |
14 public: | 30 public: |
15 static void GenerateScript(const char* snapshot_filename); | 31 static void GenerateScript(const char* snapshot_filename); |
16 static void GenerateAppJIT(const char* snapshot_filename); | 32 static void GenerateAppJIT(const char* snapshot_filename); |
17 static void GenerateAppAOTAsBlobs(const char* snapshot_filename); | 33 static void GenerateAppAOTAsBlobs(const char* snapshot_filename); |
18 static void GenerateAppAOTAsAssembly(const char* snapshot_filename); | 34 static void GenerateAppAOTAsAssembly(const char* snapshot_filename); |
19 | 35 |
20 static bool ReadAppSnapshot(const char* script_name, | 36 static AppSnapshot* TryReadAppSnapshot(const char* script_name); |
21 const uint8_t** vm_data_buffer, | |
22 const uint8_t** vm_instructions_buffer, | |
23 const uint8_t** isolate_data_buffer, | |
24 const uint8_t** isolate_instructions_buffer); | |
25 | 37 |
26 private: | 38 private: |
27 DISALLOW_ALLOCATION(); | 39 DISALLOW_ALLOCATION(); |
28 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); | 40 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); |
29 }; | 41 }; |
30 | 42 |
31 } // namespace bin | 43 } // namespace bin |
32 } // namespace dart | 44 } // namespace dart |
33 | 45 |
34 #endif // RUNTIME_BIN_SNAPSHOT_UTILS_H_ | 46 #endif // RUNTIME_BIN_SNAPSHOT_UTILS_H_ |
OLD | NEW |