| 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 // the thread that created it. | 569 // the thread that created it. |
| 570 | 570 |
| 571 // TickSample captures the information collected for each sample. | 571 // TickSample captures the information collected for each sample. |
| 572 class TickSample { | 572 class TickSample { |
| 573 public: | 573 public: |
| 574 TickSample() | 574 TickSample() |
| 575 : state(OTHER), | 575 : state(OTHER), |
| 576 pc(NULL), | 576 pc(NULL), |
| 577 sp(NULL), | 577 sp(NULL), |
| 578 fp(NULL), | 578 fp(NULL), |
| 579 function(NULL), | 579 tos(NULL), |
| 580 frames_count(0) {} | 580 frames_count(0) {} |
| 581 StateTag state; // The state of the VM. | 581 StateTag state; // The state of the VM. |
| 582 Address pc; // Instruction pointer. | 582 Address pc; // Instruction pointer. |
| 583 Address sp; // Stack pointer. | 583 Address sp; // Stack pointer. |
| 584 Address fp; // Frame pointer. | 584 Address fp; // Frame pointer. |
| 585 Address function; // The last called JS function. | 585 Address tos; // Top stack value (*sp). |
| 586 static const int kMaxFramesCount = 64; | 586 static const int kMaxFramesCount = 64; |
| 587 Address stack[kMaxFramesCount]; // Call stack. | 587 Address stack[kMaxFramesCount]; // Call stack. |
| 588 int frames_count; // Number of captured frames. | 588 int frames_count; // Number of captured frames. |
| 589 }; | 589 }; |
| 590 | 590 |
| 591 #ifdef ENABLE_LOGGING_AND_PROFILING | 591 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 592 class Sampler { | 592 class Sampler { |
| 593 public: | 593 public: |
| 594 // Initialize sampler. | 594 // Initialize sampler. |
| 595 explicit Sampler(int interval); | 595 explicit Sampler(int interval); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 PlatformData* data_; // Platform specific data. | 636 PlatformData* data_; // Platform specific data. |
| 637 int samples_taken_; // Counts stack samples taken. | 637 int samples_taken_; // Counts stack samples taken. |
| 638 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 638 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 639 }; | 639 }; |
| 640 | 640 |
| 641 #endif // ENABLE_LOGGING_AND_PROFILING | 641 #endif // ENABLE_LOGGING_AND_PROFILING |
| 642 | 642 |
| 643 } } // namespace v8::internal | 643 } } // namespace v8::internal |
| 644 | 644 |
| 645 #endif // V8_PLATFORM_H_ | 645 #endif // V8_PLATFORM_H_ |
| OLD | NEW |