|
static std::unique_ptr< IsolateConfiguration > | InferFromSettings (const Settings &settings, const std::shared_ptr< AssetManager > &asset_manager=nullptr, const fml::RefPtr< fml::TaskRunner > &io_worker=nullptr, IsolateLaunchType launch_type=IsolateLaunchType::kNewGroup) |
| Attempts to infer the isolate configuration from the Settings object. If the VM is configured for AOT mode, snapshot resolution is attempted with predefined symbols present in the currently loaded process. In JIT mode, Dart kernel file resolution is attempted in the assets directory. If an IO worker is specified, snapshot resolution may be attempted on the serial worker task runner. The worker task runner thread must remain valid and running till after the shell associated with the engine used to launch the isolate for which this run configuration is used is collected. More...
|
|
static std::unique_ptr< IsolateConfiguration > | CreateForAppSnapshot () |
| Creates an AOT isolate configuration using snapshot symbols present in the currently loaded process. These symbols need to be given to the Dart VM on bootstrap and hence have already been resolved. More...
|
|
static std::unique_ptr< IsolateConfiguration > | CreateForKernelList (std::vector< std::future< std::unique_ptr< const fml::Mapping > > > kernel_pieces) |
| Creates a JIT isolate configuration using a list of futures to snapshots defining the ready isolate state. In environments where snapshot resolution is extremely expensive, embedders attempt to resolve snapshots on worker thread(s) and return the future of the promise of snapshot resolution to this method. That way, snapshot resolution begins well before isolate launch is attempted by the engine. More...
|
|
static std::unique_ptr< IsolateConfiguration > | CreateForKernel (std::unique_ptr< const fml::Mapping > kernel) |
| Creates a JIT isolate configuration using the specified snapshot. This is a convenience method for the CreateForKernelList method that takes a list of futures to Dart kernel snapshots. More...
|
|
static std::unique_ptr< IsolateConfiguration > | CreateForKernelList (std::vector< std::unique_ptr< const fml::Mapping > > kernel_pieces) |
| Creates a JIT isolate configuration using the specified snapshots. This is a convenience method for the CreateForKernelList method that takes a list of futures to Dart kernel snapshots. More...
|
|
virtual bool | DoPrepareIsolate (DartIsolate &isolate)=0 |
|
Definition at line 72 of file isolate_configuration.cc.
◆ KernelListIsolateConfiguration()
flutter::KernelListIsolateConfiguration::KernelListIsolateConfiguration |
( |
std::vector< std::future< std::unique_ptr< const fml::Mapping > > > |
kernel_pieces | ) |
|
|
inlineexplicit |
Definition at line 74 of file isolate_configuration.cc.
77 : kernel_piece_futures_(std::move(kernel_pieces)) {
78 if (kernel_piece_futures_.empty()) {
79 FML_LOG(
ERROR) <<
"Attempted to create kernel list configuration without "
80 "any kernel blobs.";
81 }
82 }
#define FML_LOG(severity)
◆ DoPrepareIsolate()
bool flutter::KernelListIsolateConfiguration::DoPrepareIsolate |
( |
DartIsolate & |
isolate | ) |
|
|
inlineoverridevirtual |
Implements flutter::IsolateConfiguration.
Definition at line 85 of file isolate_configuration.cc.
85 {
87 return false;
88 }
89
91
92 if (resolved_kernel_pieces_.empty()) {
93 FML_DLOG(
ERROR) <<
"No kernel pieces provided to prepare this isolate.";
94 return false;
95 }
96
97 for (
size_t i = 0;
i < resolved_kernel_pieces_.size();
i++) {
98 if (!resolved_kernel_pieces_[
i]) {
99 FML_DLOG(
ERROR) <<
"This kernel list isolate configuration was already "
100 "used to prepare an isolate.";
101 return false;
102 }
103 const bool last_piece =
i + 1 == resolved_kernel_pieces_.size();
104 if (!isolate.PrepareForRunningFromKernel(
105 std::move(resolved_kernel_pieces_[
i]),
false,
106 last_piece)) {
107 return false;
108 }
109 }
110
111 return true;
112 }
static bool IsRunningPrecompiledCode()
Checks if VM instances in the process can run precompiled code. This call can be made at any time and...
void ResolveKernelPiecesIfNecessary()
#define FML_DLOG(severity)
◆ IsNullSafetyEnabled()
bool flutter::KernelListIsolateConfiguration::IsNullSafetyEnabled |
( |
const DartSnapshot & |
snapshot | ) |
|
|
inlineoverridevirtual |
◆ ResolveKernelPiecesIfNecessary()
void flutter::KernelListIsolateConfiguration::ResolveKernelPiecesIfNecessary |
( |
| ) |
|
|
inline |
Definition at line 127 of file isolate_configuration.cc.
127 {
128 if (resolved_kernel_pieces_.size() == kernel_piece_futures_.size()) {
129 return;
130 }
131
132 resolved_kernel_pieces_.clear();
133 for (auto& piece : kernel_piece_futures_) {
134
135
136 resolved_kernel_pieces_.emplace_back(piece.get());
137 }
138 }
The documentation for this class was generated from the following file: