OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 28 matching lines...) Expand all Loading... | |
39 | 39 |
40 // Forward declarations. | 40 // Forward declarations. |
41 class CodeEntry; | 41 class CodeEntry; |
42 class CodeMap; | 42 class CodeMap; |
43 class CpuProfile; | 43 class CpuProfile; |
44 class CpuProfilesCollection; | 44 class CpuProfilesCollection; |
45 class HashMap; | 45 class HashMap; |
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(CODE_DELETE, CodeDeleteEventRecord) \ | 52 V(CODE_DELETE, CodeDeleteEventRecord) \ |
53 V(SFI_MOVE, SFIMoveEventRecord) | 53 V(SHARED_FUNC_MOVE, SharedFunctionMoveEventRecord) |
54 | 54 |
55 | 55 |
56 class CodeEventRecord { | 56 class CodeEventRecord { |
57 public: | 57 public: |
58 #define DECLARE_TYPE(type, ignore) type, | 58 #define DECLARE_TYPE(type, ignore) type, |
59 enum Type { | 59 enum Type { |
60 NONE = 0, | 60 NONE = 0, |
61 CODE_EVENTS_TYPE_LIST(DECLARE_TYPE) | 61 CODE_EVENTS_TYPE_LIST(DECLARE_TYPE) |
62 NUMBER_OF_TYPES | 62 NUMBER_OF_TYPES |
63 }; | 63 }; |
64 #undef DECLARE_TYPE | 64 #undef DECLARE_TYPE |
65 | 65 |
66 Type type; | 66 Type type; |
67 unsigned order; | 67 unsigned order; |
68 }; | 68 }; |
69 | 69 |
70 | 70 |
71 class CodeCreateEventRecord : public CodeEventRecord { | 71 class CodeCreateEventRecord : public CodeEventRecord { |
72 public: | 72 public: |
73 Address start; | 73 Address start; |
74 CodeEntry* entry; | 74 CodeEntry* entry; |
75 unsigned size; | 75 unsigned size; |
76 Address sfi_address; | 76 Address shared; |
77 | 77 |
78 INLINE(void UpdateCodeMap(CodeMap* code_map)); | 78 INLINE(void UpdateCodeMap(CodeMap* code_map)); |
79 }; | 79 }; |
80 | 80 |
81 | 81 |
82 class CodeMoveEventRecord : public CodeEventRecord { | 82 class CodeMoveEventRecord : public CodeEventRecord { |
83 public: | 83 public: |
84 Address from; | 84 Address from; |
85 Address to; | 85 Address to; |
86 | 86 |
87 INLINE(void UpdateCodeMap(CodeMap* code_map)); | 87 INLINE(void UpdateCodeMap(CodeMap* code_map)); |
88 }; | 88 }; |
89 | 89 |
90 | 90 |
91 class CodeDeleteEventRecord : public CodeEventRecord { | 91 class CodeDeleteEventRecord : public CodeEventRecord { |
92 public: | 92 public: |
93 Address start; | 93 Address start; |
94 | 94 |
95 INLINE(void UpdateCodeMap(CodeMap* code_map)); | 95 INLINE(void UpdateCodeMap(CodeMap* code_map)); |
96 }; | 96 }; |
97 | 97 |
98 | 98 |
99 class SFIMoveEventRecord : public CodeEventRecord { | 99 class SharedFunctionMoveEventRecord : public CodeEventRecord { |
100 public: | 100 public: |
101 Address from; | 101 Address from; |
102 Address to; | 102 Address to; |
103 | 103 |
104 INLINE(void UpdateCodeMap(CodeMap* code_map)); | 104 INLINE(void UpdateCodeMap(CodeMap* code_map)); |
105 }; | 105 }; |
106 | 106 |
107 | 107 |
108 class TickSampleEventRecord BASE_EMBEDDED { | 108 class TickSampleEventRecord BASE_EMBEDDED { |
109 public: | 109 public: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 INLINE(bool running()) { return running_; } | 142 INLINE(bool running()) { return running_; } |
143 | 143 |
144 // Events adding methods. Called by VM threads. | 144 // Events adding methods. Called by VM threads. |
145 void CallbackCreateEvent(Logger::LogEventsAndTags tag, | 145 void CallbackCreateEvent(Logger::LogEventsAndTags tag, |
146 const char* prefix, String* name, | 146 const char* prefix, String* name, |
147 Address start); | 147 Address start); |
148 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 148 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
149 String* name, | 149 String* name, |
150 String* resource_name, int line_number, | 150 String* resource_name, int line_number, |
151 Address start, unsigned size, | 151 Address start, unsigned size, |
152 Address sfi_address); | 152 Address shared); |
153 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 153 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
154 const char* name, | 154 const char* name, |
155 Address start, unsigned size); | 155 Address start, unsigned size); |
156 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 156 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
157 int args_count, | 157 int args_count, |
158 Address start, unsigned size); | 158 Address start, unsigned size); |
159 void CodeMoveEvent(Address from, Address to); | 159 void CodeMoveEvent(Address from, Address to); |
160 void CodeDeleteEvent(Address from); | 160 void CodeDeleteEvent(Address from); |
161 void SFIMoveEvent(Address from, Address to); | 161 void SharedFunctionMoveEvent(Address from, Address to); |
Vitaly Repeshko
2011/03/09 19:22:24
Let's make it "SharedFunctionInfoMoveEvent" to avo
mnaganov (inactive)
2011/03/10 12:02:03
Done.
| |
162 void RegExpCodeCreateEvent(Logger::LogEventsAndTags tag, | 162 void RegExpCodeCreateEvent(Logger::LogEventsAndTags tag, |
163 const char* prefix, String* name, | 163 const char* prefix, String* name, |
164 Address start, unsigned size); | 164 Address start, unsigned size); |
165 // Puts current stack into tick sample events buffer. | 165 // Puts current stack into tick sample events buffer. |
166 void AddCurrentStack(); | 166 void AddCurrentStack(); |
167 | 167 |
168 // Tick sample events are filled directly in the buffer of the circular | 168 // Tick sample events are filled directly in the buffer of the circular |
169 // queue (because the structure is of fixed width, but usually not all | 169 // queue (because the structure is of fixed width, but usually not all |
170 // stack frame entries are filled.) This method returns a pointer to the | 170 // stack frame entries are filled.) This method returns a pointer to the |
171 // next record of the buffer. | 171 // next record of the buffer. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 SharedFunctionInfo *shared, | 244 SharedFunctionInfo *shared, |
245 String* source, int line); | 245 String* source, int line); |
246 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 246 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
247 Code* code, int args_count); | 247 Code* code, int args_count); |
248 static void CodeMovingGCEvent() {} | 248 static void CodeMovingGCEvent() {} |
249 static void CodeMoveEvent(Address from, Address to); | 249 static void CodeMoveEvent(Address from, Address to); |
250 static void CodeDeleteEvent(Address from); | 250 static void CodeDeleteEvent(Address from); |
251 static void GetterCallbackEvent(String* name, Address entry_point); | 251 static void GetterCallbackEvent(String* name, Address entry_point); |
252 static void RegExpCodeCreateEvent(Code* code, String* source); | 252 static void RegExpCodeCreateEvent(Code* code, String* source); |
253 static void SetterCallbackEvent(String* name, Address entry_point); | 253 static void SetterCallbackEvent(String* name, Address entry_point); |
254 static void SFIMoveEvent(Address from, Address to); | 254 static void SharedFunctionMoveEvent(Address from, Address to); |
255 | 255 |
256 static INLINE(bool is_profiling()) { | 256 static INLINE(bool is_profiling()) { |
257 return NoBarrier_Load(&is_profiling_); | 257 return NoBarrier_Load(&is_profiling_); |
258 } | 258 } |
259 | 259 |
260 private: | 260 private: |
261 CpuProfiler(); | 261 CpuProfiler(); |
262 ~CpuProfiler(); | 262 ~CpuProfiler(); |
263 void StartCollectingProfile(const char* title); | 263 void StartCollectingProfile(const char* title); |
264 void StartCollectingProfile(String* title); | 264 void StartCollectingProfile(String* title); |
(...skipping 17 matching lines...) Expand all Loading... | |
282 #endif // ENABLE_LOGGING_AND_PROFILING | 282 #endif // ENABLE_LOGGING_AND_PROFILING |
283 | 283 |
284 private: | 284 private: |
285 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 285 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
286 }; | 286 }; |
287 | 287 |
288 } } // namespace v8::internal | 288 } } // namespace v8::internal |
289 | 289 |
290 | 290 |
291 #endif // V8_CPU_PROFILER_H_ | 291 #endif // V8_CPU_PROFILER_H_ |
OLD | NEW |