| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 OS::Sleep(interval_); | 504 OS::Sleep(interval_); |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 | 507 |
| 508 private: | 508 private: |
| 509 #if defined(USE_SIGNALS) | 509 #if defined(USE_SIGNALS) |
| 510 | 510 |
| 511 void SampleContext(Sampler* sampler) { | 511 void SampleContext(Sampler* sampler) { |
| 512 if (!SignalHandler::Installed()) return; | 512 if (!SignalHandler::Installed()) return; |
| 513 pthread_t tid = sampler->platform_data()->vm_tid(); | 513 pthread_t tid = sampler->platform_data()->vm_tid(); |
| 514 int result = pthread_kill(tid, SIGPROF); | 514 pthread_kill(tid, SIGPROF); |
| 515 USE(result); | |
| 516 ASSERT(result == 0); | |
| 517 } | 515 } |
| 518 | 516 |
| 519 #elif defined(__MACH__) | 517 #elif defined(__MACH__) |
| 520 | 518 |
| 521 void SampleContext(Sampler* sampler) { | 519 void SampleContext(Sampler* sampler) { |
| 522 thread_act_t profiled_thread = sampler->platform_data()->profiled_thread(); | 520 thread_act_t profiled_thread = sampler->platform_data()->profiled_thread(); |
| 523 Isolate* isolate = sampler->isolate(); | 521 Isolate* isolate = sampler->isolate(); |
| 524 | 522 |
| 525 SampleHelper helper; | 523 SampleHelper helper; |
| 526 TickSample* sample = helper.Init(sampler, isolate); | 524 TickSample* sample = helper.Init(sampler, isolate); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 SamplerThread::RemoveActiveSampler(this); | 698 SamplerThread::RemoveActiveSampler(this); |
| 701 SetActive(false); | 699 SetActive(false); |
| 702 } | 700 } |
| 703 | 701 |
| 704 void Sampler::SampleStack(TickSample* sample) { | 702 void Sampler::SampleStack(TickSample* sample) { |
| 705 sample->Trace(isolate_); | 703 sample->Trace(isolate_); |
| 706 if (++samples_taken_ < 0) samples_taken_ = 0; | 704 if (++samples_taken_ < 0) samples_taken_ = 0; |
| 707 } | 705 } |
| 708 | 706 |
| 709 } } // namespace v8::internal | 707 } } // namespace v8::internal |
| OLD | NEW |