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

Side by Side Diff: bin/gen_snapshot.cc

Issue 8574075: Fix prototype of Dart_Initialize. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 years, 1 month 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 | 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 325
326 if (snapshot_filename == NULL) { 326 if (snapshot_filename == NULL) {
327 fprintf(stderr, "No snapshot output file specified\n"); 327 fprintf(stderr, "No snapshot output file specified\n");
328 return 255; 328 return 255;
329 } 329 }
330 330
331 // Initialize the Dart VM (TODO(asiva) - remove const_cast once 331 // Initialize the Dart VM (TODO(asiva) - remove const_cast once
332 // dart API is fixed to take a const char** in Dart_Initialize). 332 // dart API is fixed to take a const char** in Dart_Initialize).
333 Dart_Initialize(vm_options.count(), 333 Dart_Initialize(vm_options.count(),
334 const_cast<char**>(vm_options.arguments()), 334 vm_options.arguments(),
335 SnapshotCreateCallback); 335 SnapshotCreateCallback);
336 336
337 // Create an isolate. As a side effect, SnapshotCreateCallback 337 // Create an isolate. As a side effect, SnapshotCreateCallback
338 // gets called, which loads the script (if one is specified), its libraries 338 // gets called, which loads the script (if one is specified), its libraries
339 // and writes out a snapshot. 339 // and writes out a snapshot.
340 Dart_Isolate isolate = Dart_CreateIsolate(NULL, script_name); 340 Dart_Isolate isolate = Dart_CreateIsolate(NULL, script_name);
341 if (isolate == NULL) { 341 if (isolate == NULL) {
342 return 255; 342 return 255;
343 } 343 }
344 344
345 // Shutdown the isolate. 345 // Shutdown the isolate.
346 Dart_ShutdownIsolate(); 346 Dart_ShutdownIsolate();
347 return 0; 347 return 0;
348 } 348 }
OLDNEW
« no previous file with comments | « no previous file | bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698