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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 // If profiling, we extract the current pc and sp. | 598 // If profiling, we extract the current pc and sp. |
599 if (active_sampler_->IsProfiling()) { | 599 if (active_sampler_->IsProfiling()) { |
600 // Extracting the sample from the context is extremely machine dependent. | 600 // Extracting the sample from the context is extremely machine dependent. |
601 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); | 601 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); |
602 mcontext_t& mcontext = ucontext->uc_mcontext; | 602 mcontext_t& mcontext = ucontext->uc_mcontext; |
603 #if V8_HOST_ARCH_IA32 | 603 #if V8_HOST_ARCH_IA32 |
604 sample.pc = mcontext.gregs[REG_EIP]; | 604 sample.pc = mcontext.gregs[REG_EIP]; |
605 sample.sp = mcontext.gregs[REG_ESP]; | 605 sample.sp = mcontext.gregs[REG_ESP]; |
606 sample.fp = mcontext.gregs[REG_EBP]; | 606 sample.fp = mcontext.gregs[REG_EBP]; |
607 #elif V8_HOST_ARCH_X64 | 607 #elif V8_HOST_ARCH_X64 |
608 UNIMPLEMENTED(); | |
609 sample.pc = mcontext.gregs[REG_RIP]; | 608 sample.pc = mcontext.gregs[REG_RIP]; |
610 sample.sp = mcontext.gregs[REG_RSP]; | 609 sample.sp = mcontext.gregs[REG_RSP]; |
611 sample.fp = mcontext.gregs[REG_RBP]; | 610 sample.fp = mcontext.gregs[REG_RBP]; |
612 #elif V8_HOST_ARCH_ARM | 611 #elif V8_HOST_ARCH_ARM |
613 sample.pc = mcontext.gregs[R15]; | 612 sample.pc = mcontext.gregs[R15]; |
614 sample.sp = mcontext.gregs[R13]; | 613 sample.sp = mcontext.gregs[R13]; |
615 sample.fp = mcontext.gregs[R11]; | 614 sample.fp = mcontext.gregs[R11]; |
616 #endif | 615 #endif |
617 } | 616 } |
618 | 617 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 } | 681 } |
683 | 682 |
684 // This sampler is no longer the active sampler. | 683 // This sampler is no longer the active sampler. |
685 active_sampler_ = NULL; | 684 active_sampler_ = NULL; |
686 active_ = false; | 685 active_ = false; |
687 } | 686 } |
688 | 687 |
689 #endif // ENABLE_LOGGING_AND_PROFILING | 688 #endif // ENABLE_LOGGING_AND_PROFILING |
690 | 689 |
691 } } // namespace v8::internal | 690 } } // namespace v8::internal |
OLD | NEW |