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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 return; | 724 return; |
725 } | 725 } |
726 if (v8::Locker::IsActive() && | 726 if (v8::Locker::IsActive() && |
727 !isolate->thread_manager()->IsLockedByCurrentThread()) { | 727 !isolate->thread_manager()->IsLockedByCurrentThread()) { |
728 return; | 728 return; |
729 } | 729 } |
730 | 730 |
731 Sampler* sampler = isolate->logger()->sampler(); | 731 Sampler* sampler = isolate->logger()->sampler(); |
732 if (sampler == NULL || !sampler->IsActive()) return; | 732 if (sampler == NULL || !sampler->IsActive()) return; |
733 | 733 |
| 734 TickSample sample_obj; |
734 TickSample* sample = CpuProfiler::StartTickSampleEvent(isolate); | 735 TickSample* sample = CpuProfiler::StartTickSampleEvent(isolate); |
735 if (sample == NULL) return; | 736 if (sample == NULL) sample = &sample_obj; |
736 | 737 |
737 // Extracting the sample from the context is extremely machine dependent. | 738 // Extracting the sample from the context is extremely machine dependent. |
738 sample->state = isolate->current_vm_state(); | 739 sample->state = isolate->current_vm_state(); |
739 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); | 740 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); |
740 #ifdef __NetBSD__ | 741 #ifdef __NetBSD__ |
741 mcontext_t& mcontext = ucontext->uc_mcontext; | 742 mcontext_t& mcontext = ucontext->uc_mcontext; |
742 #if V8_HOST_ARCH_IA32 | 743 #if V8_HOST_ARCH_IA32 |
743 sample->pc = reinterpret_cast<Address>(mcontext.__gregs[_REG_EIP]); | 744 sample->pc = reinterpret_cast<Address>(mcontext.__gregs[_REG_EIP]); |
744 sample->sp = reinterpret_cast<Address>(mcontext.__gregs[_REG_ESP]); | 745 sample->sp = reinterpret_cast<Address>(mcontext.__gregs[_REG_ESP]); |
745 sample->fp = reinterpret_cast<Address>(mcontext.__gregs[_REG_EBP]); | 746 sample->fp = reinterpret_cast<Address>(mcontext.__gregs[_REG_EBP]); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 } | 977 } |
977 | 978 |
978 | 979 |
979 void Sampler::Stop() { | 980 void Sampler::Stop() { |
980 ASSERT(IsActive()); | 981 ASSERT(IsActive()); |
981 SignalSender::RemoveActiveSampler(this); | 982 SignalSender::RemoveActiveSampler(this); |
982 SetActive(false); | 983 SetActive(false); |
983 } | 984 } |
984 | 985 |
985 | 986 |
| 987 void Sampler::StartSampling() { |
| 988 } |
| 989 |
| 990 |
| 991 void Sampler::StopSampling() { |
| 992 } |
| 993 |
| 994 |
986 } } // namespace v8::internal | 995 } } // namespace v8::internal |
OLD | NEW |