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

Unified Diff: src/heap/concurrent-marking.h

Issue 2728363002: [heap] Implement concurrent marking boilerplate. (Closed)
Patch Set: Add missing test file Created 3 years, 9 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 | « src/flag-definitions.h ('k') | src/heap/concurrent-marking.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/concurrent-marking.h
diff --git a/src/heap/concurrent-marking.h b/src/heap/concurrent-marking.h
new file mode 100644
index 0000000000000000000000000000000000000000..349b844d67d08aeb0da9104628cc2bebb67c9bae
--- /dev/null
+++ b/src/heap/concurrent-marking.h
@@ -0,0 +1,48 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_HEAP_CONCURRENT_MARKING_
+#define V8_HEAP_CONCURRENT_MARKING_
+
+#include "src/allocation.h"
+#include "src/cancelable-task.h"
+#include "src/locked-queue.h"
+#include "src/utils.h"
+#include "src/v8.h"
+
+namespace v8 {
+namespace internal {
+
+class Heap;
+class Isolate;
+
+class ConcurrentMarking {
+ public:
+ static const int kMaxNumberOfTasks = 10;
Hannes Payer (out of office) 2017/03/06 13:43:19 Instead of using a max, let's add a heuristic func
ulan 2017/03/06 13:52:19 It's the upper bound on number of tasks. The actua
+
+ explicit ConcurrentMarking(Heap* heap);
+ ~ConcurrentMarking();
+
+ void EnqueueObject(HeapObject* object);
+ bool IsQueueEmpty();
+
+ void StartMarkingTasks(int number_of_tasks);
+ void WaitForTasksToComplete();
+
+ private:
+ class Task;
+ // TODO(ulan): Replace with faster queue.
+ typedef LockedQueue<HeapObject*> Queue;
+
+ Heap* heap_;
+ base::Semaphore pending_tasks_;
+ Queue queue_;
+ int number_of_tasks_;
+ uint32_t task_ids_[kMaxNumberOfTasks];
+};
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_HEAP_PAGE_PARALLEL_JOB_
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap/concurrent-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698