| 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 13 matching lines...) Expand all Loading... |
| 24 #include "bin/thread.h" | 24 #include "bin/thread.h" |
| 25 #include "bin/utils.h" | 25 #include "bin/utils.h" |
| 26 #include "bin/vmservice_impl.h" | 26 #include "bin/vmservice_impl.h" |
| 27 #include "platform/globals.h" | 27 #include "platform/globals.h" |
| 28 #include "platform/hashmap.h" | 28 #include "platform/hashmap.h" |
| 29 #include "platform/text_buffer.h" | 29 #include "platform/text_buffer.h" |
| 30 #if !defined(DART_PRECOMPILER) | 30 #if !defined(DART_PRECOMPILER) |
| 31 #include "zlib/zlib.h" | 31 #include "zlib/zlib.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 #include "vm/malloc_hooks.h" |
| 35 |
| 34 namespace dart { | 36 namespace dart { |
| 35 namespace bin { | 37 namespace bin { |
| 36 | 38 |
| 37 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we | 39 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we |
| 38 // link in a snapshot otherwise it is initialized to NULL. | 40 // link in a snapshot otherwise it is initialized to NULL. |
| 39 extern const uint8_t* vm_isolate_snapshot_buffer; | 41 extern const uint8_t* vm_isolate_snapshot_buffer; |
| 40 | 42 |
| 41 // isolate_snapshot_buffer points to a snapshot for an isolate if we link in a | 43 // isolate_snapshot_buffer points to a snapshot for an isolate if we link in a |
| 42 // snapshot otherwise it is initialized to NULL. | 44 // snapshot otherwise it is initialized to NULL. |
| 43 extern const uint8_t* isolate_snapshot_buffer; | 45 extern const uint8_t* isolate_snapshot_buffer; |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 // Free decompressed memory as it has been copied into a Dart array. | 1894 // Free decompressed memory as it has been copied into a Dart array. |
| 1893 free(decompressed); | 1895 free(decompressed); |
| 1894 return tar_file; | 1896 return tar_file; |
| 1895 } | 1897 } |
| 1896 #else // !defined(DART_PRECOMPILER) | 1898 #else // !defined(DART_PRECOMPILER) |
| 1897 static Dart_GetVMServiceAssetsArchive GetVMServiceAssetsArchiveCallback = NULL; | 1899 static Dart_GetVMServiceAssetsArchive GetVMServiceAssetsArchiveCallback = NULL; |
| 1898 #endif // !defined(DART_PRECOMPILER) | 1900 #endif // !defined(DART_PRECOMPILER) |
| 1899 | 1901 |
| 1900 | 1902 |
| 1901 void main(int argc, char** argv) { | 1903 void main(int argc, char** argv) { |
| 1904 MallocHooks::Init(); |
| 1902 char* script_name; | 1905 char* script_name; |
| 1903 const int EXTRA_VM_ARGUMENTS = 8; | 1906 const int EXTRA_VM_ARGUMENTS = 8; |
| 1904 CommandLineOptions vm_options(argc + EXTRA_VM_ARGUMENTS); | 1907 CommandLineOptions vm_options(argc + EXTRA_VM_ARGUMENTS); |
| 1905 CommandLineOptions dart_options(argc); | 1908 CommandLineOptions dart_options(argc); |
| 1906 bool print_flags_seen = false; | 1909 bool print_flags_seen = false; |
| 1907 bool verbose_debug_seen = false; | 1910 bool verbose_debug_seen = false; |
| 1908 | 1911 |
| 1909 // Perform platform specific initialization. | 1912 // Perform platform specific initialization. |
| 1910 if (!Platform::Initialize()) { | 1913 if (!Platform::Initialize()) { |
| 1911 Log::PrintErr("Initialization failed\n"); | 1914 Log::PrintErr("Initialization failed\n"); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2048 Platform::Exit(Process::GlobalExitCode()); | 2051 Platform::Exit(Process::GlobalExitCode()); |
| 2049 } | 2052 } |
| 2050 | 2053 |
| 2051 } // namespace bin | 2054 } // namespace bin |
| 2052 } // namespace dart | 2055 } // namespace dart |
| 2053 | 2056 |
| 2054 int main(int argc, char** argv) { | 2057 int main(int argc, char** argv) { |
| 2055 dart::bin::main(argc, argv); | 2058 dart::bin::main(argc, argv); |
| 2056 UNREACHABLE(); | 2059 UNREACHABLE(); |
| 2057 } | 2060 } |
| OLD | NEW |