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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 // Returns the local time offset in milliseconds east of UTC without | 145 // Returns the local time offset in milliseconds east of UTC without |
146 // taking daylight savings time into account. | 146 // taking daylight savings time into account. |
147 static double LocalTimeOffset(); | 147 static double LocalTimeOffset(); |
148 | 148 |
149 // Returns the daylight savings offset for the given time. | 149 // Returns the daylight savings offset for the given time. |
150 static double DaylightSavingsOffset(double time); | 150 static double DaylightSavingsOffset(double time); |
151 | 151 |
152 static FILE* FOpen(const char* path, const char* mode); | 152 static FILE* FOpen(const char* path, const char* mode); |
153 | 153 |
| 154 // Log file open mode is platform-dependent due to line ends issues. |
| 155 static const char* LogFileOpenMode; |
| 156 |
154 // Print output to console. This is mostly used for debugging output. | 157 // Print output to console. This is mostly used for debugging output. |
155 // On platforms that has standard terminal output, the output | 158 // On platforms that has standard terminal output, the output |
156 // should go to stdout. | 159 // should go to stdout. |
157 static void Print(const char* format, ...); | 160 static void Print(const char* format, ...); |
158 static void VPrint(const char* format, va_list args); | 161 static void VPrint(const char* format, va_list args); |
159 | 162 |
160 // Print error output to console. This is mostly used for error message | 163 // Print error output to console. This is mostly used for error message |
161 // output. On platforms that has standard terminal output, the output | 164 // output. On platforms that has standard terminal output, the output |
162 // should go to stderr. | 165 // should go to stderr. |
163 static void PrintError(const char* format, ...); | 166 static void PrintError(const char* format, ...); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 // the thread that created it. | 480 // the thread that created it. |
478 | 481 |
479 // TickSample captures the information collected for each sample. | 482 // TickSample captures the information collected for each sample. |
480 class TickSample { | 483 class TickSample { |
481 public: | 484 public: |
482 TickSample() : pc(0), sp(0), fp(0), state(OTHER) {} | 485 TickSample() : pc(0), sp(0), fp(0), state(OTHER) {} |
483 unsigned int pc; // Instruction pointer. | 486 unsigned int pc; // Instruction pointer. |
484 unsigned int sp; // Stack pointer. | 487 unsigned int sp; // Stack pointer. |
485 unsigned int fp; // Frame pointer. | 488 unsigned int fp; // Frame pointer. |
486 StateTag state; // The state of the VM. | 489 StateTag state; // The state of the VM. |
487 static const int kMaxFramesCount = 5; | 490 static const int kMaxFramesCount = 100; |
488 EmbeddedVector<Address, kMaxFramesCount> stack; // Call stack. | 491 EmbeddedVector<Address, kMaxFramesCount> stack; // Call stack. |
489 int frames_count; // Number of captured frames. | 492 int frames_count; // Number of captured frames. |
490 }; | 493 }; |
491 | 494 |
492 class Sampler { | 495 class Sampler { |
493 public: | 496 public: |
494 // Initialize sampler. | 497 // Initialize sampler. |
495 explicit Sampler(int interval, bool profiling); | 498 explicit Sampler(int interval, bool profiling); |
496 virtual ~Sampler(); | 499 virtual ~Sampler(); |
497 | 500 |
(...skipping 18 matching lines...) Expand all Loading... |
516 bool active_; | 519 bool active_; |
517 PlatformData* data_; // Platform specific data. | 520 PlatformData* data_; // Platform specific data. |
518 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 521 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
519 }; | 522 }; |
520 | 523 |
521 #endif // ENABLE_LOGGING_AND_PROFILING | 524 #endif // ENABLE_LOGGING_AND_PROFILING |
522 | 525 |
523 } } // namespace v8::internal | 526 } } // namespace v8::internal |
524 | 527 |
525 #endif // V8_PLATFORM_H_ | 528 #endif // V8_PLATFORM_H_ |
OLD | NEW |