| 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 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "include/dart_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 DartUtils::PrepareForScriptLoading(package_root, builtin_lib); | 456 DartUtils::PrepareForScriptLoading(package_root, builtin_lib); |
| 457 | 457 |
| 458 snapshot_file->ReadFully(buffer, len); | 458 snapshot_file->ReadFully(buffer, len); |
| 459 library = Dart_LoadScriptFromSnapshot(buffer); | 459 library = Dart_LoadScriptFromSnapshot(buffer); |
| 460 free(buffer); | 460 free(buffer); |
| 461 delete snapshot_file; | 461 delete snapshot_file; |
| 462 snapshot_file = NULL; | 462 snapshot_file = NULL; |
| 463 use_script_snapshot = false; // No further usage of script snapshots. | 463 use_script_snapshot = false; // No further usage of script snapshots. |
| 464 } else { | 464 } else { |
| 465 // Prepare builtin and its dependent libraries for use to resolve URIs. | 465 // Prepare builtin and its dependent libraries for use to resolve URIs. |
| 466 Dart_Handle uri_lib = Builtin::LoadAndCheckLibrary(Builtin::kUriLibrary); | 466 Dart_Handle uri_url = DartUtils::NewString(DartUtils::kUriLibURL); |
| 467 Dart_Handle uri_lib = Dart_LookupLibrary(uri_url); |
| 467 CHECK_RESULT(uri_lib); | 468 CHECK_RESULT(uri_lib); |
| 468 Dart_Handle builtin_lib = | 469 Dart_Handle builtin_lib = |
| 469 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 470 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
| 470 CHECK_RESULT(builtin_lib); | 471 CHECK_RESULT(builtin_lib); |
| 471 | 472 |
| 472 // Prepare for script loading by setting up the 'print' and 'timer' | 473 // Prepare for script loading by setting up the 'print' and 'timer' |
| 473 // closures and setting up 'package root' for URI resolution. | 474 // closures and setting up 'package root' for URI resolution. |
| 474 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); | 475 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); |
| 475 CHECK_RESULT(result); | 476 CHECK_RESULT(result); |
| 476 | 477 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 Dart_ShutdownIsolate(); | 778 Dart_ShutdownIsolate(); |
| 778 // Terminate process exit-code handler. | 779 // Terminate process exit-code handler. |
| 779 Process::TerminateExitCodeHandler(); | 780 Process::TerminateExitCodeHandler(); |
| 780 // Free copied argument strings if converted. | 781 // Free copied argument strings if converted. |
| 781 if (argv_converted) { | 782 if (argv_converted) { |
| 782 for (int i = 0; i < argc; i++) free(argv[i]); | 783 for (int i = 0; i < argc; i++) free(argv[i]); |
| 783 } | 784 } |
| 784 | 785 |
| 785 return Process::GlobalExitCode(); | 786 return Process::GlobalExitCode(); |
| 786 } | 787 } |
| OLD | NEW |