Chromium Code Reviews| Index: runtime/vm/timeline.h |
| diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h |
| index 335ff14b9ac246ae6094cb0e9c818c8eaf314053..d704e4724cc47191a893ccc0dfd92dbe1a45cccd 100644 |
| --- a/runtime/vm/timeline.h |
| +++ b/runtime/vm/timeline.h |
| @@ -45,6 +45,13 @@ class Timeline : public AllStatic { |
| static TimelineStream* GetVMStream(); |
| + // Reclaim all |TimelineEventBlock|s that are owned by the current isolate. |
| + static void ReclaimIsolateBlocks(); |
| + |
| + // Reclaim all |TimelineEventBlocks|s that are owned by all isolates and |
| + // the global block owned by the VM. |
| + static void ReclaimAllBlocks(); |
| + |
| #define ISOLATE_TIMELINE_STREAM_FLAGS(name, not_used) \ |
| static const bool* Stream##name##EnabledFlag() { \ |
| return &stream_##name##_enabled_; \ |
| @@ -56,6 +63,8 @@ class Timeline : public AllStatic { |
| #undef ISOLATE_TIMELINE_STREAM_FLAGS |
| private: |
| + static void ReclaimBlocksForIsolate(Isolate* isolate); |
| + |
| static TimelineEventRecorder* recorder_; |
| static TimelineStream* vm_stream_; |
| @@ -65,6 +74,7 @@ class Timeline : public AllStatic { |
| #undef ISOLATE_TIMELINE_STREAM_DECLARE_FLAG |
| friend class TimelineRecorderOverride; |
| + friend class ReclaimBlocksIsolateVisitor; |
| }; |
| @@ -461,7 +471,7 @@ class IsolateTimelineEventFilter : public TimelineEventFilter { |
| return false; |
| } |
| // Not empty, not open, and isolate match. |
| - return !block->IsEmpty() && |
| + return !block->IsEmpty() && !block->open() && |
|
turnidge
2015/09/24 17:05:52
Consider in_use instead of open?
Cutch
2015/09/24 18:14:16
Done.
|
| (block->isolate() == isolate_); |
| } |
| @@ -500,7 +510,7 @@ class TimelineEventRecorder { |
| Mutex lock_; |
| // Only accessed under |lock_|. |
| TimelineEventBlock* global_block_; |
| - void FinishGlobalBlock(); |
| + void ReclaimGlobalBlock(); |
| uintptr_t async_id_; |