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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 OS::Sleep(interval_); | 489 OS::Sleep(interval_); |
490 } | 490 } |
491 } | 491 } |
492 | 492 |
493 private: | 493 private: |
494 #if defined(USE_SIGNALS) | 494 #if defined(USE_SIGNALS) |
495 | 495 |
496 void SampleContext(Sampler* sampler) { | 496 void SampleContext(Sampler* sampler) { |
497 if (!SignalHandler::Installed()) return; | 497 if (!SignalHandler::Installed()) return; |
498 pthread_t tid = sampler->platform_data()->vm_tid(); | 498 pthread_t tid = sampler->platform_data()->vm_tid(); |
499 int result = pthread_kill(tid, SIGPROF); | 499 pthread_kill(tid, SIGPROF); |
500 USE(result); | |
501 ASSERT(result == 0); | |
502 } | 500 } |
503 | 501 |
504 #elif defined(__MACH__) | 502 #elif defined(__MACH__) |
505 | 503 |
506 void SampleContext(Sampler* sampler) { | 504 void SampleContext(Sampler* sampler) { |
507 thread_act_t profiled_thread = sampler->platform_data()->profiled_thread(); | 505 thread_act_t profiled_thread = sampler->platform_data()->profiled_thread(); |
508 Isolate* isolate = sampler->isolate(); | 506 Isolate* isolate = sampler->isolate(); |
509 | 507 |
510 SampleHelper helper; | 508 SampleHelper helper; |
511 TickSample* sample = helper.Init(sampler, isolate); | 509 TickSample* sample = helper.Init(sampler, isolate); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 SamplerThread::RemoveActiveSampler(this); | 683 SamplerThread::RemoveActiveSampler(this); |
686 SetActive(false); | 684 SetActive(false); |
687 } | 685 } |
688 | 686 |
689 void Sampler::SampleStack(TickSample* sample) { | 687 void Sampler::SampleStack(TickSample* sample) { |
690 sample->Trace(isolate_); | 688 sample->Trace(isolate_); |
691 if (++samples_taken_ < 0) samples_taken_ = 0; | 689 if (++samples_taken_ < 0) samples_taken_ = 0; |
692 } | 690 } |
693 | 691 |
694 } } // namespace v8::internal | 692 } } // namespace v8::internal |
OLD | NEW |