| Index: runtime/vm/dart_api_impl.cc
|
| diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
|
| index 8fbeea1411f23c02518c9e45cdce64d50b3aa4c4..f6f3ab841fbf2278defc14a570a591ded15f02dd 100644
|
| --- a/runtime/vm/dart_api_impl.cc
|
| +++ b/runtime/vm/dart_api_impl.cc
|
| @@ -6323,6 +6323,10 @@ DART_EXPORT Dart_Handle Dart_Precompile(
|
|
|
|
|
| DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotAssembly(
|
| + uint8_t** vm_isolate_snapshot_buffer,
|
| + intptr_t* vm_isolate_snapshot_size,
|
| + uint8_t** isolate_snapshot_buffer,
|
| + intptr_t* isolate_snapshot_size,
|
| uint8_t** assembly_buffer,
|
| intptr_t* assembly_size) {
|
| UNREACHABLE();
|
| @@ -6374,6 +6378,10 @@ DART_EXPORT Dart_Handle Dart_Precompile(
|
|
|
|
|
| DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotAssembly(
|
| + uint8_t** vm_isolate_snapshot_buffer,
|
| + intptr_t* vm_isolate_snapshot_size,
|
| + uint8_t** isolate_snapshot_buffer,
|
| + intptr_t* isolate_snapshot_size,
|
| uint8_t** assembly_buffer,
|
| intptr_t* assembly_size) {
|
| #if defined(TARGET_ARCH_IA32)
|
| @@ -6389,6 +6397,18 @@ DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotAssembly(
|
| "Did you forget to call Dart_Precompile?");
|
| }
|
| ASSERT(FLAG_load_deferred_eagerly);
|
| + if (vm_isolate_snapshot_buffer == NULL) {
|
| + RETURN_NULL_ERROR(vm_isolate_snapshot_buffer);
|
| + }
|
| + if (vm_isolate_snapshot_size == NULL) {
|
| + RETURN_NULL_ERROR(vm_isolate_snapshot_size);
|
| + }
|
| + if (isolate_snapshot_buffer == NULL) {
|
| + RETURN_NULL_ERROR(isolate_snapshot_buffer);
|
| + }
|
| + if (isolate_snapshot_size == NULL) {
|
| + RETURN_NULL_ERROR(isolate_snapshot_size);
|
| + }
|
| if (assembly_buffer == NULL) {
|
| RETURN_NULL_ERROR(assembly_buffer);
|
| }
|
| @@ -6401,15 +6421,15 @@ DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotAssembly(
|
| AssemblyInstructionsWriter instructions_writer(assembly_buffer,
|
| ApiReallocate,
|
| 2 * MB /* initial_size */);
|
| - uint8_t* vm_isolate_snapshot_buffer = NULL;
|
| - uint8_t* isolate_snapshot_buffer = NULL;
|
| FullSnapshotWriter writer(Snapshot::kAppNoJIT,
|
| - &vm_isolate_snapshot_buffer,
|
| - &isolate_snapshot_buffer,
|
| + vm_isolate_snapshot_buffer,
|
| + isolate_snapshot_buffer,
|
| ApiReallocate,
|
| &instructions_writer);
|
|
|
| writer.WriteFullSnapshot();
|
| + *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
|
| + *isolate_snapshot_size = writer.IsolateSnapshotSize();
|
| *assembly_size = instructions_writer.AssemblySize();
|
|
|
| return Api::Success();
|
|
|