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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 #if V8_HOST_ARCH_IA32 | 1018 #if V8_HOST_ARCH_IA32 |
1019 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_EIP]); | 1019 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_EIP]); |
1020 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_ESP]); | 1020 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_ESP]); |
1021 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_EBP]); | 1021 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_EBP]); |
1022 #elif V8_HOST_ARCH_X64 | 1022 #elif V8_HOST_ARCH_X64 |
1023 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_RIP]); | 1023 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_RIP]); |
1024 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_RSP]); | 1024 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_RSP]); |
1025 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_RBP]); | 1025 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_RBP]); |
1026 #elif V8_HOST_ARCH_ARM | 1026 #elif V8_HOST_ARCH_ARM |
1027 // An undefined macro evaluates to 0, so this applies to Android's Bionic also. | 1027 // An undefined macro evaluates to 0, so this applies to Android's Bionic also. |
1028 #if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) | 1028 #if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3) && \ |
| 1029 !defined(__UCLIBC__)) |
1029 sample->pc = reinterpret_cast<Address>(mcontext.gregs[R15]); | 1030 sample->pc = reinterpret_cast<Address>(mcontext.gregs[R15]); |
1030 sample->sp = reinterpret_cast<Address>(mcontext.gregs[R13]); | 1031 sample->sp = reinterpret_cast<Address>(mcontext.gregs[R13]); |
1031 sample->fp = reinterpret_cast<Address>(mcontext.gregs[R11]); | 1032 sample->fp = reinterpret_cast<Address>(mcontext.gregs[R11]); |
1032 #else | 1033 #else |
1033 sample->pc = reinterpret_cast<Address>(mcontext.arm_pc); | 1034 sample->pc = reinterpret_cast<Address>(mcontext.arm_pc); |
1034 sample->sp = reinterpret_cast<Address>(mcontext.arm_sp); | 1035 sample->sp = reinterpret_cast<Address>(mcontext.arm_sp); |
1035 sample->fp = reinterpret_cast<Address>(mcontext.arm_fp); | 1036 sample->fp = reinterpret_cast<Address>(mcontext.arm_fp); |
1036 #endif // (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) | 1037 #endif // (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3) && |
| 1038 // !defined(__UCLIBC__)) |
1037 #elif V8_HOST_ARCH_MIPS | 1039 #elif V8_HOST_ARCH_MIPS |
1038 sample->pc = reinterpret_cast<Address>(mcontext.pc); | 1040 sample->pc = reinterpret_cast<Address>(mcontext.pc); |
1039 sample->sp = reinterpret_cast<Address>(mcontext.gregs[29]); | 1041 sample->sp = reinterpret_cast<Address>(mcontext.gregs[29]); |
1040 sample->fp = reinterpret_cast<Address>(mcontext.gregs[30]); | 1042 sample->fp = reinterpret_cast<Address>(mcontext.gregs[30]); |
1041 #endif // V8_HOST_ARCH_* | 1043 #endif // V8_HOST_ARCH_* |
1042 sampler->SampleStack(sample); | 1044 sampler->SampleStack(sample); |
1043 sampler->Tick(sample); | 1045 sampler->Tick(sample); |
1044 } | 1046 } |
1045 | 1047 |
1046 | 1048 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 | 1281 |
1280 | 1282 |
1281 void Sampler::Stop() { | 1283 void Sampler::Stop() { |
1282 ASSERT(IsActive()); | 1284 ASSERT(IsActive()); |
1283 SignalSender::RemoveActiveSampler(this); | 1285 SignalSender::RemoveActiveSampler(this); |
1284 SetActive(false); | 1286 SetActive(false); |
1285 } | 1287 } |
1286 | 1288 |
1287 | 1289 |
1288 } } // namespace v8::internal | 1290 } } // namespace v8::internal |
OLD | NEW |