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

Side by Side Diff: test/cctest/heap/test-concurrent-marking.cc

Issue 2732053002: [heap] Implement simple marking in the concurrent marking thread. (Closed)
Patch Set: re-upload 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/heap/marking.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/heap/concurrent-marking.h" 9 #include "src/heap/concurrent-marking.h"
10 #include "src/heap/heap-inl.h" 10 #include "src/heap/heap-inl.h"
11 #include "src/heap/heap.h" 11 #include "src/heap/heap.h"
12 #include "test/cctest/cctest.h" 12 #include "test/cctest/cctest.h"
13 #include "test/cctest/heap/heap-utils.h" 13 #include "test/cctest/heap/heap-utils.h"
14 14
15 namespace v8 { 15 namespace v8 {
16 namespace internal { 16 namespace internal {
17 TEST(ConcurrentMarking) { 17 TEST(ConcurrentMarking) {
18 i::FLAG_concurrent_marking = true; 18 i::FLAG_concurrent_marking = true;
19 CcTest::InitializeVM(); 19 CcTest::InitializeVM();
20 Heap* heap = CcTest::heap(); 20 Heap* heap = CcTest::heap();
21 ConcurrentMarking* concurrent_marking = new ConcurrentMarking(heap); 21 ConcurrentMarking* concurrent_marking = new ConcurrentMarking(heap);
22 for (int i = 0; i < 10; i++) { 22 concurrent_marking->AddRoot(heap->undefined_value());
23 concurrent_marking->EnqueueObject(heap->undefined_value()); 23 concurrent_marking->StartMarkingTask();
24 } 24 concurrent_marking->WaitForTaskToComplete();
25 concurrent_marking->StartMarkingTasks(3);
26 while (!concurrent_marking->IsQueueEmpty()) {
27 }
28 concurrent_marking->WaitForTasksToComplete();
29 delete concurrent_marking; 25 delete concurrent_marking;
30 } 26 }
31 27
32 } // namespace internal 28 } // namespace internal
33 } // namespace v8 29 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/marking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698