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 |
11 #include <errno.h> | 11 #include <errno.h> |
12 #include <pthread.h> | 12 #include <pthread.h> |
13 #include <signal.h> | 13 #include <signal.h> |
14 #include <sys/time.h> | 14 #include <sys/time.h> |
15 | 15 |
16 #if !V8_OS_QNX | 16 #if !V8_OS_QNX |
17 #include <sys/syscall.h> | 17 #include <sys/syscall.h> // NOLINT |
18 #endif | 18 #endif |
19 | 19 |
20 #if V8_OS_MACOSX | 20 #if V8_OS_MACOSX |
21 #include <mach/mach.h> | 21 #include <mach/mach.h> |
22 // OpenBSD doesn't have <ucontext.h>. ucontext_t lives in <signal.h> | 22 // OpenBSD doesn't have <ucontext.h>. ucontext_t lives in <signal.h> |
23 // and is a typedef for struct sigcontext. There is no uc_mcontext. | 23 // and is a typedef for struct sigcontext. There is no uc_mcontext. |
24 #elif(!V8_OS_ANDROID || defined(__BIONIC_HAVE_UCONTEXT_T)) \ | 24 #elif(!V8_OS_ANDROID || defined(__BIONIC_HAVE_UCONTEXT_T)) \ |
25 && !V8_OS_OPENBSD | 25 && !V8_OS_OPENBSD |
26 #include <ucontext.h> | 26 #include <ucontext.h> |
27 #endif | 27 #endif |
28 | 28 |
29 #include <unistd.h> | 29 #include <unistd.h> |
30 | 30 |
31 // GLibc on ARM defines mcontext_t has a typedef for 'struct sigcontext'. | 31 // GLibc on ARM defines mcontext_t has a typedef for 'struct sigcontext'. |
32 // Old versions of the C library <signal.h> didn't define the type. | 32 // Old versions of the C library <signal.h> didn't define the type. |
33 #if V8_OS_ANDROID && !defined(__BIONIC_HAVE_UCONTEXT_T) && \ | 33 #if V8_OS_ANDROID && !defined(__BIONIC_HAVE_UCONTEXT_T) && \ |
34 (defined(__arm__) || defined(__aarch64__)) && \ | 34 (defined(__arm__) || defined(__aarch64__)) && \ |
35 !defined(__BIONIC_HAVE_STRUCT_SIGCONTEXT) | 35 !defined(__BIONIC_HAVE_STRUCT_SIGCONTEXT) |
36 #include <asm/sigcontext.h> | 36 #include <asm/sigcontext.h> // NOLINT |
37 #endif | 37 #endif |
38 | 38 |
39 #elif V8_OS_WIN || V8_OS_CYGWIN | 39 #elif V8_OS_WIN || V8_OS_CYGWIN |
40 | 40 |
41 #include "src/base/win32-headers.h" | 41 #include "src/base/win32-headers.h" |
42 | 42 |
43 #endif | 43 #endif |
44 | 44 |
45 #include "src/v8.h" | 45 #include "src/v8.h" |
46 | 46 |
(...skipping 681 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 |