| OLD | NEW |
| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 Dart_Handle builtin_lib = | 372 Dart_Handle builtin_lib = |
| 373 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 373 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
| 374 CHECK_RESULT(builtin_lib); | 374 CHECK_RESULT(builtin_lib); |
| 375 | 375 |
| 376 // Prepare for script loading by setting up the 'print' and 'timer' | 376 // Prepare for script loading by setting up the 'print' and 'timer' |
| 377 // closures and setting up 'package root' for URI resolution. | 377 // closures and setting up 'package root' for URI resolution. |
| 378 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); | 378 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); |
| 379 CHECK_RESULT(result); | 379 CHECK_RESULT(result); |
| 380 | 380 |
| 381 // Load specified script. | 381 // Load specified script. |
| 382 library = DartUtils::LoadScript(app_script_name, true, builtin_lib); | 382 library = DartUtils::LoadScript(app_script_name, builtin_lib); |
| 383 | 383 |
| 384 // Now create and write snapshot of script. | 384 // Now create and write snapshot of script. |
| 385 CreateAndWriteSnapshot(true); | 385 CreateAndWriteSnapshot(true); |
| 386 | 386 |
| 387 free(snapshot_buffer); | 387 free(snapshot_buffer); |
| 388 } | 388 } |
| 389 } else { | 389 } else { |
| 390 SetupForGenericSnapshotCreation(); | 390 SetupForGenericSnapshotCreation(); |
| 391 CreateAndWriteSnapshot(false); | 391 CreateAndWriteSnapshot(false); |
| 392 } | 392 } |
| 393 return 0; | 393 return 0; |
| 394 } | 394 } |
| OLD | NEW |