| 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/bitfield.h" | 8 #include "vm/bitfield.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 "function", \ | 191 "function", \ |
| 192 const_cast<char*>(function.QualifiedUserVisibleNameCString())); \ | 192 const_cast<char*>(function.QualifiedUserVisibleNameCString())); \ |
| 193 } | 193 } |
| 194 | 194 |
| 195 class TimelineDurationScope : public StackResource { | 195 class TimelineDurationScope : public StackResource { |
| 196 public: | 196 public: |
| 197 TimelineDurationScope(Isolate* isolate, | 197 TimelineDurationScope(Isolate* isolate, |
| 198 TimelineStream* stream, | 198 TimelineStream* stream, |
| 199 const char* label) | 199 const char* label) |
| 200 : StackResource(isolate) { | 200 : StackResource(isolate) { |
| 201 Init(stream, label); |
| 202 } |
| 203 |
| 204 TimelineDurationScope(Thread* thread, |
| 205 TimelineStream* stream, |
| 206 const char* label) |
| 207 : StackResource(thread) { |
| 208 Init(stream, label); |
| 209 } |
| 210 |
| 211 void Init(TimelineStream* stream, const char* label) { |
| 201 event_ = stream->StartEvent(); | 212 event_ = stream->StartEvent(); |
| 202 if (event_ == NULL) { | 213 if (event_ == NULL) { |
| 203 return; | 214 return; |
| 204 } | 215 } |
| 205 event_->DurationBegin(label); | 216 event_->DurationBegin(label); |
| 206 } | 217 } |
| 207 | 218 |
| 208 bool enabled() const { | 219 bool enabled() const { |
| 209 return event_ != NULL; | 220 return event_ != NULL; |
| 210 } | 221 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 TimelineEventBlock* GetNewBlockLocked(); | 415 TimelineEventBlock* GetNewBlockLocked(); |
| 405 void PrintJSONEvents(JSONArray* array) const; | 416 void PrintJSONEvents(JSONArray* array) const; |
| 406 | 417 |
| 407 Mutex lock_; | 418 Mutex lock_; |
| 408 TimelineEventBlock* head_; | 419 TimelineEventBlock* head_; |
| 409 }; | 420 }; |
| 410 | 421 |
| 411 } // namespace dart | 422 } // namespace dart |
| 412 | 423 |
| 413 #endif // VM_TIMELINE_H_ | 424 #endif // VM_TIMELINE_H_ |
| OLD | NEW |