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

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: Force atomicity. 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') | runtime/include/dart_api.h » ('J')
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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 &script_name) < 0) { 247 &script_name) < 0) {
248 PrintUsage(); 248 PrintUsage();
249 return 255; 249 return 255;
250 } 250 }
251 251
252 if (snapshot_filename == NULL) { 252 if (snapshot_filename == NULL) {
253 fprintf(stderr, "No snapshot output file specified\n"); 253 fprintf(stderr, "No snapshot output file specified\n");
254 return 255; 254 return 255;
255 } 255 }
256 256
257 // Initialize the Dart VM (TODO(asiva) - remove const_cast once 257 Dart_SetVMFlags(vm_options.count(), vm_options.arguments());
258 // dart API is fixed to take a const char** in Dart_Initialize). 258 Dart_Initialize(SnapshotCreateCallback);
259 Dart_Initialize(vm_options.count(),
260 vm_options.arguments(),
261 SnapshotCreateCallback);
262 259
263 // Create an isolate. As a side effect, SnapshotCreateCallback 260 // Create an isolate. As a side effect, SnapshotCreateCallback
264 // gets called, which loads the script (if one is specified), its libraries 261 // gets called, which loads the script (if one is specified), its libraries
265 // and writes out a snapshot. 262 // and writes out a snapshot.
266 Dart_Isolate isolate = Dart_CreateIsolate(NULL, script_name); 263 Dart_Isolate isolate = Dart_CreateIsolate(NULL, script_name);
267 if (isolate == NULL) { 264 if (isolate == NULL) {
268 return 255; 265 return 255;
269 } 266 }
270 267
271 // Shutdown the isolate. 268 // Shutdown the isolate.
272 Dart_ShutdownIsolate(); 269 Dart_ShutdownIsolate();
273 return 0; 270 return 0;
274 } 271 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/main.cc » ('j') | runtime/include/dart_api.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698