[vm/embedder] Add documentation to Dart_CompileToKernel

Change-Id: Ic858a010f77a05c47430ce13d2bd7ef80535a538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133990
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
This commit is contained in:
Martin Kustermann 2020-01-31 15:03:42 +00:00 committed by commit-bot@chromium.org
parent 4e38df4255
commit 5ae5aff640

View file

@ -3211,6 +3211,27 @@ typedef struct {
DART_EXPORT bool Dart_IsKernelIsolate(Dart_Isolate isolate); DART_EXPORT bool Dart_IsKernelIsolate(Dart_Isolate isolate);
DART_EXPORT bool Dart_KernelIsolateIsRunning(); DART_EXPORT bool Dart_KernelIsolateIsRunning();
DART_EXPORT Dart_Port Dart_KernelPort(); DART_EXPORT Dart_Port Dart_KernelPort();
/**
* 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.
*
* \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.
*/
DART_EXPORT Dart_KernelCompilationResult DART_EXPORT Dart_KernelCompilationResult
Dart_CompileToKernel(const char* script_uri, Dart_CompileToKernel(const char* script_uri,
const uint8_t* platform_kernel, const uint8_t* platform_kernel,