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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 return NULL; | 868 return NULL; |
869 } | 869 } |
870 } else if (!isolate_run_app_snapshot) { | 870 } else if (!isolate_run_app_snapshot) { |
871 is_kernel = TryReadKernel(script_uri, &kernel_file, &kernel_length); | 871 is_kernel = TryReadKernel(script_uri, &kernel_file, &kernel_length); |
872 } | 872 } |
873 } | 873 } |
874 | 874 |
875 void* kernel_program = NULL; | 875 void* kernel_program = NULL; |
876 if (is_kernel) { | 876 if (is_kernel) { |
877 kernel_program = Dart_ReadKernelBinary(kernel_file, kernel_length); | 877 kernel_program = Dart_ReadKernelBinary(kernel_file, kernel_length); |
878 free(const_cast<uint8_t*>(kernel_file)); | |
879 } | 878 } |
880 | 879 |
881 IsolateData* isolate_data = | 880 IsolateData* isolate_data = |
882 new IsolateData(script_uri, package_root, packages_config, app_snapshot); | 881 new IsolateData(script_uri, package_root, packages_config, app_snapshot); |
883 // If the script is a Kernel binary, then we will try to bootstrap from the | 882 // If the script is a Kernel binary, then we will try to bootstrap from the |
884 // script. | 883 // script. |
885 Dart_Isolate isolate = | 884 Dart_Isolate isolate = |
886 is_kernel ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_program, | 885 is_kernel ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_program, |
887 flags, isolate_data, error) | 886 flags, isolate_data, error) |
888 : Dart_CreateIsolate(script_uri, main, isolate_snapshot_data, | 887 : Dart_CreateIsolate(script_uri, main, isolate_snapshot_data, |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1668 Platform::Exit(Process::GlobalExitCode()); | 1667 Platform::Exit(Process::GlobalExitCode()); |
1669 } | 1668 } |
1670 | 1669 |
1671 } // namespace bin | 1670 } // namespace bin |
1672 } // namespace dart | 1671 } // namespace dart |
1673 | 1672 |
1674 int main(int argc, char** argv) { | 1673 int main(int argc, char** argv) { |
1675 dart::bin::main(argc, argv); | 1674 dart::bin::main(argc, argv); |
1676 UNREACHABLE(); | 1675 UNREACHABLE(); |
1677 } | 1676 } |
OLD | NEW |