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 20 matching lines...) Expand all Loading... |
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 void set_kernel_platform(void* kernel_platform) { | 34 void set_kernel_platform(void* kernel_platform) { |
35 kernel_platform_ = kernel_platform; | 35 kernel_platform_ = kernel_platform; |
36 } | 36 } |
37 | 37 |
38 bool kernel_file_specified() const { return kernel_file_specified_; } | 38 bool kernel_file_specified() const { return kernel_file_specified_; } |
39 void set_kernel_file_specified(bool value) { kernel_file_specified_ = value; } | 39 void set_kernel_file_specified(bool value) { kernel_file_specified_ = value; } |
40 | 40 |
41 // Method to reload a script into a running a isolate. | 41 // Method to read a kernel file into a kernel program blob. |
42 // If the specified script [url] is not a kernel IR, compile it first using | 42 // If the specified script [url] is not a kernel IR, compile it first using |
43 // DFE and then reload the resulting kernel IR into the isolate. | 43 // DFE and then read the resulting kernel file into a kernel program blob. |
44 // Returns Dart_Null if successful, otherwise an error object is returned. | 44 // Returns Dart_Null if successful, otherwise an error object is returned. |
45 Dart_Handle ReloadScript(Dart_Isolate isolate, const char* url_string); | 45 Dart_Handle ReadKernelBinary(Dart_Isolate isolate, const char* url_string); |
46 | 46 |
47 // Compiles a script and reads the resulting kernel file. | 47 // Compiles a script and reads the resulting kernel file. |
48 // If the compilation is successful, returns a valid in memory kernel | 48 // If the compilation is successful, returns a valid in memory kernel |
49 // representation of the script, NULL otherwise | 49 // representation of the script, NULL otherwise |
50 // 'error' and 'exit_code' have the error values in case of errors. | 50 // 'error' and 'exit_code' have the error values in case of errors. |
51 void* CompileAndReadScript(const char* script_uri, | 51 void* CompileAndReadScript(const char* script_uri, |
52 char** error, | 52 char** error, |
53 int* exit_code); | 53 int* exit_code); |
54 | 54 |
55 // Reads the platform kernel file. | 55 // Reads the platform kernel file. |
(...skipping 25 matching lines...) Expand all Loading... |
81 void* kernel_platform_; | 81 void* kernel_platform_; |
82 bool kernel_file_specified_; // Kernel file was specified on the cmd line. | 82 bool kernel_file_specified_; // Kernel file was specified on the cmd line. |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(DFE); | 84 DISALLOW_COPY_AND_ASSIGN(DFE); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace bin | 87 } // namespace bin |
88 } // namespace dart | 88 } // namespace dart |
89 | 89 |
90 #endif // RUNTIME_BIN_DFE_H_ | 90 #endif // RUNTIME_BIN_DFE_H_ |
OLD | NEW |