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 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 typedef uint32_t __sigset_t; | 957 typedef uint32_t __sigset_t; |
958 typedef struct sigcontext mcontext_t; | 958 typedef struct sigcontext mcontext_t; |
959 typedef struct ucontext { | 959 typedef struct ucontext { |
960 uint32_t uc_flags; | 960 uint32_t uc_flags; |
961 struct ucontext* uc_link; | 961 struct ucontext* uc_link; |
962 stack_t uc_stack; | 962 stack_t uc_stack; |
963 mcontext_t uc_mcontext; | 963 mcontext_t uc_mcontext; |
964 __sigset_t uc_sigmask; | 964 __sigset_t uc_sigmask; |
965 } ucontext_t; | 965 } ucontext_t; |
966 | 966 |
| 967 #elif !defined(__GLIBC__) && defined(__i386__) |
| 968 // x86 version for Android. |
| 969 struct _libc_fpreg { |
| 970 uint16_t significand[4]; |
| 971 uint16_t exponent; |
| 972 }; |
| 973 |
| 974 struct _libc_fpstate { |
| 975 uint64_t cw; |
| 976 uint64_t sw; |
| 977 uint64_t tag; |
| 978 uint64_t ipoff; |
| 979 uint64_t cssel; |
| 980 uint64_t dataoff; |
| 981 uint64_t datasel; |
| 982 struct _libc_fpreg _st[8]; |
| 983 uint64_t status; |
| 984 }; |
| 985 |
| 986 typedef struct _libc_fpstate *fpregset_t; |
| 987 |
| 988 typedef struct mcontext { |
| 989 int32_t gregs[19]; |
| 990 fpregset_t fpregs; |
| 991 int64_t oldmask; |
| 992 int64_t cr2; |
| 993 } mcontext_t; |
| 994 |
| 995 typedef uint64_t __sigset_t; |
| 996 |
| 997 typedef struct ucontext { |
| 998 uint64_t uc_flags; |
| 999 struct ucontext *uc_link; |
| 1000 stack_t uc_stack; |
| 1001 mcontext_t uc_mcontext; |
| 1002 __sigset_t uc_sigmask; |
| 1003 struct _libc_fpstate __fpregs_mem; |
| 1004 } ucontext_t; |
| 1005 |
| 1006 enum { REG_EBP = 6, REG_ESP = 7, REG_EIP = 14 }; |
967 #endif | 1007 #endif |
968 | 1008 |
969 | 1009 |
970 static int GetThreadID() { | 1010 static int GetThreadID() { |
971 // Glibc doesn't provide a wrapper for gettid(2). | 1011 // Glibc doesn't provide a wrapper for gettid(2). |
972 #if defined(ANDROID) | 1012 #if defined(ANDROID) |
973 return syscall(__NR_gettid); | 1013 return syscall(__NR_gettid); |
974 #else | 1014 #else |
975 return syscall(SYS_gettid); | 1015 return syscall(SYS_gettid); |
976 #endif | 1016 #endif |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 | 1305 |
1266 | 1306 |
1267 void Sampler::Stop() { | 1307 void Sampler::Stop() { |
1268 ASSERT(IsActive()); | 1308 ASSERT(IsActive()); |
1269 SignalSender::RemoveActiveSampler(this); | 1309 SignalSender::RemoveActiveSampler(this); |
1270 SetActive(false); | 1310 SetActive(false); |
1271 } | 1311 } |
1272 | 1312 |
1273 | 1313 |
1274 } } // namespace v8::internal | 1314 } } // namespace v8::internal |
OLD | NEW |