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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 TickSample sample; | 576 TickSample sample; |
577 | 577 |
578 // If profiling, we extract the current pc and sp. | 578 // If profiling, we extract the current pc and sp. |
579 if (active_sampler_->IsProfiling()) { | 579 if (active_sampler_->IsProfiling()) { |
580 // Extracting the sample from the context is extremely machine dependent. | 580 // Extracting the sample from the context is extremely machine dependent. |
581 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); | 581 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); |
582 mcontext_t& mcontext = ucontext->uc_mcontext; | 582 mcontext_t& mcontext = ucontext->uc_mcontext; |
583 #if __DARWIN_UNIX03 | 583 #if __DARWIN_UNIX03 |
584 sample.pc = mcontext->__ss.__eip; | 584 sample.pc = mcontext->__ss.__eip; |
585 sample.sp = mcontext->__ss.__esp; | 585 sample.sp = mcontext->__ss.__esp; |
| 586 sample.fp = mcontext->__ss.__ebp; |
586 #else // !__DARWIN_UNIX03 | 587 #else // !__DARWIN_UNIX03 |
587 sample.pc = mcontext->ss.eip; | 588 sample.pc = mcontext->ss.eip; |
588 sample.sp = mcontext->ss.esp; | 589 sample.sp = mcontext->ss.esp; |
| 590 sample.fp = mcontext->ss.ebp; |
589 #endif // __DARWIN_UNIX03 | 591 #endif // __DARWIN_UNIX03 |
590 } | 592 } |
591 | 593 |
592 // We always sample the VM state. | 594 // We always sample the VM state. |
593 sample.state = Logger::state(); | 595 sample.state = Logger::state(); |
594 | 596 |
595 active_sampler_->Tick(&sample); | 597 active_sampler_->Tick(&sample); |
596 } | 598 } |
597 | 599 |
598 | 600 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 } | 657 } |
656 | 658 |
657 // This sampler is no longer the active sampler. | 659 // This sampler is no longer the active sampler. |
658 active_sampler_ = NULL; | 660 active_sampler_ = NULL; |
659 active_ = false; | 661 active_ = false; |
660 } | 662 } |
661 | 663 |
662 #endif // ENABLE_LOGGING_AND_PROFILING | 664 #endif // ENABLE_LOGGING_AND_PROFILING |
663 | 665 |
664 } } // namespace v8::internal | 666 } } // namespace v8::internal |
OLD | NEW |