| 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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 bool print_msg = verbose_debug_seen || (debug_port == 0); | 934 bool print_msg = verbose_debug_seen || (debug_port == 0); |
| 935 debug_port = DebuggerConnectionHandler::StartHandler(debug_ip, debug_port); | 935 debug_port = DebuggerConnectionHandler::StartHandler(debug_ip, debug_port); |
| 936 if (print_msg) { | 936 if (print_msg) { |
| 937 Log::Print("Debugger listening on port %d\n", debug_port); | 937 Log::Print("Debugger listening on port %d\n", debug_port); |
| 938 } | 938 } |
| 939 } | 939 } |
| 940 | 940 |
| 941 // Start event handler. | 941 // Start event handler. |
| 942 EventHandler::Start(); | 942 EventHandler::Start(); |
| 943 | 943 |
| 944 ASSERT(Dart_CurrentIsolate() == NULL); |
| 944 // Start the VM service isolate, if necessary. | 945 // Start the VM service isolate, if necessary. |
| 945 if (start_vm_service) { | 946 if (start_vm_service) { |
| 946 ASSERT(vm_service_server_port >= 0); | 947 ASSERT(vm_service_server_port >= 0); |
| 947 bool r = VmService::Start(vm_service_server_port); | 948 bool r = VmService::Start(vm_service_server_port); |
| 948 if (!r) { | 949 if (!r) { |
| 949 Log::PrintErr("Could not start VM Service isolate %s\n", | 950 Log::PrintErr("Could not start VM Service isolate %s\n", |
| 950 VmService::GetErrorMessage()); | 951 VmService::GetErrorMessage()); |
| 951 } | 952 } |
| 952 Dart_RegisterIsolateServiceRequestCallback( | 953 Dart_RegisterIsolateServiceRequestCallback( |
| 953 "io", &ServiceRequestHandler, NULL); | 954 "io", &ServiceRequestHandler, NULL); |
| 954 } | 955 } |
| 956 ASSERT(Dart_CurrentIsolate() == NULL); |
| 955 | 957 |
| 956 // Call CreateIsolateAndSetup which creates an isolate and loads up | 958 // Call CreateIsolateAndSetup which creates an isolate and loads up |
| 957 // the specified application script. | 959 // the specified application script. |
| 958 char* error = NULL; | 960 char* error = NULL; |
| 959 bool is_compile_error = false; | 961 bool is_compile_error = false; |
| 960 char* isolate_name = BuildIsolateName(script_name, "main"); | 962 char* isolate_name = BuildIsolateName(script_name, "main"); |
| 961 IsolateData* isolate_data = new IsolateData(script_name); | 963 IsolateData* isolate_data = new IsolateData(script_name); |
| 962 Dart_Isolate isolate = CreateIsolateAndSetupHelper(script_name, | 964 Dart_Isolate isolate = CreateIsolateAndSetupHelper(script_name, |
| 963 "main", | 965 "main", |
| 964 isolate_data, | 966 isolate_data, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 exit(Process::GlobalExitCode()); | 1097 exit(Process::GlobalExitCode()); |
| 1096 } | 1098 } |
| 1097 | 1099 |
| 1098 } // namespace bin | 1100 } // namespace bin |
| 1099 } // namespace dart | 1101 } // namespace dart |
| 1100 | 1102 |
| 1101 int main(int argc, char** argv) { | 1103 int main(int argc, char** argv) { |
| 1102 dart::bin::main(argc, argv); | 1104 dart::bin::main(argc, argv); |
| 1103 UNREACHABLE(); | 1105 UNREACHABLE(); |
| 1104 } | 1106 } |
| OLD | NEW |