a3923ce210
The concurrent marker uses ObjectVisitor to iterate pointers in objects and local marking bitmaps to keep track of visited objects. To keep it simple for now, I removed support for multiple tasks and canceling unfinished tasks. BUG=chromium:694255 Review-Url: https://codereview.chromium.org/2732053002 Cr-Commit-Position: refs/heads/master@{#43618}
30 lines
831 B
C++
30 lines
831 B
C++
// 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) {
|
|
i::FLAG_concurrent_marking = true;
|
|
CcTest::InitializeVM();
|
|
Heap* heap = CcTest::heap();
|
|
ConcurrentMarking* concurrent_marking = new ConcurrentMarking(heap);
|
|
concurrent_marking->AddRoot(heap->undefined_value());
|
|
concurrent_marking->StartMarkingTask();
|
|
concurrent_marking->WaitForTaskToComplete();
|
|
delete concurrent_marking;
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|