| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 // ---------------------------------------------------------------------------- | 486 // ---------------------------------------------------------------------------- |
| 487 // Sampler | 487 // Sampler |
| 488 // | 488 // |
| 489 // A sampler periodically samples the state of the VM and optionally | 489 // A sampler periodically samples the state of the VM and optionally |
| 490 // (if used for profiling) the program counter and stack pointer for | 490 // (if used for profiling) the program counter and stack pointer for |
| 491 // the thread that created it. | 491 // the thread that created it. |
| 492 | 492 |
| 493 // TickSample captures the information collected for each sample. | 493 // TickSample captures the information collected for each sample. |
| 494 class TickSample { | 494 class TickSample { |
| 495 public: | 495 public: |
| 496 TickSample() : pc(0), sp(0), fp(0), state(OTHER) {} | 496 TickSample() : pc(0), sp(0), fp(0), state(OTHER), frames_count(0) {} |
| 497 uintptr_t pc; // Instruction pointer. | 497 uintptr_t pc; // Instruction pointer. |
| 498 uintptr_t sp; // Stack pointer. | 498 uintptr_t sp; // Stack pointer. |
| 499 uintptr_t fp; // Frame pointer. | 499 uintptr_t fp; // Frame pointer. |
| 500 StateTag state; // The state of the VM. | 500 StateTag state; // The state of the VM. |
| 501 static const int kMaxFramesCount = 100; | 501 static const int kMaxFramesCount = 100; |
| 502 EmbeddedVector<Address, kMaxFramesCount> stack; // Call stack. | 502 EmbeddedVector<Address, kMaxFramesCount> stack; // Call stack. |
| 503 int frames_count; // Number of captured frames. | 503 int frames_count; // Number of captured frames. |
| 504 }; | 504 }; |
| 505 | 505 |
| 506 class Sampler { | 506 class Sampler { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 531 bool active_; | 531 bool active_; |
| 532 PlatformData* data_; // Platform specific data. | 532 PlatformData* data_; // Platform specific data. |
| 533 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 533 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 534 }; | 534 }; |
| 535 | 535 |
| 536 #endif // ENABLE_LOGGING_AND_PROFILING | 536 #endif // ENABLE_LOGGING_AND_PROFILING |
| 537 | 537 |
| 538 } } // namespace v8::internal | 538 } } // namespace v8::internal |
| 539 | 539 |
| 540 #endif // V8_PLATFORM_H_ | 540 #endif // V8_PLATFORM_H_ |
| OLD | NEW |