Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: runtime/vm/timeline.h

Issue 1363033003: Make TimelineEventBlocks reclaimable (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;

Powered by Google App Engine
This is Rietveld 408576698