| 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 return; | 664 return; |
| 665 } | 665 } |
| 666 if (v8::Locker::IsActive() && | 666 if (v8::Locker::IsActive() && |
| 667 !isolate->thread_manager()->IsLockedByCurrentThread()) { | 667 !isolate->thread_manager()->IsLockedByCurrentThread()) { |
| 668 return; | 668 return; |
| 669 } | 669 } |
| 670 | 670 |
| 671 Sampler* sampler = isolate->logger()->sampler(); | 671 Sampler* sampler = isolate->logger()->sampler(); |
| 672 if (sampler == NULL || !sampler->IsActive()) return; | 672 if (sampler == NULL || !sampler->IsActive()) return; |
| 673 | 673 |
| 674 TickSample sample_obj; |
| 674 TickSample* sample = CpuProfiler::StartTickSampleEvent(isolate); | 675 TickSample* sample = CpuProfiler::StartTickSampleEvent(isolate); |
| 675 if (sample == NULL) return; | 676 if (sample == NULL) sample = &sample_obj; |
| 676 | 677 |
| 677 // Extracting the sample from the context is extremely machine dependent. | 678 // Extracting the sample from the context is extremely machine dependent. |
| 678 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); | 679 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); |
| 679 mcontext_t& mcontext = ucontext->uc_mcontext; | 680 mcontext_t& mcontext = ucontext->uc_mcontext; |
| 680 sample->state = isolate->current_vm_state(); | 681 sample->state = isolate->current_vm_state(); |
| 681 | 682 |
| 682 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_PC]); | 683 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_PC]); |
| 683 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_SP]); | 684 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_SP]); |
| 684 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_FP]); | 685 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_FP]); |
| 685 | 686 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 SignalSender::AddActiveSampler(this); | 901 SignalSender::AddActiveSampler(this); |
| 901 } | 902 } |
| 902 | 903 |
| 903 | 904 |
| 904 void Sampler::Stop() { | 905 void Sampler::Stop() { |
| 905 ASSERT(IsActive()); | 906 ASSERT(IsActive()); |
| 906 SignalSender::RemoveActiveSampler(this); | 907 SignalSender::RemoveActiveSampler(this); |
| 907 SetActive(false); | 908 SetActive(false); |
| 908 } | 909 } |
| 909 | 910 |
| 911 |
| 912 void Sampler::StartSampling() { |
| 913 } |
| 914 |
| 915 |
| 916 void Sampler::StopSampling() { |
| 917 } |
| 918 |
| 919 |
| 910 } } // namespace v8::internal | 920 } } // namespace v8::internal |
| OLD | NEW |