| 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 reinterpret_cast<Sampler::PlatformData*>(arg); | 627 reinterpret_cast<Sampler::PlatformData*>(arg); |
| 628 data->Runner(); | 628 data->Runner(); |
| 629 return 0; | 629 return 0; |
| 630 } | 630 } |
| 631 | 631 |
| 632 | 632 |
| 633 Sampler::Sampler(int interval, bool profiling) | 633 Sampler::Sampler(int interval, bool profiling) |
| 634 : interval_(interval), | 634 : interval_(interval), |
| 635 profiling_(profiling), | 635 profiling_(profiling), |
| 636 synchronous_(profiling), | 636 synchronous_(profiling), |
| 637 active_(false) { | 637 active_(false), |
| 638 samples_taken_(0) { |
| 638 data_ = new PlatformData(this); | 639 data_ = new PlatformData(this); |
| 639 } | 640 } |
| 640 | 641 |
| 641 | 642 |
| 642 Sampler::~Sampler() { | 643 Sampler::~Sampler() { |
| 643 delete data_; | 644 delete data_; |
| 644 } | 645 } |
| 645 | 646 |
| 646 | 647 |
| 647 void Sampler::Start() { | 648 void Sampler::Start() { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 677 | 678 |
| 678 // Deallocate Mach port for thread. | 679 // Deallocate Mach port for thread. |
| 679 if (IsSynchronous()) { | 680 if (IsSynchronous()) { |
| 680 mach_port_deallocate(data_->task_self_, data_->profiled_thread_); | 681 mach_port_deallocate(data_->task_self_, data_->profiled_thread_); |
| 681 } | 682 } |
| 682 } | 683 } |
| 683 | 684 |
| 684 #endif // ENABLE_LOGGING_AND_PROFILING | 685 #endif // ENABLE_LOGGING_AND_PROFILING |
| 685 | 686 |
| 686 } } // namespace v8::internal | 687 } } // namespace v8::internal |
| OLD | NEW |