| 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_tools_api.h" | 10 #include "include/dart_tools_api.h" |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 return NULL; | 878 return NULL; |
| 879 } | 879 } |
| 880 } else if (!isolate_run_app_snapshot) { | 880 } else if (!isolate_run_app_snapshot) { |
| 881 is_kernel = TryReadKernel(script_uri, &kernel_file, &kernel_length); | 881 is_kernel = TryReadKernel(script_uri, &kernel_file, &kernel_length); |
| 882 } | 882 } |
| 883 } | 883 } |
| 884 | 884 |
| 885 void* kernel_program = NULL; | 885 void* kernel_program = NULL; |
| 886 if (is_kernel) { | 886 if (is_kernel) { |
| 887 kernel_program = Dart_ReadKernelBinary(kernel_file, kernel_length); | 887 kernel_program = Dart_ReadKernelBinary(kernel_file, kernel_length); |
| 888 free(const_cast<uint8_t*>(kernel_file)); | |
| 889 } | 888 } |
| 890 | 889 |
| 891 IsolateData* isolate_data = | 890 IsolateData* isolate_data = |
| 892 new IsolateData(script_uri, package_root, packages_config, app_snapshot); | 891 new IsolateData(script_uri, package_root, packages_config, app_snapshot); |
| 893 if (is_main_isolate && (snapshot_deps_filename != NULL)) { | 892 if (is_main_isolate && (snapshot_deps_filename != NULL)) { |
| 894 isolate_data->set_dependencies(new MallocGrowableArray<char*>()); | 893 isolate_data->set_dependencies(new MallocGrowableArray<char*>()); |
| 895 } | 894 } |
| 896 // If the script is a Kernel binary, then we will try to bootstrap from the | 895 // If the script is a Kernel binary, then we will try to bootstrap from the |
| 897 // script. | 896 // script. |
| 898 Dart_Isolate isolate = | 897 Dart_Isolate isolate = |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1718 Platform::Exit(Process::GlobalExitCode()); | 1717 Platform::Exit(Process::GlobalExitCode()); |
| 1719 } | 1718 } |
| 1720 | 1719 |
| 1721 } // namespace bin | 1720 } // namespace bin |
| 1722 } // namespace dart | 1721 } // namespace dart |
| 1723 | 1722 |
| 1724 int main(int argc, char** argv) { | 1723 int main(int argc, char** argv) { |
| 1725 dart::bin::main(argc, argv); | 1724 dart::bin::main(argc, argv); |
| 1726 UNREACHABLE(); | 1725 UNREACHABLE(); |
| 1727 } | 1726 } |
| OLD | NEW |