24#if !defined(DART_PRECOMPILED_RUNTIME)
30 ASSERT(isolate_data !=
nullptr);
38 const char* working_directory,
39 const char* root_script_uri) {
40 const int kNumArgs = 3;
42 dart_args[0] = (packages_file ==
nullptr)
46 dart_args[2] = (root_script_uri ==
nullptr)
53#if !defined(DART_PRECOMPILED_RUNTIME)
58 intptr_t kernel_buffer_size) {
72 const char* url_string =
nullptr;
82 const char* library_url_string =
nullptr;
89 if (is_dart_scheme_url || is_dart_library) {
100 __FUNCTION__, url_cstr);
105#if !defined(DART_PRECOMPILED_RUNTIME)
107 uint8_t* kernel_buffer =
nullptr;
108 intptr_t kernel_buffer_size = 0;
110 &kernel_buffer_size)) {
118 char*
error =
nullptr;
120 uint8_t* kernel_buffer =
nullptr;
121 intptr_t kernel_buffer_size = -1;
123 &
error, &exit_code,
nullptr,
125 if (exit_code == 0) {
148 auto isolate_group_data =
151 "%s-%" Pd ".part.so", isolate_group_data->script_url, loading_unit_id);
155 if (loading_unit_snapshot !=
nullptr) {
156 isolate_group_data->AddLoadingUnit(loading_unit_snapshot);
159 const uint8_t* ignore_vm_snapshot_data;
160 const uint8_t* ignore_vm_snapshot_instructions;
162 &ignore_vm_snapshot_data, &ignore_vm_snapshot_instructions,
172 char* error_message =
Utils::SCreate(
"Failed to load %s", unit_url);
static char * SCreate(const char *format,...) PRINTF_ATTRIBUTE(1
virtual void SetBuffers(const uint8_t **vm_data_buffer, const uint8_t **vm_instructions_buffer, const uint8_t **isolate_data_buffer, const uint8_t **isolate_instructions_buffer)=0
bool TryReadKernelFile(const char *script_uri, const AppSnapshot *app_snapshot, uint8_t **kernel_buffer, intptr_t *kernel_buffer_size, bool decode_uri=true, std::shared_ptr< uint8_t > *kernel_blob_ptr=nullptr)
void CompileAndReadScript(const char *script_uri, uint8_t **kernel_buffer, intptr_t *kernel_buffer_size, char **error, int *exit_code, const char *package_config, bool for_snapshot, bool embed_sources)
bool CanUseDartFrontend() const
bool UseDartFrontend() const
static Dart_Handle LookupBuiltinLib()
static const char * original_working_directory
static Dart_Handle NewError(const char *format,...)
static Dart_Handle NewString(const char *str)
static bool IsDartSchemeURL(const char *url_name)
const char * packages_file() const
static Dart_Handle InitForSnapshot(const char *snapshot_uri, IsolateData *isolate_data)
static Dart_Handle DeferredLoadHandler(intptr_t loading_unit_id)
static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, Dart_Handle library, Dart_Handle url)
static AppSnapshot * TryReadAppSnapshot(const char *script_uri, bool force_load_elf_from_memory=false, bool decode_uri=true)
struct _Dart_Handle * Dart_Handle
const uint8_t uint32_t uint32_t GError ** error
constexpr int kCompilationErrorExitCode
const uint8_t * isolate_snapshot_data
static Dart_Handle WrapMallocedKernelBuffer(uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
static void MallocFinalizer(void *isolate_callback_data, void *peer)
const uint8_t * isolate_snapshot_instructions
DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target, Dart_Handle name, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Handle Dart_NewExternalTypedDataWithFinalizer(Dart_TypedData_Type type, void *data, intptr_t length, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
DART_EXPORT const char * Dart_GetError(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_DeferredLoadCompleteError(intptr_t loading_unit_id, const char *error_message, bool transient)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
CStringUniquePtr ResolveUri(const char *ref_uri, const char *base_uri)
DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle kernel_buffer)
DART_EXPORT void * Dart_CurrentIsolateGroupData()
DART_EXPORT Dart_Handle Dart_DeferredLoadComplete(intptr_t loading_unit_id, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions)
DART_EXPORT Dart_Handle Dart_NewApiError(const char *error)
DART_EXPORT Dart_Handle Dart_NewCompilationError(const char *error)
DART_EXPORT bool Dart_IsApiError(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library)
DART_EXPORT Dart_Handle Dart_Null()
DART_EXPORT Dart_Handle Dart_StringToCString(Dart_Handle object, const char **cstr)
DART_EXPORT Dart_Handle Dart_NewStringFromCString(const char *str)