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