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_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 #else | 135 #else |
136 ASSERT(GetCurrentMonotonicFrequency() == kNanosecondsPerSecond); | 136 ASSERT(GetCurrentMonotonicFrequency() == kNanosecondsPerSecond); |
137 return GetCurrentMonotonicTicks() / kNanosecondsPerMicrosecond; | 137 return GetCurrentMonotonicTicks() / kNanosecondsPerMicrosecond; |
138 #endif // TARGET_OS_IOS | 138 #endif // TARGET_OS_IOS |
139 } | 139 } |
140 | 140 |
141 | 141 |
142 int64_t OS::GetCurrentThreadCPUMicros() { | 142 int64_t OS::GetCurrentThreadCPUMicros() { |
143 #if TARGET_OS_IOS | 143 #if TARGET_OS_IOS |
144 // TODO(johnmccutchan): Implement this. No implementation exists in base. | 144 // TODO(johnmccutchan): Implement this. No implementation exists in base. |
145 return -1 | 145 return -1; |
146 #else | 146 #else |
147 mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; | 147 mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
148 thread_basic_info_data_t info_data; | 148 thread_basic_info_data_t info_data; |
149 thread_basic_info_t info = &info_data; | 149 thread_basic_info_t info = &info_data; |
150 mach_port_t thread_port = mach_thread_self(); | 150 mach_port_t thread_port = mach_thread_self(); |
151 if (thread_port == MACH_PORT_NULL) { | 151 if (thread_port == MACH_PORT_NULL) { |
152 return -1; | 152 return -1; |
153 } | 153 } |
154 kern_return_t r = thread_info(thread_port, THREAD_BASIC_INFO, | 154 kern_return_t r = thread_info(thread_port, THREAD_BASIC_INFO, |
155 (thread_info_t)info, &count); | 155 (thread_info_t)info, &count); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 415 } |
416 | 416 |
417 | 417 |
418 void OS::Exit(int code) { | 418 void OS::Exit(int code) { |
419 exit(code); | 419 exit(code); |
420 } | 420 } |
421 | 421 |
422 } // namespace dart | 422 } // namespace dart |
423 | 423 |
424 #endif // defined(TARGET_OS_MACOS) | 424 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |