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 "include/dart_tools_api.h" | 8 #include "include/dart_tools_api.h" |
9 | 9 |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 // the first event. | 369 // the first event. |
370 TimelineEvent* StartEvent(); | 370 TimelineEvent* StartEvent(); |
371 | 371 |
372 private: | 372 private: |
373 const char* name_; | 373 const char* name_; |
374 bool enabled_; | 374 bool enabled_; |
375 const bool* globally_enabled_; | 375 const bool* globally_enabled_; |
376 }; | 376 }; |
377 | 377 |
378 #ifndef PRODUCT | 378 #ifndef PRODUCT |
379 #define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, suffix, function) \ | 379 #define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, name, function) \ |
380 TimelineDurationScope tds(thread, \ | 380 TimelineDurationScope tds(thread, \ |
381 Timeline::GetCompilerStream(), \ | 381 Timeline::GetCompilerStream(), \ |
382 "Compile" suffix); \ | 382 name); \ |
383 if (tds.enabled()) { \ | 383 if (tds.enabled()) { \ |
384 tds.SetNumArguments(1); \ | 384 tds.SetNumArguments(1); \ |
385 tds.CopyArgument( \ | 385 tds.CopyArgument( \ |
386 0, \ | 386 0, \ |
387 "function", \ | 387 "function", \ |
388 function.ToLibNamePrefixedQualifiedCString()); \ | 388 function.ToLibNamePrefixedQualifiedCString()); \ |
389 } | 389 } |
390 #else | 390 #else |
391 #define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, suffix, function) | 391 #define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, name, function) |
392 #endif // !PRODUCT | 392 #endif // !PRODUCT |
393 | 393 |
394 // See |TimelineDurationScope| and |TimelineBeginEndScope|. | 394 // See |TimelineDurationScope| and |TimelineBeginEndScope|. |
395 class TimelineEventScope : public StackResource { | 395 class TimelineEventScope : public StackResource { |
396 public: | 396 public: |
397 bool enabled() const { | 397 bool enabled() const { |
398 return enabled_; | 398 return enabled_; |
399 } | 399 } |
400 | 400 |
401 void SetNumArguments(intptr_t length); | 401 void SetNumArguments(intptr_t length); |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 794 |
795 private: | 795 private: |
796 TimelineEventBlock* current_; | 796 TimelineEventBlock* current_; |
797 TimelineEventRecorder* recorder_; | 797 TimelineEventRecorder* recorder_; |
798 }; | 798 }; |
799 | 799 |
800 | 800 |
801 } // namespace dart | 801 } // namespace dart |
802 | 802 |
803 #endif // VM_TIMELINE_H_ | 803 #endif // VM_TIMELINE_H_ |
OLD | NEW |