summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/heap/test-concurrent-marking.cc
blob: 03ee6c4b8c5b494f3df9ea0a752280f32933e2f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 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.

#include <stdlib.h>

#include "src/v8.h"

#include "src/heap/concurrent-marking.h"
#include "src/heap/heap-inl.h"
#include "src/heap/heap.h"
#include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-utils.h"

namespace v8 {
namespace internal {
TEST(ConcurrentMarking) {
  if (!i::FLAG_concurrent_marking) return;
  CcTest::InitializeVM();
  Heap* heap = CcTest::heap();
  ConcurrentMarkingDeque deque(heap);
  deque.Push(heap->undefined_value());
  ConcurrentMarking* concurrent_marking = new ConcurrentMarking(heap, &deque);
  concurrent_marking->StartTask();
  concurrent_marking->WaitForTaskToComplete();
  delete concurrent_marking;
}

}  // namespace internal
}  // namespace v8