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

Unified Diff: runtime/vm/gc_marker.h

Issue 1309033007: Old-gen marking on separate thread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Revert static method change. Created 5 years, 4 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
« no previous file with comments | « no previous file | runtime/vm/gc_marker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/gc_marker.h
diff --git a/runtime/vm/gc_marker.h b/runtime/vm/gc_marker.h
index 4280a65e97a0745fa0888050711125a2a2944cb2..87fed84feff0c327c3b5d7af13ef1186db014825 100644
--- a/runtime/vm/gc_marker.h
+++ b/runtime/vm/gc_marker.h
@@ -22,7 +22,8 @@ class RawWeakProperty;
// of the mark-sweep collection. The marking bit used is defined in RawObject.
class GCMarker : public ValueObject {
public:
- explicit GCMarker(Heap* heap) : heap_(heap), marked_bytes_(0) { }
+ explicit GCMarker(Heap* heap)
+ : heap_(heap), marked_bytes_(0), done_count_(0) { }
~GCMarker() { }
void MarkObjects(Isolate* isolate,
@@ -45,10 +46,22 @@ class GCMarker : public ValueObject {
void ProcessWeakTables(PageSpace* page_space);
void ProcessObjectIdTable(Isolate* isolate);
+ // Synchronization between GCMarker's main thread and its marking tasks.
+ // Called by main thread: wait for 'num_tasks' tasks, then let them resume.
+ void MainSync(intptr_t num_tasks);
+ // Called by tasks: notify main thread; wait until it lets us continue.
+ void TaskSync();
+ // Called by tasks: notify main thread, but don't wait (used for exiting).
+ void TaskNotifyDone();
+ // Called by anyone: finalize and accumulate stats from 'visitor'.
+ void FinalizeResultsFrom(MarkingVisitor* visitor);
+ Monitor monitor_; // Protects marked_bytes_ and done_count_.
Heap* heap_;
uintptr_t marked_bytes_;
+ intptr_t done_count_;
+ friend class MarkTask;
DISALLOW_IMPLICIT_CONSTRUCTORS(GCMarker);
};
« no previous file with comments | « no previous file | runtime/vm/gc_marker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698