Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: runtime/bin/dfe.h

Issue 3002733002: [vm,aot,kernel] Fix AOT snapshot creation with kernel front-end (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/bin/dfe.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 24
25 const char* platform_binary_filename() const { 25 const char* platform_binary_filename() const {
26 return platform_binary_filename_; 26 return platform_binary_filename_;
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 void set_kernel_platform(void* kernel_platform) {
35 void* kernel_vmservice_io() const { return kernel_vmservice_io_; } 35 kernel_platform_ = kernel_platform;
36 36 }
37 void clear_kernel_vmservice_io();
38 37
39 bool kernel_file_specified() const { return kernel_file_specified_; } 38 bool kernel_file_specified() const { return kernel_file_specified_; }
40 void set_kernel_file_specified(bool value) { kernel_file_specified_ = value; } 39 void set_kernel_file_specified(bool value) { kernel_file_specified_ = value; }
41 40
42 // Method to reload a script into a running a isolate. 41 // Method to reload a script into a running a isolate.
43 // 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
44 // DFE and then reload the resulting kernel IR into the isolate. 43 // DFE and then reload the resulting kernel IR into the isolate.
45 // Returns Dart_Null if successful, otherwise an error object is returned. 44 // Returns Dart_Null if successful, otherwise an error object is returned.
46 Dart_Handle ReloadScript(Dart_Isolate isolate, const char* url_string); 45 Dart_Handle ReloadScript(Dart_Isolate isolate, const char* url_string);
47 46
48 // Compiles a script and reads the resulting kernel file. 47 // Compiles a script and reads the resulting kernel file.
49 // If the compilation is successful, returns a valid in memory kernel 48 // If the compilation is successful, returns a valid in memory kernel
50 // representation of the script, NULL otherwise 49 // representation of the script, NULL otherwise
51 // '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.
52 void* CompileAndReadScript(const char* script_uri, 51 void* CompileAndReadScript(const char* script_uri,
53 char** error, 52 char** error,
54 int* exit_code); 53 int* exit_code);
55 54
56 // Reads the platform kernel file. 55 // Reads the platform kernel file.
57 // Returns an in memory kernel representation of the platform kernel file. 56 // Returns an in memory kernel representation of the platform kernel file.
58 void* ReadPlatform(); 57 void* ReadPlatform() const;
59 58
60 // Reads the vmservice_io kernel file. 59 // Reads the vmservice_io kernel file.
61 // Returns the in memory representation of the vmservice_io kernel file. 60 // Returns the in memory representation of the vmservice_io kernel file.
62 void* ReadVMServiceIO(); 61 void* ReadVMServiceIO() const;
63 62
64 // Reads the script kernel file if specified 'script_uri' is a kernel file. 63 // Reads the script kernel file if specified 'script_uri' is a kernel file.
65 // Returns an in memory kernel representation of the specified script is a 64 // Returns an in memory kernel representation of the specified script is a
66 // valid kernel file, false otherwise. 65 // valid kernel file, false otherwise.
67 void* ReadScript(const char* script_uri); 66 void* ReadScript(const char* script_uri) const;
68 67
69 private: 68 private:
70 // Tries to read [script_uri] as a Kernel IR file. 69 // Tries to read [script_uri] as a Kernel IR file.
71 // Returns `true` if successful and sets [kernel_file] and [kernel_length] 70 // Returns `true` if successful and sets [kernel_file] and [kernel_length]
72 // to be the kernel IR contents. 71 // to be the kernel IR contents.
73 // The caller is responsible for free()ing [kernel_file] if `true` 72 // The caller is responsible for free()ing [kernel_file] if `true`
74 // was returned. 73 // was returned.
75 bool TryReadKernelFile(const char* script_uri, 74 bool TryReadKernelFile(const char* script_uri,
76 const uint8_t** kernel_ir, 75 const uint8_t** kernel_ir,
77 intptr_t* kernel_ir_size); 76 intptr_t* kernel_ir_size) const;
78 77
79 const char* frontend_filename_; 78 const char* frontend_filename_;
80 char* platform_binary_filename_; 79 char* platform_binary_filename_;
81 char* vmservice_io_binary_filename_; 80 char* vmservice_io_binary_filename_;
82 void* kernel_platform_; 81 void* kernel_platform_;
83 void* kernel_vmservice_io_;
84 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.
85 83
86 DISALLOW_COPY_AND_ASSIGN(DFE); 84 DISALLOW_COPY_AND_ASSIGN(DFE);
87 }; 85 };
88 86
89 } // namespace bin 87 } // namespace bin
90 } // namespace dart 88 } // namespace dart
91 89
92 #endif // RUNTIME_BIN_DFE_H_ 90 #endif // RUNTIME_BIN_DFE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/dfe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698