Chromium Code Reviews| 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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 865 if (Dart_IsError(result)) return ServiceRequestError(result); | 865 if (Dart_IsError(result)) return ServiceRequestError(result); |
| 866 const char *json; | 866 const char *json; |
| 867 result = Dart_StringToCString(result, &json); | 867 result = Dart_StringToCString(result, &json); |
| 868 if (Dart_IsError(result)) return ServiceRequestError(result); | 868 if (Dart_IsError(result)) return ServiceRequestError(result); |
| 869 return strdup(json); | 869 return strdup(json); |
| 870 } | 870 } |
| 871 | 871 |
| 872 | 872 |
| 873 void main(int argc, char** argv) { | 873 void main(int argc, char** argv) { |
| 874 char* script_name; | 874 char* script_name; |
| 875 CommandLineOptions vm_options(argc); | 875 CommandLineOptions vm_options(argc); |
|
siva
2015/05/27 21:39:11
Ditto comment here about EXTAR_VM_OPTIONS.
In thi
srdjan
2015/05/27 22:46:33
Done.
| |
| 876 CommandLineOptions dart_options(argc); | 876 CommandLineOptions dart_options(argc); |
| 877 bool print_flags_seen = false; | 877 bool print_flags_seen = false; |
| 878 bool verbose_debug_seen = false; | 878 bool verbose_debug_seen = false; |
| 879 | 879 |
| 880 vm_options.AddArgument("--no_write_protect_code"); | 880 vm_options.AddArgument("--no_write_protect_code"); |
| 881 // Perform platform specific initialization. | 881 // Perform platform specific initialization. |
| 882 if (!Platform::Initialize()) { | 882 if (!Platform::Initialize()) { |
| 883 Log::PrintErr("Initialization failed\n"); | 883 Log::PrintErr("Initialization failed\n"); |
| 884 } | 884 } |
| 885 | 885 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 914 | 914 |
| 915 Thread::InitOnce(); | 915 Thread::InitOnce(); |
| 916 | 916 |
| 917 if (!DartUtils::SetOriginalWorkingDirectory()) { | 917 if (!DartUtils::SetOriginalWorkingDirectory()) { |
| 918 OSError err; | 918 OSError err; |
| 919 fprintf(stderr, "Error determining current directory: %s\n", err.message()); | 919 fprintf(stderr, "Error determining current directory: %s\n", err.message()); |
| 920 fflush(stderr); | 920 fflush(stderr); |
| 921 exit(kErrorExitCode); | 921 exit(kErrorExitCode); |
| 922 } | 922 } |
| 923 | 923 |
| 924 if (generate_script_snapshot) { | |
| 925 vm_options.AddArgument("--load_deferred_eagerly"); | |
| 926 } | |
| 927 | |
| 924 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); | 928 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); |
| 925 | 929 |
| 926 // Start event handler. | 930 // Start event handler. |
| 927 EventHandler::Start(); | 931 EventHandler::Start(); |
| 928 | 932 |
| 929 // Start the debugger wire protocol handler if necessary. | 933 // Start the debugger wire protocol handler if necessary. |
| 930 if (start_debugger) { | 934 if (start_debugger) { |
| 931 ASSERT(debug_port >= 0); | 935 ASSERT(debug_port >= 0); |
| 932 bool print_msg = verbose_debug_seen || (debug_port == 0); | 936 bool print_msg = verbose_debug_seen || (debug_port == 0); |
| 933 debug_port = DebuggerConnectionHandler::StartHandler(debug_ip, debug_port); | 937 debug_port = DebuggerConnectionHandler::StartHandler(debug_ip, debug_port); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1089 exit(Process::GlobalExitCode()); | 1093 exit(Process::GlobalExitCode()); |
| 1090 } | 1094 } |
| 1091 | 1095 |
| 1092 } // namespace bin | 1096 } // namespace bin |
| 1093 } // namespace dart | 1097 } // namespace dart |
| 1094 | 1098 |
| 1095 int main(int argc, char** argv) { | 1099 int main(int argc, char** argv) { |
| 1096 dart::bin::main(argc, argv); | 1100 dart::bin::main(argc, argv); |
| 1097 UNREACHABLE(); | 1101 UNREACHABLE(); |
| 1098 } | 1102 } |
| OLD | NEW |