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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 | 381 |
382 | 382 |
383 void OS::Sleep(int milliseconds) { | 383 void OS::Sleep(int milliseconds) { |
384 unsigned int ms = static_cast<unsigned int>(milliseconds); | 384 unsigned int ms = static_cast<unsigned int>(milliseconds); |
385 usleep(1000 * ms); | 385 usleep(1000 * ms); |
386 } | 386 } |
387 | 387 |
388 | 388 |
389 void OS::Abort() { | 389 void OS::Abort() { |
390 // Redirect to std abort to signal abnormal program termination. | 390 // Redirect to std abort to signal abnormal program termination. |
| 391 if (FLAG_break_on_abort) { |
| 392 DebugBreak(); |
| 393 } |
391 abort(); | 394 abort(); |
392 } | 395 } |
393 | 396 |
394 | 397 |
395 void OS::DebugBreak() { | 398 void OS::DebugBreak() { |
396 // TODO(lrn): Introduce processor define for runtime system (!= V8_ARCH_x, | 399 // TODO(lrn): Introduce processor define for runtime system (!= V8_ARCH_x, |
397 // which is the architecture of generated code). | 400 // which is the architecture of generated code). |
398 #if (defined(__arm__) || defined(__thumb__)) | 401 #if (defined(__arm__) || defined(__thumb__)) |
399 # if defined(CAN_USE_ARMV5_INSTRUCTIONS) | 402 # if defined(CAN_USE_ARMV5_INSTRUCTIONS) |
400 asm("bkpt 0"); | 403 asm("bkpt 0"); |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 | 1249 |
1247 | 1250 |
1248 void Sampler::Stop() { | 1251 void Sampler::Stop() { |
1249 ASSERT(IsActive()); | 1252 ASSERT(IsActive()); |
1250 SignalSender::RemoveActiveSampler(this); | 1253 SignalSender::RemoveActiveSampler(this); |
1251 SetActive(false); | 1254 SetActive(false); |
1252 } | 1255 } |
1253 | 1256 |
1254 | 1257 |
1255 } } // namespace v8::internal | 1258 } } // namespace v8::internal |
OLD | NEW |