Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
flutter::KernelIsolateConfiguration Class Reference
Inheritance diagram for flutter::KernelIsolateConfiguration:
flutter::IsolateConfiguration

Public Member Functions

 KernelIsolateConfiguration (std::unique_ptr< const fml::Mapping > kernel)
 
bool DoPrepareIsolate (DartIsolate &isolate) override
 
bool IsNullSafetyEnabled (const DartSnapshot &snapshot) override
 
- Public Member Functions inherited from flutter::IsolateConfiguration
 IsolateConfiguration ()
 Create an isolate configuration. This has no threading restrictions.
 
virtual ~IsolateConfiguration ()
 Destroys an isolate configuration. This has no threading restrictions and may be collection of configurations may occur on any thread (and usually happens on an internal VM managed thread pool thread).
 
bool PrepareIsolate (DartIsolate &isolate)
 When an isolate is created and sufficiently initialized to move it into the DartIsolate::Phase::LibrariesSetup phase, this method is invoked on the isolate to then move the isolate into the DartIsolate::Phase::Ready phase. Then isolate's main entrypoint is then invoked to move it into the DartIsolate::Phase::Running phase. This method will be called each time the root isolate is launched (which may be multiple times in cold-restart scenarios) as well as one each for any child isolates referenced by that isolate.
 

Additional Inherited Members

- Static Public Member Functions inherited from flutter::IsolateConfiguration
static std::unique_ptr< IsolateConfigurationInferFromSettings (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.
 
static std::unique_ptr< IsolateConfigurationCreateForAppSnapshot ()
 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.
 
static std::unique_ptr< IsolateConfigurationCreateForKernelList (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.
 
static std::unique_ptr< IsolateConfigurationCreateForKernel (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.
 
static std::unique_ptr< IsolateConfigurationCreateForKernelList (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.
 

Detailed Description

Definition at line 44 of file isolate_configuration.cc.

Constructor & Destructor Documentation

◆ KernelIsolateConfiguration()

flutter::KernelIsolateConfiguration::KernelIsolateConfiguration ( std::unique_ptr< const fml::Mapping kernel)
inlineexplicit

Definition at line 47 of file isolate_configuration.cc.

49 : kernel_(std::move(kernel)) {}

Member Function Documentation

◆ DoPrepareIsolate()

bool flutter::KernelIsolateConfiguration::DoPrepareIsolate ( DartIsolate isolate)
inlineoverridevirtual

Implements flutter::IsolateConfiguration.

Definition at line 52 of file isolate_configuration.cc.

52 {
54 return false;
55 }
56 return isolate.PrepareForRunningFromKernel(std::move(kernel_),
57 /*child_isolate=*/false,
58 /*last_piece=*/true);
59 }
static bool IsRunningPrecompiledCode()
Checks if VM instances in the process can run precompiled code. This call can be made at any time and...
Definition dart_vm.cc:205

◆ IsNullSafetyEnabled()

bool flutter::KernelIsolateConfiguration::IsNullSafetyEnabled ( const DartSnapshot snapshot)
inlineoverridevirtual

Implements flutter::IsolateConfiguration.

Definition at line 62 of file isolate_configuration.cc.

62 {
63 return snapshot.IsNullSafetyEnabled(kernel_.get());
64 }

The documentation for this class was generated from the following file: