OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_TIMELINE_H_ | 5 #ifndef VM_TIMELINE_H_ |
6 #define VM_TIMELINE_H_ | 6 #define VM_TIMELINE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/bitfield.h" | 9 #include "vm/bitfield.h" |
10 #include "vm/os.h" | 10 #include "vm/os.h" |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 // NOTE: It is not allowed to call StartEvent again without completing | 337 // NOTE: It is not allowed to call StartEvent again without completing |
338 // the first event. | 338 // the first event. |
339 TimelineEvent* StartEvent(); | 339 TimelineEvent* StartEvent(); |
340 | 340 |
341 private: | 341 private: |
342 const char* name_; | 342 const char* name_; |
343 bool enabled_; | 343 bool enabled_; |
344 const bool* globally_enabled_; | 344 const bool* globally_enabled_; |
345 }; | 345 }; |
346 | 346 |
| 347 #ifndef PRODUCT |
347 #define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, suffix, function) \ | 348 #define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, suffix, function) \ |
348 TimelineDurationScope tds(thread, \ | 349 TimelineDurationScope tds(thread, \ |
349 thread->isolate()->GetCompilerStream(), \ | 350 thread->isolate()->GetCompilerStream(), \ |
350 "Compile" suffix); \ | 351 "Compile" suffix); \ |
351 if (tds.enabled()) { \ | 352 if (tds.enabled()) { \ |
352 tds.SetNumArguments(1); \ | 353 tds.SetNumArguments(1); \ |
353 tds.CopyArgument( \ | 354 tds.CopyArgument( \ |
354 0, \ | 355 0, \ |
355 "function", \ | 356 "function", \ |
356 function.ToLibNamePrefixedQualifiedCString()); \ | 357 function.ToLibNamePrefixedQualifiedCString()); \ |
357 } | 358 } |
358 | 359 #else |
| 360 #define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, suffix, function) \ |
| 361 do { } while (false); |
| 362 #endif // !PRODUCT |
359 | 363 |
360 // See |TimelineDurationScope| and |TimelineBeginEndScope|. | 364 // See |TimelineDurationScope| and |TimelineBeginEndScope|. |
361 class TimelineEventScope : public StackResource { | 365 class TimelineEventScope : public StackResource { |
362 public: | 366 public: |
363 bool enabled() const { | 367 bool enabled() const { |
364 return enabled_; | 368 return enabled_; |
365 } | 369 } |
366 | 370 |
367 void SetNumArguments(intptr_t length); | 371 void SetNumArguments(intptr_t length); |
368 | 372 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 749 |
746 private: | 750 private: |
747 TimelineEventBlock* current_; | 751 TimelineEventBlock* current_; |
748 TimelineEventRecorder* recorder_; | 752 TimelineEventRecorder* recorder_; |
749 }; | 753 }; |
750 | 754 |
751 | 755 |
752 } // namespace dart | 756 } // namespace dart |
753 | 757 |
754 #endif // VM_TIMELINE_H_ | 758 #endif // VM_TIMELINE_H_ |
OLD | NEW |