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