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

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

Issue 8713012: Introduce Dart_SetVMFlags API function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Comments addressed. Created 9 years 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 | Annotate | Revision Log
« 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 &app_script_name) < 0) { 213 &app_script_name) < 0) {
214 PrintUsage(); 214 PrintUsage();
215 return 255; 215 return 255;
216 } 216 }
217 217
218 if (snapshot_filename == NULL) { 218 if (snapshot_filename == NULL) {
219 fprintf(stderr, "No snapshot output file specified\n"); 219 fprintf(stderr, "No snapshot output file specified\n");
220 return 255; 220 return 255;
221 } 221 }
222 222
223 Dart_SetVMFlags(vm_options.count(), vm_options.arguments());
224
223 // Initialize the Dart VM. 225 // Initialize the Dart VM.
224 // Note: We don't expect isolates to be created from dart code during 226 // Note: We don't expect isolates to be created from dart code during
225 // snapshot generation. 227 // snapshot generation.
226 Dart_Initialize(vm_options.count(), vm_options.arguments(), NULL); 228 Dart_Initialize(NULL);
227 229
228 char* error; 230 char* error;
229 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, &error); 231 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, &error);
230 if (isolate == NULL) { 232 if (isolate == NULL) {
231 fprintf(stderr, "%s", error); 233 fprintf(stderr, "%s", error);
232 free(error); 234 free(error);
233 exit(255); 235 exit(255);
234 } 236 }
235 237
236 Dart_Handle result; 238 Dart_Handle result;
(...skipping 29 matching lines...) Expand all
266 exit(255); 268 exit(255);
267 } 269 }
268 // Now write the snapshot out to specified file and exit. 270 // Now write the snapshot out to specified file and exit.
269 WriteSnapshotFile(buffer, size); 271 WriteSnapshotFile(buffer, size);
270 Dart_ExitScope(); 272 Dart_ExitScope();
271 273
272 // Shutdown the isolate. 274 // Shutdown the isolate.
273 Dart_ShutdownIsolate(); 275 Dart_ShutdownIsolate();
274 return 0; 276 return 0;
275 } 277 }
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