| 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 "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 | 9 |
| 10 #include <malloc.h> // NOLINT | 10 #include <malloc.h> // NOLINT |
| 11 #include <process.h> // NOLINT | 11 #include <process.h> // NOLINT |
| 12 #include <time.h> // NOLINT | 12 #include <time.h> // NOLINT |
| 13 | 13 |
| 14 #include "platform/utils.h" | 14 #include "platform/utils.h" |
| 15 #include "platform/assert.h" | 15 #include "platform/assert.h" |
| 16 #include "vm/os_thread.h" | 16 #include "vm/os_thread.h" |
| 17 #include "vm/vtune.h" | |
| 18 #include "vm/zone.h" | 17 #include "vm/zone.h" |
| 19 | 18 |
| 20 namespace dart { | 19 namespace dart { |
| 21 | 20 |
| 22 // Defined in vm/os_thread_win.cc | 21 // Defined in vm/os_thread_win.cc |
| 23 extern bool private_flag_windows_run_tls_destructors; | 22 extern bool private_flag_windows_run_tls_destructors; |
| 24 | 23 |
| 25 const char* OS::Name() { | 24 const char* OS::Name() { |
| 26 return "windows"; | 25 return "windows"; |
| 27 } | 26 } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 (str[i + 2] != '\0')) { | 357 (str[i + 2] != '\0')) { |
| 359 base = 16; | 358 base = 16; |
| 360 } | 359 } |
| 361 errno = 0; | 360 errno = 0; |
| 362 *value = _strtoi64(str, &endptr, base); | 361 *value = _strtoi64(str, &endptr, base); |
| 363 return ((errno == 0) && (endptr != str) && (*endptr == 0)); | 362 return ((errno == 0) && (endptr != str) && (*endptr == 0)); |
| 364 } | 363 } |
| 365 | 364 |
| 366 | 365 |
| 367 void OS::RegisterCodeObservers() { | 366 void OS::RegisterCodeObservers() { |
| 368 #if defined(DART_VTUNE_SUPPORT) | |
| 369 CodeObservers::Register(new VTuneCodeObserver); | |
| 370 #endif | |
| 371 } | 367 } |
| 372 | 368 |
| 373 | 369 |
| 374 void OS::PrintErr(const char* format, ...) { | 370 void OS::PrintErr(const char* format, ...) { |
| 375 va_list args; | 371 va_list args; |
| 376 va_start(args, format); | 372 va_start(args, format); |
| 377 VFPrint(stderr, format, args); | 373 VFPrint(stderr, format, args); |
| 378 va_end(args); | 374 va_end(args); |
| 379 } | 375 } |
| 380 | 376 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // TODO(zra): Remove once VM shuts down cleanly. | 413 // TODO(zra): Remove once VM shuts down cleanly. |
| 418 private_flag_windows_run_tls_destructors = false; | 414 private_flag_windows_run_tls_destructors = false; |
| 419 // On Windows we use ExitProcess so that threads can't clobber the exit_code. | 415 // On Windows we use ExitProcess so that threads can't clobber the exit_code. |
| 420 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870 | 416 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870 |
| 421 ::ExitProcess(code); | 417 ::ExitProcess(code); |
| 422 } | 418 } |
| 423 | 419 |
| 424 } // namespace dart | 420 } // namespace dart |
| 425 | 421 |
| 426 #endif // defined(TARGET_OS_WINDOWS) | 422 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |