OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 mcontext_t& mcontext = ucontext->uc_mcontext; | 604 mcontext_t& mcontext = ucontext->uc_mcontext; |
605 #if V8_HOST_ARCH_IA32 | 605 #if V8_HOST_ARCH_IA32 |
606 sample.pc = mcontext.gregs[REG_EIP]; | 606 sample.pc = mcontext.gregs[REG_EIP]; |
607 sample.sp = mcontext.gregs[REG_ESP]; | 607 sample.sp = mcontext.gregs[REG_ESP]; |
608 sample.fp = mcontext.gregs[REG_EBP]; | 608 sample.fp = mcontext.gregs[REG_EBP]; |
609 #elif V8_HOST_ARCH_X64 | 609 #elif V8_HOST_ARCH_X64 |
610 sample.pc = mcontext.gregs[REG_RIP]; | 610 sample.pc = mcontext.gregs[REG_RIP]; |
611 sample.sp = mcontext.gregs[REG_RSP]; | 611 sample.sp = mcontext.gregs[REG_RSP]; |
612 sample.fp = mcontext.gregs[REG_RBP]; | 612 sample.fp = mcontext.gregs[REG_RBP]; |
613 #elif V8_HOST_ARCH_ARM | 613 #elif V8_HOST_ARCH_ARM |
| 614 // An undefined macro evaluates to 0, so this applies to Android's Bionic also. |
| 615 #if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) |
614 sample.pc = mcontext.gregs[R15]; | 616 sample.pc = mcontext.gregs[R15]; |
615 sample.sp = mcontext.gregs[R13]; | 617 sample.sp = mcontext.gregs[R13]; |
616 sample.fp = mcontext.gregs[R11]; | 618 sample.fp = mcontext.gregs[R11]; |
| 619 #else |
| 620 sample.pc = mcontext.arm_pc; |
| 621 sample.sp = mcontext.arm_sp; |
| 622 sample.fp = mcontext.arm_fp; |
| 623 #endif |
617 #endif | 624 #endif |
618 } | 625 } |
619 | 626 |
620 // We always sample the VM state. | 627 // We always sample the VM state. |
621 sample.state = Logger::state(); | 628 sample.state = Logger::state(); |
622 | 629 |
623 active_sampler_->Tick(&sample); | 630 active_sampler_->Tick(&sample); |
624 } | 631 } |
625 | 632 |
626 | 633 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 } | 690 } |
684 | 691 |
685 // This sampler is no longer the active sampler. | 692 // This sampler is no longer the active sampler. |
686 active_sampler_ = NULL; | 693 active_sampler_ = NULL; |
687 active_ = false; | 694 active_ = false; |
688 } | 695 } |
689 | 696 |
690 #endif // ENABLE_LOGGING_AND_PROFILING | 697 #endif // ENABLE_LOGGING_AND_PROFILING |
691 | 698 |
692 } } // namespace v8::internal | 699 } } // namespace v8::internal |
OLD | NEW |