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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap/concurrent-marking.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_HEAP_CONCURRENT_MARKING_
6 #define V8_HEAP_CONCURRENT_MARKING_
7
8 #include "src/allocation.h"
9 #include "src/cancelable-task.h"
10 #include "src/locked-queue.h"
11 #include "src/utils.h"
12 #include "src/v8.h"
13
14 namespace v8 {
15 namespace internal {
16
17 class Heap;
18 class Isolate;
19
20 class ConcurrentMarking {
21 public:
22 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
23
24 explicit ConcurrentMarking(Heap* heap);
25 ~ConcurrentMarking();
26
27 void EnqueueObject(HeapObject* object);
28 bool IsQueueEmpty();
29
30 void StartMarkingTasks(int number_of_tasks);
31 void WaitForTasksToComplete();
32
33 private:
34 class Task;
35 // TODO(ulan): Replace with faster queue.
36 typedef LockedQueue<HeapObject*> Queue;
37
38 Heap* heap_;
39 base::Semaphore pending_tasks_;
40 Queue queue_;
41 int number_of_tasks_;
42 uint32_t task_ids_[kMaxNumberOfTasks];
43 };
44
45 } // namespace internal
46 } // namespace v8
47
48 #endif // V8_HEAP_PAGE_PARALLEL_JOB_
OLDNEW
« 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