OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 ASSERT(result == 0); | 174 ASSERT(result == 0); |
175 } | 175 } |
176 | 176 |
177 | 177 |
178 void OS::Sleep(int milliseconds) { | 178 void OS::Sleep(int milliseconds) { |
179 unsigned int ms = static_cast<unsigned int>(milliseconds); | 179 unsigned int ms = static_cast<unsigned int>(milliseconds); |
180 usleep(1000 * ms); | 180 usleep(1000 * ms); |
181 } | 181 } |
182 | 182 |
183 | 183 |
| 184 int OS::NumberOfCores() { |
| 185 return sysconf(_SC_NPROCESSORS_ONLN); |
| 186 } |
| 187 |
| 188 |
184 void OS::Abort() { | 189 void OS::Abort() { |
185 // Redirect to std abort to signal abnormal program termination. | 190 // Redirect to std abort to signal abnormal program termination. |
186 abort(); | 191 abort(); |
187 } | 192 } |
188 | 193 |
189 | 194 |
190 void OS::DebugBreak() { | 195 void OS::DebugBreak() { |
191 #if (defined(__arm__) || defined(__thumb__)) | 196 #if (defined(__arm__) || defined(__thumb__)) |
192 # if defined(CAN_USE_ARMV5_INSTRUCTIONS) | 197 # if defined(CAN_USE_ARMV5_INSTRUCTIONS) |
193 asm("bkpt 0"); | 198 asm("bkpt 0"); |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 | 892 |
888 | 893 |
889 void Sampler::Stop() { | 894 void Sampler::Stop() { |
890 ASSERT(IsActive()); | 895 ASSERT(IsActive()); |
891 SignalSender::RemoveActiveSampler(this); | 896 SignalSender::RemoveActiveSampler(this); |
892 SetActive(false); | 897 SetActive(false); |
893 } | 898 } |
894 | 899 |
895 | 900 |
896 } } // namespace v8::internal | 901 } } // namespace v8::internal |
OLD | NEW |