| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "bin/dartutils.h" | 5 #include "bin/dartutils.h" |
| 6 #include "bin/dbg_connection.h" | 6 #include "bin/dbg_connection.h" |
| 7 #include "bin/eventhandler.h" | 7 #include "bin/eventhandler.h" |
| 8 #include "bin/io_buffer.h" | 8 #include "bin/io_buffer.h" |
| 9 #include "bin/platform.h" | 9 #include "bin/platform.h" |
| 10 #include "bin/process.h" | 10 #include "bin/process.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 | 216 |
| 217 void FUNCTION_NAME(Process_Exit)(Dart_NativeArguments args) { | 217 void FUNCTION_NAME(Process_Exit)(Dart_NativeArguments args) { |
| 218 int64_t status = 0; | 218 int64_t status = 0; |
| 219 // Ignore result if passing invalid argument and just exit 0. | 219 // Ignore result if passing invalid argument and just exit 0. |
| 220 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); | 220 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); |
| 221 Dart_ExitIsolate(); | 221 Dart_ExitIsolate(); |
| 222 Dart_Cleanup(); | 222 Dart_Cleanup(); |
| 223 DebuggerConnectionHandler::StopHandler(); | 223 DebuggerConnectionHandler::StopHandler(); |
| 224 EventHandler::Stop(); | 224 // TODO(zra): Stop the EventHandler once thread shutdown is enabled. |
| 225 // EventHandler::Stop(); |
| 225 exit(static_cast<int>(status)); | 226 exit(static_cast<int>(status)); |
| 226 } | 227 } |
| 227 | 228 |
| 228 | 229 |
| 229 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) { | 230 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) { |
| 230 int64_t status = 0; | 231 int64_t status = 0; |
| 231 // Ignore result if passing invalid argument and just set exit code to 0. | 232 // Ignore result if passing invalid argument and just set exit code to 0. |
| 232 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); | 233 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); |
| 233 Process::SetGlobalExitCode(status); | 234 Process::SetGlobalExitCode(status); |
| 234 } | 235 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 free(const_cast<char*>(system_string)); | 341 free(const_cast<char*>(system_string)); |
| 341 Dart_PropagateError(result); | 342 Dart_PropagateError(result); |
| 342 } | 343 } |
| 343 memmove(buffer, system_string, system_len); | 344 memmove(buffer, system_string, system_len); |
| 344 free(const_cast<char*>(system_string)); | 345 free(const_cast<char*>(system_string)); |
| 345 Dart_SetReturnValue(args, external_array); | 346 Dart_SetReturnValue(args, external_array); |
| 346 } | 347 } |
| 347 | 348 |
| 348 } // namespace bin | 349 } // namespace bin |
| 349 } // namespace dart | 350 } // namespace dart |
| OLD | NEW |