OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
Ivan Posva
2012/01/10 00:28:09
.
Mads Ager (google)
2012/01/10 06:55:05
Done.
| |
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> |
11 | 11 |
12 #include "include/dart_api.h" | 12 #include "include/dart_api.h" |
13 | 13 |
14 #include "bin/builtin.h" | 14 #include "bin/builtin.h" |
15 #include "bin/dartutils.h" | 15 #include "bin/dartutils.h" |
16 #include "bin/file.h" | 16 #include "bin/file.h" |
17 | |
18 #include "platform/globals.h" | 17 #include "platform/globals.h" |
19 | 18 |
20 // Global state that indicates whether a snapshot is to be created and | 19 // Global state that indicates whether a snapshot is to be created and |
21 // if so which file to write the snapshot into. | 20 // if so which file to write the snapshot into. |
22 static const char* snapshot_filename = NULL; | 21 static const char* snapshot_filename = NULL; |
23 | 22 |
24 | 23 |
25 // Global state which contains a pointer to the script name for which | 24 // Global state which contains a pointer to the script name for which |
26 // a snapshot needs to be created (NULL would result in the creation | 25 // a snapshot needs to be created (NULL would result in the creation |
27 // of a generic snapshot that contains only the corelibs). | 26 // of a generic snapshot that contains only the corelibs). |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 exit(255); | 267 exit(255); |
269 } | 268 } |
270 // Now write the snapshot out to specified file and exit. | 269 // Now write the snapshot out to specified file and exit. |
271 WriteSnapshotFile(buffer, size); | 270 WriteSnapshotFile(buffer, size); |
272 Dart_ExitScope(); | 271 Dart_ExitScope(); |
273 | 272 |
274 // Shutdown the isolate. | 273 // Shutdown the isolate. |
275 Dart_ShutdownIsolate(); | 274 Dart_ShutdownIsolate(); |
276 return 0; | 275 return 0; |
277 } | 276 } |
OLD | NEW |