| 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 #include <cstdlib> | 5 #include <cstdlib> |
| 6 | 6 |
| 7 #include "vm/atomic.h" | 7 #include "vm/atomic.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/json_stream.h" | 9 #include "vm/json_stream.h" |
| 10 #include "vm/lockers.h" | 10 #include "vm/lockers.h" |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 } | 877 } |
| 878 event->StealArguments(arguments_length_, arguments_); | 878 event->StealArguments(arguments_length_, arguments_); |
| 879 arguments_length_ = 0; | 879 arguments_length_ = 0; |
| 880 arguments_ = NULL; | 880 arguments_ = NULL; |
| 881 } | 881 } |
| 882 | 882 |
| 883 | 883 |
| 884 TimelineDurationScope::TimelineDurationScope(TimelineStream* stream, | 884 TimelineDurationScope::TimelineDurationScope(TimelineStream* stream, |
| 885 const char* label) | 885 const char* label) |
| 886 : TimelineEventScope(stream, label) { | 886 : TimelineEventScope(stream, label) { |
| 887 if (!FLAG_support_timeline) { | 887 if (!FLAG_support_timeline || !enabled()) { |
| 888 return; | 888 return; |
| 889 } | 889 } |
| 890 timestamp_ = OS::GetCurrentMonotonicMicros(); | 890 timestamp_ = OS::GetCurrentMonotonicMicros(); |
| 891 thread_timestamp_ = OS::GetCurrentThreadCPUMicros(); | 891 thread_timestamp_ = OS::GetCurrentThreadCPUMicros(); |
| 892 } | 892 } |
| 893 | 893 |
| 894 | 894 |
| 895 TimelineDurationScope::TimelineDurationScope(Thread* thread, | 895 TimelineDurationScope::TimelineDurationScope(Thread* thread, |
| 896 TimelineStream* stream, | 896 TimelineStream* stream, |
| 897 const char* label) | 897 const char* label) |
| 898 : TimelineEventScope(thread, stream, label) { | 898 : TimelineEventScope(thread, stream, label) { |
| 899 if (!FLAG_support_timeline) { | 899 if (!FLAG_support_timeline || !enabled()) { |
| 900 return; | 900 return; |
| 901 } | 901 } |
| 902 timestamp_ = OS::GetCurrentMonotonicMicros(); | 902 timestamp_ = OS::GetCurrentMonotonicMicros(); |
| 903 thread_timestamp_ = OS::GetCurrentThreadCPUMicros(); | 903 thread_timestamp_ = OS::GetCurrentThreadCPUMicros(); |
| 904 } | 904 } |
| 905 | 905 |
| 906 | 906 |
| 907 TimelineDurationScope::~TimelineDurationScope() { | 907 TimelineDurationScope::~TimelineDurationScope() { |
| 908 if (!FLAG_support_timeline) { | 908 if (!FLAG_support_timeline) { |
| 909 return; | 909 return; |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 TimelineEventBlock* TimelineEventBlockIterator::Next() { | 1694 TimelineEventBlock* TimelineEventBlockIterator::Next() { |
| 1695 ASSERT(current_ != NULL); | 1695 ASSERT(current_ != NULL); |
| 1696 TimelineEventBlock* r = current_; | 1696 TimelineEventBlock* r = current_; |
| 1697 current_ = current_->next(); | 1697 current_ = current_->next(); |
| 1698 return r; | 1698 return r; |
| 1699 } | 1699 } |
| 1700 | 1700 |
| 1701 #endif // !PRODUCT | 1701 #endif // !PRODUCT |
| 1702 | 1702 |
| 1703 } // namespace dart | 1703 } // namespace dart |
| OLD | NEW |