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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 ASSERT(result == 0); | 396 ASSERT(result == 0); |
397 } | 397 } |
398 | 398 |
399 | 399 |
400 void OS::Sleep(int milliseconds) { | 400 void OS::Sleep(int milliseconds) { |
401 unsigned int ms = static_cast<unsigned int>(milliseconds); | 401 unsigned int ms = static_cast<unsigned int>(milliseconds); |
402 usleep(1000 * ms); | 402 usleep(1000 * ms); |
403 } | 403 } |
404 | 404 |
405 | 405 |
| 406 int OS::NumberOfCores() { |
| 407 return sysconf(_SC_NPROCESSORS_ONLN); |
| 408 } |
| 409 |
| 410 |
406 void OS::Abort() { | 411 void OS::Abort() { |
407 // Redirect to std abort to signal abnormal program termination. | 412 // Redirect to std abort to signal abnormal program termination. |
408 if (FLAG_break_on_abort) { | 413 if (FLAG_break_on_abort) { |
409 DebugBreak(); | 414 DebugBreak(); |
410 } | 415 } |
411 abort(); | 416 abort(); |
412 } | 417 } |
413 | 418 |
414 | 419 |
415 void OS::DebugBreak() { | 420 void OS::DebugBreak() { |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 | 1325 |
1321 | 1326 |
1322 void Sampler::Stop() { | 1327 void Sampler::Stop() { |
1323 ASSERT(IsActive()); | 1328 ASSERT(IsActive()); |
1324 SignalSender::RemoveActiveSampler(this); | 1329 SignalSender::RemoveActiveSampler(this); |
1325 SetActive(false); | 1330 SetActive(false); |
1326 } | 1331 } |
1327 | 1332 |
1328 | 1333 |
1329 } } // namespace v8::internal | 1334 } } // namespace v8::internal |
OLD | NEW |