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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 } | 741 } |
742 if (v8::Locker::IsActive() && | 742 if (v8::Locker::IsActive() && |
743 !isolate->thread_manager()->IsLockedByCurrentThread()) { | 743 !isolate->thread_manager()->IsLockedByCurrentThread()) { |
744 return; | 744 return; |
745 } | 745 } |
746 | 746 |
747 Sampler* sampler = isolate->logger()->sampler(); | 747 Sampler* sampler = isolate->logger()->sampler(); |
748 if (sampler == NULL || !sampler->IsActive()) return; | 748 if (sampler == NULL || !sampler->IsActive()) return; |
749 | 749 |
750 TickSample sample_obj; | 750 TickSample sample_obj; |
751 TickSample* sample = CpuProfiler::TickSampleEvent(isolate); | 751 TickSample* sample = isolate->cpu_profiler()->TickSampleEvent(); |
752 if (sample == NULL) sample = &sample_obj; | 752 if (sample == NULL) sample = &sample_obj; |
753 | 753 |
754 // Extracting the sample from the context is extremely machine dependent. | 754 // Extracting the sample from the context is extremely machine dependent. |
755 sample->state = isolate->current_vm_state(); | 755 sample->state = isolate->current_vm_state(); |
756 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); | 756 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); |
757 #ifdef __NetBSD__ | 757 #ifdef __NetBSD__ |
758 mcontext_t& mcontext = ucontext->uc_mcontext; | 758 mcontext_t& mcontext = ucontext->uc_mcontext; |
759 #if V8_HOST_ARCH_IA32 | 759 #if V8_HOST_ARCH_IA32 |
760 sample->pc = reinterpret_cast<Address>(mcontext.__gregs[_REG_EIP]); | 760 sample->pc = reinterpret_cast<Address>(mcontext.__gregs[_REG_EIP]); |
761 sample->sp = reinterpret_cast<Address>(mcontext.__gregs[_REG_ESP]); | 761 sample->sp = reinterpret_cast<Address>(mcontext.__gregs[_REG_ESP]); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 | 949 |
950 | 950 |
951 void Sampler::Stop() { | 951 void Sampler::Stop() { |
952 ASSERT(IsActive()); | 952 ASSERT(IsActive()); |
953 SignalSender::RemoveActiveSampler(this); | 953 SignalSender::RemoveActiveSampler(this); |
954 SetActive(false); | 954 SetActive(false); |
955 } | 955 } |
956 | 956 |
957 | 957 |
958 } } // namespace v8::internal | 958 } } // namespace v8::internal |
OLD | NEW |