| 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 <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 #if TARGET_ARCH_ARM | 1024 #if TARGET_ARCH_ARM |
| 1025 // This is for the iPod Touch 5th Generation (and maybe other older devices) | 1025 // This is for the iPod Touch 5th Generation (and maybe other older devices) |
| 1026 vm_options.AddArgument("--no-use_integer_division"); | 1026 vm_options.AddArgument("--no-use_integer_division"); |
| 1027 #endif | 1027 #endif |
| 1028 } | 1028 } |
| 1029 | 1029 |
| 1030 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); | 1030 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); |
| 1031 | 1031 |
| 1032 // Initialize the Dart VM. | 1032 // Initialize the Dart VM. |
| 1033 // Note: We don't expect isolates to be created from dart code during | 1033 // Note: We don't expect isolates to be created from dart code during |
| 1034 // snapshot generation. | 1034 // core library snapshot generation. However for the case when a full |
| 1035 // snasphot is generated from a script (app_script_name != NULL) we will |
| 1036 // need the service isolate to resolve URI and load code. |
| 1035 char* error = Dart_Initialize( | 1037 char* error = Dart_Initialize( |
| 1036 NULL, | 1038 NULL, |
| 1037 NULL, | 1039 NULL, |
| 1038 NULL, | 1040 NULL, |
| 1039 CreateServiceIsolate, | 1041 (app_script_name != NULL) ? CreateServiceIsolate : NULL, |
| 1040 NULL, | 1042 NULL, |
| 1041 NULL, | 1043 NULL, |
| 1042 NULL, | 1044 NULL, |
| 1043 DartUtils::OpenFile, | 1045 DartUtils::OpenFile, |
| 1044 DartUtils::ReadFile, | 1046 DartUtils::ReadFile, |
| 1045 DartUtils::WriteFile, | 1047 DartUtils::WriteFile, |
| 1046 DartUtils::CloseFile, | 1048 DartUtils::CloseFile, |
| 1047 DartUtils::EntropySource, | 1049 DartUtils::EntropySource, |
| 1048 NULL); | 1050 NULL); |
| 1049 if (error != NULL) { | 1051 if (error != NULL) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 EventHandler::Stop(); | 1152 EventHandler::Stop(); |
| 1151 return 0; | 1153 return 0; |
| 1152 } | 1154 } |
| 1153 | 1155 |
| 1154 } // namespace bin | 1156 } // namespace bin |
| 1155 } // namespace dart | 1157 } // namespace dart |
| 1156 | 1158 |
| 1157 int main(int argc, char** argv) { | 1159 int main(int argc, char** argv) { |
| 1158 return dart::bin::main(argc, argv); | 1160 return dart::bin::main(argc, argv); |
| 1159 } | 1161 } |
| OLD | NEW |