2017-03-06 15:19:36 +00:00
|
|
|
// 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) {
|
2017-04-10 14:22:31 +00:00
|
|
|
if (!i::FLAG_concurrent_marking) return;
|
2017-03-06 15:19:36 +00:00
|
|
|
CcTest::InitializeVM();
|
|
|
|
Heap* heap = CcTest::heap();
|
2017-05-02 17:03:31 +00:00
|
|
|
ConcurrentMarkingDeque deque(heap);
|
|
|
|
deque.Push(heap->undefined_value());
|
|
|
|
ConcurrentMarking* concurrent_marking = new ConcurrentMarking(heap, &deque);
|
2017-04-10 14:22:31 +00:00
|
|
|
concurrent_marking->StartTask();
|
2017-03-06 20:46:41 +00:00
|
|
|
concurrent_marking->WaitForTaskToComplete();
|
2017-03-06 15:19:36 +00:00
|
|
|
delete concurrent_marking;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|