OLD | NEW |
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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 Dart_ShutdownIsolate(); | 1048 Dart_ShutdownIsolate(); |
1049 } | 1049 } |
1050 | 1050 |
1051 | 1051 |
1052 static void CreateAndWritePrecompiledSnapshot( | 1052 static void CreateAndWritePrecompiledSnapshot( |
1053 Dart_QualifiedFunctionName* standalone_entry_points) { | 1053 Dart_QualifiedFunctionName* standalone_entry_points) { |
1054 ASSERT(IsSnapshottingForPrecompilation()); | 1054 ASSERT(IsSnapshottingForPrecompilation()); |
1055 Dart_Handle result; | 1055 Dart_Handle result; |
1056 | 1056 |
1057 // Precompile with specified embedder entry points | 1057 // Precompile with specified embedder entry points |
1058 result = Dart_Precompile(standalone_entry_points, true, 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 = Dart_CreatePrecompiledSnapshotAssembly(&assembly_buffer, |
1067 &assembly_size); | 1067 &assembly_size); |
1068 CHECK_RESULT(result); | 1068 CHECK_RESULT(result); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |