OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class CodeMap; | 42 class CodeMap; |
43 class CompilationInfo; | 43 class CompilationInfo; |
44 class CpuProfile; | 44 class CpuProfile; |
45 class CpuProfilesCollection; | 45 class CpuProfilesCollection; |
46 class ProfileGenerator; | 46 class ProfileGenerator; |
47 class TokenEnumerator; | 47 class TokenEnumerator; |
48 | 48 |
49 #define CODE_EVENTS_TYPE_LIST(V) \ | 49 #define CODE_EVENTS_TYPE_LIST(V) \ |
50 V(CODE_CREATION, CodeCreateEventRecord) \ | 50 V(CODE_CREATION, CodeCreateEventRecord) \ |
51 V(CODE_MOVE, CodeMoveEventRecord) \ | 51 V(CODE_MOVE, CodeMoveEventRecord) \ |
52 V(SHARED_FUNC_MOVE, SharedFunctionInfoMoveEventRecord) \ | 52 V(SHARED_FUNC_MOVE, SharedFunctionInfoMoveEventRecord) |
53 V(REPORT_BUILTIN, ReportBuiltinEventRecord) | |
54 | 53 |
55 | 54 |
56 class CodeEventRecord { | 55 class CodeEventRecord { |
57 public: | 56 public: |
58 #define DECLARE_TYPE(type, ignore) type, | 57 #define DECLARE_TYPE(type, ignore) type, |
59 enum Type { | 58 enum Type { |
60 NONE = 0, | 59 NONE = 0, |
61 CODE_EVENTS_TYPE_LIST(DECLARE_TYPE) | 60 CODE_EVENTS_TYPE_LIST(DECLARE_TYPE) |
62 NUMBER_OF_TYPES | 61 NUMBER_OF_TYPES |
63 }; | 62 }; |
(...skipping 26 matching lines...) Expand all Loading... |
90 | 89 |
91 class SharedFunctionInfoMoveEventRecord : public CodeEventRecord { | 90 class SharedFunctionInfoMoveEventRecord : public CodeEventRecord { |
92 public: | 91 public: |
93 Address from; | 92 Address from; |
94 Address to; | 93 Address to; |
95 | 94 |
96 INLINE(void UpdateCodeMap(CodeMap* code_map)); | 95 INLINE(void UpdateCodeMap(CodeMap* code_map)); |
97 }; | 96 }; |
98 | 97 |
99 | 98 |
100 class ReportBuiltinEventRecord : public CodeEventRecord { | |
101 public: | |
102 Address start; | |
103 Builtins::Name builtin_id; | |
104 | |
105 INLINE(void UpdateCodeMap(CodeMap* code_map)); | |
106 }; | |
107 | |
108 | |
109 class TickSampleEventRecord { | 99 class TickSampleEventRecord { |
110 public: | 100 public: |
111 // The parameterless constructor is used when we dequeue data from | 101 // The parameterless constructor is used when we dequeue data from |
112 // the ticks buffer. | 102 // the ticks buffer. |
113 TickSampleEventRecord() { } | 103 TickSampleEventRecord() { } |
114 explicit TickSampleEventRecord(unsigned order) | 104 explicit TickSampleEventRecord(unsigned order) |
115 : filler(1), | 105 : filler(1), |
116 order(order) { | 106 order(order) { |
117 ASSERT(filler != SamplingCircularQueue::kClear); | 107 ASSERT(filler != SamplingCircularQueue::kClear); |
118 } | 108 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 INLINE(bool is_profiling() const) { return is_profiling_; } | 239 INLINE(bool is_profiling() const) { return is_profiling_; } |
250 bool* is_profiling_address() { | 240 bool* is_profiling_address() { |
251 return &is_profiling_; | 241 return &is_profiling_; |
252 } | 242 } |
253 | 243 |
254 private: | 244 private: |
255 void StartProcessorIfNotStarted(); | 245 void StartProcessorIfNotStarted(); |
256 void StopProcessorIfLastProfile(const char* title); | 246 void StopProcessorIfLastProfile(const char* title); |
257 void StopProcessor(); | 247 void StopProcessor(); |
258 void ResetProfiles(); | 248 void ResetProfiles(); |
259 void LogBuiltins(); | |
260 | 249 |
261 Isolate* isolate_; | 250 Isolate* isolate_; |
262 CpuProfilesCollection* profiles_; | 251 CpuProfilesCollection* profiles_; |
263 unsigned next_profile_uid_; | 252 unsigned next_profile_uid_; |
264 TokenEnumerator* token_enumerator_; | 253 TokenEnumerator* token_enumerator_; |
265 ProfileGenerator* generator_; | 254 ProfileGenerator* generator_; |
266 ProfilerEventsProcessor* processor_; | 255 ProfilerEventsProcessor* processor_; |
267 int saved_logging_nesting_; | 256 int saved_logging_nesting_; |
268 bool need_to_stop_sampler_; | 257 bool need_to_stop_sampler_; |
269 bool is_profiling_; | 258 bool is_profiling_; |
270 | 259 |
271 private: | 260 private: |
272 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 261 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
273 }; | 262 }; |
274 | 263 |
275 } } // namespace v8::internal | 264 } } // namespace v8::internal |
276 | 265 |
277 | 266 |
278 #endif // V8_CPU_PROFILER_H_ | 267 #endif // V8_CPU_PROFILER_H_ |
OLD | NEW |