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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 void CodeDeleteEvent(Address from); | 158 void CodeDeleteEvent(Address from); |
159 void FunctionCreateEvent(Address alias, Address start, int security_token_id); | 159 void FunctionCreateEvent(Address alias, Address start, int security_token_id); |
160 void FunctionMoveEvent(Address from, Address to); | 160 void FunctionMoveEvent(Address from, Address to); |
161 void FunctionDeleteEvent(Address from); | 161 void FunctionDeleteEvent(Address from); |
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 bool IsKnownFunction(Address start); | 167 bool IsKnownFunction(Address start); |
| 168 void RegisterMovedFunctions(); |
| 169 void RememberMovedFunction(JSFunction* function); |
168 | 170 |
169 // Tick sample events are filled directly in the buffer of the circular | 171 // Tick sample events are filled directly in the buffer of the circular |
170 // queue (because the structure is of fixed width, but usually not all | 172 // queue (because the structure is of fixed width, but usually not all |
171 // stack frame entries are filled.) This method returns a pointer to the | 173 // stack frame entries are filled.) This method returns a pointer to the |
172 // next record of the buffer. | 174 // next record of the buffer. |
173 INLINE(TickSample* TickSampleEvent()); | 175 INLINE(TickSample* TickSampleEvent()); |
174 | 176 |
175 private: | 177 private: |
176 union CodeEventsContainer { | 178 union CodeEventsContainer { |
177 CodeEventRecord generic; | 179 CodeEventRecord generic; |
(...skipping 17 matching lines...) Expand all Loading... |
195 | 197 |
196 ProfileGenerator* generator_; | 198 ProfileGenerator* generator_; |
197 bool running_; | 199 bool running_; |
198 UnboundQueue<CodeEventsContainer> events_buffer_; | 200 UnboundQueue<CodeEventsContainer> events_buffer_; |
199 SamplingCircularQueue ticks_buffer_; | 201 SamplingCircularQueue ticks_buffer_; |
200 UnboundQueue<TickSampleEventRecord> ticks_from_vm_buffer_; | 202 UnboundQueue<TickSampleEventRecord> ticks_from_vm_buffer_; |
201 unsigned enqueue_order_; | 203 unsigned enqueue_order_; |
202 | 204 |
203 // Used from the VM thread. | 205 // Used from the VM thread. |
204 HashMap* known_functions_; | 206 HashMap* known_functions_; |
| 207 List<JSFunction*> moved_functions_; |
205 }; | 208 }; |
206 | 209 |
207 } } // namespace v8::internal | 210 } } // namespace v8::internal |
208 | 211 |
209 | 212 |
210 #define PROFILE(Call) \ | 213 #define PROFILE(Call) \ |
211 LOG(Call); \ | 214 LOG(Call); \ |
212 do { \ | 215 do { \ |
213 if (v8::internal::CpuProfiler::is_profiling()) { \ | 216 if (v8::internal::CpuProfiler::is_profiling()) { \ |
214 v8::internal::CpuProfiler::Call; \ | 217 v8::internal::CpuProfiler::Call; \ |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 Code* code, String* name, | 253 Code* code, String* name, |
251 String* source, int line); | 254 String* source, int line); |
252 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 255 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
253 Code* code, int args_count); | 256 Code* code, int args_count); |
254 static void CodeMovingGCEvent() {} | 257 static void CodeMovingGCEvent() {} |
255 static void CodeMoveEvent(Address from, Address to); | 258 static void CodeMoveEvent(Address from, Address to); |
256 static void CodeDeleteEvent(Address from); | 259 static void CodeDeleteEvent(Address from); |
257 static void FunctionCreateEvent(JSFunction* function); | 260 static void FunctionCreateEvent(JSFunction* function); |
258 // Reports function creation in case we had missed it (e.g. | 261 // Reports function creation in case we had missed it (e.g. |
259 // if it was created from compiled code). | 262 // if it was created from compiled code). |
260 static void FunctionCreateEventFromMove(JSFunction* function, | 263 static void FunctionCreateEventFromMove(JSFunction* function); |
261 HeapObject* source); | |
262 static void FunctionMoveEvent(Address from, Address to); | 264 static void FunctionMoveEvent(Address from, Address to); |
263 static void FunctionDeleteEvent(Address from); | 265 static void FunctionDeleteEvent(Address from); |
264 static void GetterCallbackEvent(String* name, Address entry_point); | 266 static void GetterCallbackEvent(String* name, Address entry_point); |
265 static void RegExpCodeCreateEvent(Code* code, String* source); | 267 static void RegExpCodeCreateEvent(Code* code, String* source); |
| 268 static void RegisterMovedFunctions(); |
266 static void SetterCallbackEvent(String* name, Address entry_point); | 269 static void SetterCallbackEvent(String* name, Address entry_point); |
267 | 270 |
268 static INLINE(bool is_profiling()) { | 271 static INLINE(bool is_profiling()) { |
269 return singleton_ != NULL && singleton_->processor_ != NULL; | 272 return singleton_ != NULL && singleton_->processor_ != NULL; |
270 } | 273 } |
271 | 274 |
272 private: | 275 private: |
273 CpuProfiler(); | 276 CpuProfiler(); |
274 ~CpuProfiler(); | 277 ~CpuProfiler(); |
275 void StartCollectingProfile(const char* title); | 278 void StartCollectingProfile(const char* title); |
(...skipping 17 matching lines...) Expand all Loading... |
293 #endif // ENABLE_LOGGING_AND_PROFILING | 296 #endif // ENABLE_LOGGING_AND_PROFILING |
294 | 297 |
295 private: | 298 private: |
296 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 299 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
297 }; | 300 }; |
298 | 301 |
299 } } // namespace v8::internal | 302 } } // namespace v8::internal |
300 | 303 |
301 | 304 |
302 #endif // V8_CPU_PROFILER_H_ | 305 #endif // V8_CPU_PROFILER_H_ |
OLD | NEW |