pub unsafe extern "C" fn Dart_CompileToKernel(
    script_uri: *const c_char,
    platform_kernel: *const u8,
    platform_kernel_size: isize,
    incremental_compile: bool,
    snapshot_compile: bool,
    embed_sources: bool,
    package_config: *const c_char,
    verbosity: Dart_KernelCompilationVerbosityLevel
) -> Dart_KernelCompilationResult
Expand description

Compiles the given script_uri to a kernel file.

\param platform_kernel A buffer containing the kernel of the platform (e.g. vm_platform_strong.dill). The VM does not take ownership of this memory.

\param platform_kernel_size The length of the platform_kernel buffer.

\param snapshot_compile Set to true when the compilation is for a snapshot. This is used by the frontend to determine if compilation related information should be printed to console (e.g., null safety mode).

\param embed_sources Set to true when sources should be embedded in the kernel file.

\param verbosity Specifies the logging behavior of the kernel compilation service.

\return Returns the result of the compilation.

On a successful compilation the returned Dart_KernelCompilationResult has a status of [Dart_KernelCompilationStatus_Ok] and the kernel/kernel_size fields are set. The caller takes ownership of the malloc()ed buffer.

On a failed compilation the error might be set describing the reason for the failed compilation. The caller takes ownership of the malloc()ed error.

Requires there to be a current isolate.