OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 union { | 590 union { |
591 Address tos; // Top stack value (*sp). | 591 Address tos; // Top stack value (*sp). |
592 Address external_callback; | 592 Address external_callback; |
593 }; | 593 }; |
594 static const int kMaxFramesCount = 64; | 594 static const int kMaxFramesCount = 64; |
595 Address stack[kMaxFramesCount]; // Call stack. | 595 Address stack[kMaxFramesCount]; // Call stack. |
596 int frames_count : 8; // Number of captured frames. | 596 int frames_count : 8; // Number of captured frames. |
597 bool has_external_callback : 1; | 597 bool has_external_callback : 1; |
598 }; | 598 }; |
599 | 599 |
600 #ifdef ENABLE_LOGGING_AND_PROFILING | |
601 class Sampler { | 600 class Sampler { |
602 public: | 601 public: |
603 // Initialize sampler. | 602 // Initialize sampler. |
604 Sampler(Isolate* isolate, int interval); | 603 Sampler(Isolate* isolate, int interval); |
605 virtual ~Sampler(); | 604 virtual ~Sampler(); |
606 | 605 |
607 int interval() const { return interval_; } | 606 int interval() const { return interval_; } |
608 | 607 |
609 // Performs stack sampling. | 608 // Performs stack sampling. |
610 void SampleStack(TickSample* sample) { | 609 void SampleStack(TickSample* sample) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 Isolate* isolate_; | 648 Isolate* isolate_; |
650 const int interval_; | 649 const int interval_; |
651 Atomic32 profiling_; | 650 Atomic32 profiling_; |
652 Atomic32 active_; | 651 Atomic32 active_; |
653 PlatformData* data_; // Platform specific data. | 652 PlatformData* data_; // Platform specific data. |
654 int samples_taken_; // Counts stack samples taken. | 653 int samples_taken_; // Counts stack samples taken. |
655 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 654 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
656 }; | 655 }; |
657 | 656 |
658 | 657 |
659 #endif // ENABLE_LOGGING_AND_PROFILING | |
660 | |
661 } } // namespace v8::internal | 658 } } // namespace v8::internal |
662 | 659 |
663 #endif // V8_PLATFORM_H_ | 660 #endif // V8_PLATFORM_H_ |
OLD | NEW |