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 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 } | 1081 } |
1082 if (v8::Locker::IsActive() && | 1082 if (v8::Locker::IsActive() && |
1083 !isolate->thread_manager()->IsLockedByCurrentThread()) { | 1083 !isolate->thread_manager()->IsLockedByCurrentThread()) { |
1084 return; | 1084 return; |
1085 } | 1085 } |
1086 | 1086 |
1087 Sampler* sampler = isolate->logger()->sampler(); | 1087 Sampler* sampler = isolate->logger()->sampler(); |
1088 if (sampler == NULL || !sampler->IsActive()) return; | 1088 if (sampler == NULL || !sampler->IsActive()) return; |
1089 | 1089 |
1090 TickSample sample_obj; | 1090 TickSample sample_obj; |
1091 TickSample* sample = CpuProfiler::TickSampleEvent(isolate); | 1091 TickSample* sample = isolate->cpu_profiler()->TickSampleEvent(); |
1092 if (sample == NULL) sample = &sample_obj; | 1092 if (sample == NULL) sample = &sample_obj; |
1093 | 1093 |
1094 // Extracting the sample from the context is extremely machine dependent. | 1094 // Extracting the sample from the context is extremely machine dependent. |
1095 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); | 1095 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); |
1096 mcontext_t& mcontext = ucontext->uc_mcontext; | 1096 mcontext_t& mcontext = ucontext->uc_mcontext; |
1097 sample->state = isolate->current_vm_state(); | 1097 sample->state = isolate->current_vm_state(); |
1098 #if V8_HOST_ARCH_IA32 | 1098 #if V8_HOST_ARCH_IA32 |
1099 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_EIP]); | 1099 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_EIP]); |
1100 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_ESP]); | 1100 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_ESP]); |
1101 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_EBP]); | 1101 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_EBP]); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 | 1325 |
1326 | 1326 |
1327 void Sampler::Stop() { | 1327 void Sampler::Stop() { |
1328 ASSERT(IsActive()); | 1328 ASSERT(IsActive()); |
1329 SignalSender::RemoveActiveSampler(this); | 1329 SignalSender::RemoveActiveSampler(this); |
1330 SetActive(false); | 1330 SetActive(false); |
1331 } | 1331 } |
1332 | 1332 |
1333 | 1333 |
1334 } } // namespace v8::internal | 1334 } } // namespace v8::internal |
OLD | NEW |