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

Side by Side Diff: bin/gen_snapshot.cc

Issue 10450016: Add a callback to inform embedders when an isolate is being shut down. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 months 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) 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 if (snapshot_filename == NULL) { 248 if (snapshot_filename == NULL) {
249 fprintf(stderr, "No snapshot output file specified\n"); 249 fprintf(stderr, "No snapshot output file specified\n");
250 return 255; 250 return 255;
251 } 251 }
252 252
253 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); 253 Dart_SetVMFlags(vm_options.count(), vm_options.arguments());
254 254
255 // Initialize the Dart VM. 255 // Initialize the Dart VM.
256 // Note: We don't expect isolates to be created from dart code during 256 // Note: We don't expect isolates to be created from dart code during
257 // snapshot generation. 257 // snapshot generation.
258 Dart_Initialize(NULL, NULL); 258 Dart_Initialize(NULL, NULL, NULL);
259 259
260 char* error; 260 char* error;
261 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, NULL, NULL, &error); 261 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, NULL, NULL, &error);
262 if (isolate == NULL) { 262 if (isolate == NULL) {
263 fprintf(stderr, "%s", error); 263 fprintf(stderr, "%s", error);
264 free(error); 264 free(error);
265 exit(255); 265 exit(255);
266 } 266 }
267 267
268 Dart_Handle result; 268 Dart_Handle result;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 exit(255); 320 exit(255);
321 } 321 }
322 // Now write the snapshot out to specified file and exit. 322 // Now write the snapshot out to specified file and exit.
323 WriteSnapshotFile(buffer, size); 323 WriteSnapshotFile(buffer, size);
324 Dart_ExitScope(); 324 Dart_ExitScope();
325 325
326 // Shutdown the isolate. 326 // Shutdown the isolate.
327 Dart_ShutdownIsolate(); 327 Dart_ShutdownIsolate();
328 return 0; 328 return 0;
329 } 329 }
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