| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/sampler.h" | 5 #include "src/sampler.h" |
| 6 | 6 |
| 7 #if V8_OS_POSIX && !V8_OS_CYGWIN | 7 #if V8_OS_POSIX && !V8_OS_CYGWIN |
| 8 | 8 |
| 9 #define USE_SIGNALS | 9 #define USE_SIGNALS |
| 10 | 10 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 324 |
| 325 void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info, | 325 void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info, |
| 326 void* context) { | 326 void* context) { |
| 327 #if V8_OS_NACL | 327 #if V8_OS_NACL |
| 328 // As Native Client does not support signal handling, profiling | 328 // As Native Client does not support signal handling, profiling |
| 329 // is disabled. | 329 // is disabled. |
| 330 return; | 330 return; |
| 331 #else | 331 #else |
| 332 USE(info); | 332 USE(info); |
| 333 if (signal != SIGPROF) return; | 333 if (signal != SIGPROF) return; |
| 334 Isolate* isolate = Isolate::UncheckedCurrent(); | 334 Isolate* isolate = Isolate::UncheckedReentrantCurrent(); |
| 335 if (isolate == NULL || !isolate->IsInitialized() || !isolate->IsInUse()) { | 335 if (isolate == NULL || !isolate->IsInitialized() || !isolate->IsInUse()) { |
| 336 // We require a fully initialized and entered isolate. | 336 // We require a fully initialized and entered isolate. |
| 337 return; | 337 return; |
| 338 } | 338 } |
| 339 if (v8::Locker::IsActive() && | 339 if (v8::Locker::IsActive() && |
| 340 !isolate->thread_manager()->IsLockedByCurrentThread()) { | 340 !isolate->thread_manager()->IsLockedByCurrentThread()) { |
| 341 return; | 341 return; |
| 342 } | 342 } |
| 343 | 343 |
| 344 Sampler* sampler = isolate->logger()->sampler(); | 344 Sampler* sampler = isolate->logger()->sampler(); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 #endif // USE_SIMULATOR | 728 #endif // USE_SIMULATOR |
| 729 SampleStack(state); | 729 SampleStack(state); |
| 730 } | 730 } |
| 731 ResumeThread(profiled_thread); | 731 ResumeThread(profiled_thread); |
| 732 } | 732 } |
| 733 | 733 |
| 734 #endif // USE_SIGNALS | 734 #endif // USE_SIGNALS |
| 735 | 735 |
| 736 | 736 |
| 737 } } // namespace v8::internal | 737 } } // namespace v8::internal |
| OLD | NEW |