OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 return 255; | 294 return 255; |
295 } | 295 } |
296 | 296 |
297 DartUtils::SetOriginalWorkingDirectory(); | 297 DartUtils::SetOriginalWorkingDirectory(); |
298 | 298 |
299 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); | 299 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); |
300 | 300 |
301 // Initialize the Dart VM. | 301 // Initialize the Dart VM. |
302 // Note: We don't expect isolates to be created from dart code during | 302 // Note: We don't expect isolates to be created from dart code during |
303 // snapshot generation. | 303 // snapshot generation. |
304 if (!Dart_Initialize(NULL, NULL, NULL, NULL)) { | 304 if (!Dart_Initialize(NULL, NULL, NULL, NULL, |
| 305 NULL, NULL, NULL)) { |
305 Log::PrintErr("VM initialization failed\n"); | 306 Log::PrintErr("VM initialization failed\n"); |
306 return 255; | 307 return 255; |
307 } | 308 } |
308 | 309 |
309 char* error; | 310 char* error; |
310 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, NULL, NULL, &error); | 311 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, NULL, NULL, &error); |
311 if (isolate == NULL) { | 312 if (isolate == NULL) { |
312 Log::PrintErr("Error: %s", error); | 313 Log::PrintErr("Error: %s", error); |
313 free(error); | 314 free(error); |
314 exit(255); | 315 exit(255); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 CreateAndWriteSnapshot(true); | 389 CreateAndWriteSnapshot(true); |
389 | 390 |
390 free(snapshot_buffer); | 391 free(snapshot_buffer); |
391 } | 392 } |
392 } else { | 393 } else { |
393 SetupForGenericSnapshotCreation(); | 394 SetupForGenericSnapshotCreation(); |
394 CreateAndWriteSnapshot(false); | 395 CreateAndWriteSnapshot(false); |
395 } | 396 } |
396 return 0; | 397 return 0; |
397 } | 398 } |
OLD | NEW |