| 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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 return ErrorExit("%s\n", Dart_GetError(result)); | 812 return ErrorExit("%s\n", Dart_GetError(result)); |
| 813 } | 813 } |
| 814 // Keep handling messages until the last active receive port is closed. | 814 // Keep handling messages until the last active receive port is closed. |
| 815 result = Dart_RunLoop(); | 815 result = Dart_RunLoop(); |
| 816 if (Dart_IsError(result)) { | 816 if (Dart_IsError(result)) { |
| 817 return ErrorExit("%s\n", Dart_GetError(result)); | 817 return ErrorExit("%s\n", Dart_GetError(result)); |
| 818 } | 818 } |
| 819 } | 819 } |
| 820 | 820 |
| 821 Dart_ExitScope(); | 821 Dart_ExitScope(); |
| 822 VmStats::Stop(); | 822 if (vmstats_port >= 0) { |
| 823 VmStats::Stop(); |
| 824 } |
| 823 // Shutdown the isolate. | 825 // Shutdown the isolate. |
| 824 Dart_ShutdownIsolate(); | 826 Dart_ShutdownIsolate(); |
| 825 // Terminate process exit-code handler. | 827 // Terminate process exit-code handler. |
| 826 Process::TerminateExitCodeHandler(); | 828 Process::TerminateExitCodeHandler(); |
| 827 // Free copied argument strings if converted. | 829 // Free copied argument strings if converted. |
| 828 if (argv_converted) { | 830 if (argv_converted) { |
| 829 for (int i = 0; i < argc; i++) free(argv[i]); | 831 for (int i = 0; i < argc; i++) free(argv[i]); |
| 830 } | 832 } |
| 831 | 833 |
| 832 return Process::GlobalExitCode(); | 834 return Process::GlobalExitCode(); |
| 833 } | 835 } |
| OLD | NEW |