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

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

Issue 8851008: Add support for interrupting an isolate in the vm. Interrupts are (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()); 223 Dart_SetVMFlags(vm_options.count(), vm_options.arguments());
224 224
225 // Initialize the Dart VM. 225 // Initialize the Dart VM.
226 // 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
227 // snapshot generation. 227 // snapshot generation.
228 Dart_Initialize(NULL); 228 Dart_Initialize(NULL, NULL);
229 229
230 char* error; 230 char* error;
231 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, &error); 231 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, &error);
232 if (isolate == NULL) { 232 if (isolate == NULL) {
233 fprintf(stderr, "%s", error); 233 fprintf(stderr, "%s", error);
234 free(error); 234 free(error);
235 exit(255); 235 exit(255);
236 } 236 }
237 237
238 Dart_Handle result; 238 Dart_Handle result;
(...skipping 29 matching lines...) Expand all
268 exit(255); 268 exit(255);
269 } 269 }
270 // Now write the snapshot out to specified file and exit. 270 // Now write the snapshot out to specified file and exit.
271 WriteSnapshotFile(buffer, size); 271 WriteSnapshotFile(buffer, size);
272 Dart_ExitScope(); 272 Dart_ExitScope();
273 273
274 // Shutdown the isolate. 274 // Shutdown the isolate.
275 Dart_ShutdownIsolate(); 275 Dart_ShutdownIsolate();
276 return 0; 276 return 0;
277 } 277 }
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