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

Side by Side Diff: runtime/bin/gen_snapshot.cc

Issue 2611343002: Cleanup embedder API functions for app snapshots. (Closed)
Patch Set: sync Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/bin/main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Generate a snapshot file after loading all the scripts specified on the 5 // Generate a snapshot file after loading all the scripts specified on the
6 // command line. 6 // command line.
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 1056
1057 // Precompile with specified embedder entry points 1057 // Precompile with specified embedder entry points
1058 result = Dart_Precompile(standalone_entry_points, NULL, 0); 1058 result = Dart_Precompile(standalone_entry_points, NULL, 0);
1059 CHECK_RESULT(result); 1059 CHECK_RESULT(result);
1060 1060
1061 // Create a precompiled snapshot. 1061 // Create a precompiled snapshot.
1062 bool as_assembly = assembly_filename != NULL; 1062 bool as_assembly = assembly_filename != NULL;
1063 if (as_assembly) { 1063 if (as_assembly) {
1064 uint8_t* assembly_buffer = NULL; 1064 uint8_t* assembly_buffer = NULL;
1065 intptr_t assembly_size = 0; 1065 intptr_t assembly_size = 0;
1066 result = Dart_CreatePrecompiledSnapshotAssembly(&assembly_buffer, 1066 result =
1067 &assembly_size); 1067 Dart_CreateAppAOTSnapshotAsAssembly(&assembly_buffer, &assembly_size);
1068 CHECK_RESULT(result); 1068 CHECK_RESULT(result);
1069 WriteSnapshotFile(assembly_filename, assembly_buffer, assembly_size); 1069 WriteSnapshotFile(assembly_filename, assembly_buffer, assembly_size);
1070 } else { 1070 } else {
1071 uint8_t* vm_isolate_buffer = NULL; 1071 uint8_t* vm_isolate_buffer = NULL;
1072 intptr_t vm_isolate_size = 0; 1072 intptr_t vm_isolate_size = 0;
1073 uint8_t* isolate_buffer = NULL; 1073 uint8_t* isolate_buffer = NULL;
1074 intptr_t isolate_size = 0; 1074 intptr_t isolate_size = 0;
1075 uint8_t* instructions_blob_buffer = NULL; 1075 uint8_t* instructions_blob_buffer = NULL;
1076 intptr_t instructions_blob_size = 0; 1076 intptr_t instructions_blob_size = 0;
1077 uint8_t* rodata_blob_buffer = NULL; 1077 uint8_t* rodata_blob_buffer = NULL;
1078 intptr_t rodata_blob_size = 0; 1078 intptr_t rodata_blob_size = 0;
1079 result = Dart_CreatePrecompiledSnapshotBlob( 1079 result = Dart_CreateAppAOTSnapshotAsBlobs(
1080 &vm_isolate_buffer, &vm_isolate_size, &isolate_buffer, &isolate_size, 1080 &vm_isolate_buffer, &vm_isolate_size, &isolate_buffer, &isolate_size,
1081 &instructions_blob_buffer, &instructions_blob_size, &rodata_blob_buffer, 1081 &instructions_blob_buffer, &instructions_blob_size, &rodata_blob_buffer,
1082 &rodata_blob_size); 1082 &rodata_blob_size);
1083 CHECK_RESULT(result); 1083 CHECK_RESULT(result);
1084 WriteSnapshotFile(vm_isolate_snapshot_filename, vm_isolate_buffer, 1084 WriteSnapshotFile(vm_isolate_snapshot_filename, vm_isolate_buffer,
1085 vm_isolate_size); 1085 vm_isolate_size);
1086 WriteSnapshotFile(isolate_snapshot_filename, isolate_buffer, isolate_size); 1086 WriteSnapshotFile(isolate_snapshot_filename, isolate_buffer, isolate_size);
1087 WriteSnapshotFile(instructions_blob_filename, instructions_blob_buffer, 1087 WriteSnapshotFile(instructions_blob_filename, instructions_blob_buffer,
1088 instructions_blob_size); 1088 instructions_blob_size);
1089 WriteSnapshotFile(rodata_blob_filename, rodata_blob_buffer, 1089 WriteSnapshotFile(rodata_blob_filename, rodata_blob_buffer,
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 EventHandler::Stop(); 1371 EventHandler::Stop();
1372 return 0; 1372 return 0;
1373 } 1373 }
1374 1374
1375 } // namespace bin 1375 } // namespace bin
1376 } // namespace dart 1376 } // namespace dart
1377 1377
1378 int main(int argc, char** argv) { 1378 int main(int argc, char** argv) {
1379 return dart::bin::main(argc, argv); 1379 return dart::bin::main(argc, argv);
1380 } 1380 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698