Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1199)

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 2410303008: Revert "Use a single file for app snapshots." (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698