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