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