| OLD | NEW | 
|---|
| 1 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 328   Dart_Handle script_path = FilePathFromUri( | 328   Dart_Handle script_path = FilePathFromUri( | 
| 329       DartUtils::GetStringValue(resolved_script_uri)); | 329       DartUtils::GetStringValue(resolved_script_uri)); | 
| 330   if (Dart_IsError(script_path)) { | 330   if (Dart_IsError(script_path)) { | 
| 331     return script_path; | 331     return script_path; | 
| 332   } | 332   } | 
| 333   Dart_Handle source = DartUtils::ReadStringFromFile( | 333   Dart_Handle source = DartUtils::ReadStringFromFile( | 
| 334       DartUtils::GetStringValue(script_path)); | 334       DartUtils::GetStringValue(script_path)); | 
| 335   if (Dart_IsError(source)) { | 335   if (Dart_IsError(source)) { | 
| 336     return source; | 336     return source; | 
| 337   } | 337   } | 
| 338   return Dart_LoadScript(resolved_script_uri, source); | 338   return Dart_LoadScript(resolved_script_uri, source, 0, 0); | 
| 339 } | 339 } | 
| 340 | 340 | 
| 341 | 341 | 
| 342 static Dart_Handle LoadGenericSnapshotCreationScript( | 342 static Dart_Handle LoadGenericSnapshotCreationScript( | 
| 343     Builtin::BuiltinLibraryId id) { | 343     Builtin::BuiltinLibraryId id) { | 
| 344   Dart_Handle source = Builtin::Source(id); | 344   Dart_Handle source = Builtin::Source(id); | 
| 345   if (Dart_IsError(source)) { | 345   if (Dart_IsError(source)) { | 
| 346     return source;  // source contains the error string. | 346     return source;  // source contains the error string. | 
| 347   } | 347   } | 
| 348   Dart_Handle lib; | 348   Dart_Handle lib; | 
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 519     CreateAndWriteSnapshot(); | 519     CreateAndWriteSnapshot(); | 
| 520 | 520 | 
| 521     Dart_EnterIsolate(UriResolverIsolateScope::isolate); | 521     Dart_EnterIsolate(UriResolverIsolateScope::isolate); | 
| 522     Dart_ShutdownIsolate(); | 522     Dart_ShutdownIsolate(); | 
| 523   } else { | 523   } else { | 
| 524     SetupForGenericSnapshotCreation(); | 524     SetupForGenericSnapshotCreation(); | 
| 525     CreateAndWriteSnapshot(); | 525     CreateAndWriteSnapshot(); | 
| 526   } | 526   } | 
| 527   return 0; | 527   return 0; | 
| 528 } | 528 } | 
| OLD | NEW | 
|---|