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_DFE_H_ | 5 #ifndef RUNTIME_BIN_DFE_H_ |
6 #define RUNTIME_BIN_DFE_H_ | 6 #define RUNTIME_BIN_DFE_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 void SetKernelBinaries(const char* name); | 29 void SetKernelBinaries(const char* name); |
30 | 30 |
31 bool UsePlatformBinary() const { return platform_binary_filename_ != NULL; } | 31 bool UsePlatformBinary() const { return platform_binary_filename_ != NULL; } |
32 | 32 |
33 void* kernel_platform() const { return kernel_platform_; } | 33 void* kernel_platform() const { return kernel_platform_; } |
34 | 34 |
35 void* kernel_vmservice_io() const { return kernel_vmservice_io_; } | 35 void* kernel_vmservice_io() const { return kernel_vmservice_io_; } |
36 | 36 |
| 37 bool kernel_file_specified() const { return kernel_file_specified_; } |
| 38 void set_kernel_file_specified(bool value) { kernel_file_specified_ = value; } |
| 39 |
37 // Method to reload a script into a running a isolate. | 40 // Method to reload a script into a running a isolate. |
38 // If the specified script [url] is not a kernel IR, compile it first using | 41 // If the specified script [url] is not a kernel IR, compile it first using |
39 // DFE and then reload the resulting kernel IR into the isolate. | 42 // DFE and then reload the resulting kernel IR into the isolate. |
40 // Returns Dart_Null if successful, otherwise an error object is returned. | 43 // Returns Dart_Null if successful, otherwise an error object is returned. |
41 Dart_Handle ReloadScript(Dart_Isolate isolate, const char* url_string); | 44 Dart_Handle ReloadScript(Dart_Isolate isolate, const char* url_string); |
42 | 45 |
43 // Compiles a script and reads the resulting kernel file. | 46 // Compiles a script and reads the resulting kernel file. |
44 // If the compilation is successful, returns a valid in memory kernel | 47 // If the compilation is successful, returns a valid in memory kernel |
45 // representation of the script, NULL otherwise | 48 // representation of the script, NULL otherwise |
46 // 'error' and 'exit_code' have the error values in case of errors. | 49 // 'error' and 'exit_code' have the error values in case of errors. |
(...skipping 22 matching lines...) Expand all Loading... |
69 // was returned. | 72 // was returned. |
70 bool TryReadKernelFile(const char* script_uri, | 73 bool TryReadKernelFile(const char* script_uri, |
71 const uint8_t** kernel_ir, | 74 const uint8_t** kernel_ir, |
72 intptr_t* kernel_ir_size); | 75 intptr_t* kernel_ir_size); |
73 | 76 |
74 const char* frontend_filename_; | 77 const char* frontend_filename_; |
75 char* platform_binary_filename_; | 78 char* platform_binary_filename_; |
76 char* vmservice_io_binary_filename_; | 79 char* vmservice_io_binary_filename_; |
77 void* kernel_platform_; | 80 void* kernel_platform_; |
78 void* kernel_vmservice_io_; | 81 void* kernel_vmservice_io_; |
| 82 bool kernel_file_specified_; // Kernel file was specified on the cmd line. |
79 | 83 |
80 DISALLOW_COPY_AND_ASSIGN(DFE); | 84 DISALLOW_COPY_AND_ASSIGN(DFE); |
81 }; | 85 }; |
82 | 86 |
83 } // namespace bin | 87 } // namespace bin |
84 } // namespace dart | 88 } // namespace dart |
85 | 89 |
86 #endif // RUNTIME_BIN_DFE_H_ | 90 #endif // RUNTIME_BIN_DFE_H_ |
OLD | NEW |