[heap] Add GN flag for enabling concurrent marking.

BUG=chromium:723600

Review-Url: https://codereview.chromium.org/2888093003
Cr-Commit-Position: refs/heads/master@{#45379}
This commit is contained in:
ulan 2017-05-17 08:22:38 -07:00 committed by Commit bot
parent 1be27497ba
commit f1e82a2ee9
9 changed files with 21 additions and 11 deletions

View File

@ -76,6 +76,9 @@ declare_args() {
# Sets -dV8_TRACE_IGNITION.
v8_enable_trace_ignition = false
# Sets -dV8_CONCURRENT_MARKING
v8_enable_concurrent_marking = false
# With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See
# tools/gen-postmortem-metadata.py for details.
@ -257,6 +260,9 @@ config("features") {
if (v8_use_external_startup_data) {
defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
}
if (v8_enable_concurrent_marking) {
defines += [ "V8_CONCURRENT_MARKING" ]
}
}
config("toolchain") {

View File

@ -668,7 +668,13 @@ DEFINE_BOOL(age_code, true,
DEFINE_BOOL(incremental_marking, true, "use incremental marking")
DEFINE_BOOL(incremental_marking_wrappers, true,
"use incremental marking for marking wrappers")
DEFINE_BOOL(concurrent_marking, V8_CONCURRENT_MARKING, "use concurrent marking")
#ifdef V8_CONCURRENT_MARKING
#define V8_CONCURRENT_MARKING_BOOL true
#else
#define V8_CONCURRENT_MARKING_BOOL false
#endif
DEFINE_BOOL(concurrent_marking, V8_CONCURRENT_MARKING_BOOL,
"use concurrent marking")
DEFINE_BOOL(trace_concurrent_marking, false, "trace concurrent marking")
DEFINE_BOOL(minor_mc_parallel_marking, true,
"use parallel marking for the young generation")

View File

@ -118,8 +118,6 @@ namespace internal {
#define V8_DOUBLE_FIELDS_UNBOXING 0
#endif
#define V8_CONCURRENT_MARKING 0
// Some types of tracing require the SFI to store a unique ID.
#if defined(V8_TRACE_MAPS) || defined(V8_TRACE_IGNITION)
#define V8_SFI_HAS_UNIQUE_ID 1

View File

@ -236,10 +236,10 @@ ConcurrentMarking::ConcurrentMarking(Heap* heap, ConcurrentMarkingDeque* deque)
deque_(deque),
visitor_(new ConcurrentMarkingVisitor(deque_)),
is_task_pending_(false) {
// Concurrent marking does not work with double unboxing.
STATIC_ASSERT(!(V8_CONCURRENT_MARKING && V8_DOUBLE_FIELDS_UNBOXING));
// The runtime flag should be set only if the compile time flag was set.
CHECK(!FLAG_concurrent_marking || V8_CONCURRENT_MARKING);
#ifndef V8_CONCURRENT_MARKING
CHECK(!FLAG_concurrent_marking);
#endif
}
ConcurrentMarking::~ConcurrentMarking() { delete visitor_; }

View File

@ -5651,7 +5651,7 @@ bool Heap::SetUp() {
mark_compact_collector_ = new MarkCompactCollector(this);
incremental_marking_->set_marking_deque(
mark_compact_collector_->marking_deque());
#if V8_CONCURRENT_MARKING
#ifdef V8_CONCURRENT_MARKING
concurrent_marking_ =
new ConcurrentMarking(this, mark_compact_collector_->marking_deque());
#else

View File

@ -141,7 +141,7 @@ void IncrementalMarking::MarkBlackAndPush(HeapObject* obj) {
// Color the object black and push it into the bailout deque.
ObjectMarking::WhiteToGrey<kAtomicity>(obj, marking_state(obj));
if (ObjectMarking::GreyToBlack<kAtomicity>(obj, marking_state(obj))) {
#if V8_CONCURRENT_MARKING
#ifdef V8_CONCURRENT_MARKING
marking_deque()->Push(obj, MarkingThread::kMain, TargetDeque::kBailout);
#else
if (!marking_deque()->Push(obj)) {

View File

@ -182,7 +182,7 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
static const intptr_t kActivationThreshold = 0;
#endif
#if V8_CONCURRENT_MARKING
#ifdef V8_CONCURRENT_MARKING
static const MarkBit::AccessMode kAtomicity = MarkBit::AccessMode::ATOMIC;
#else
static const MarkBit::AccessMode kAtomicity = MarkBit::AccessMode::NON_ATOMIC;

View File

@ -33,7 +33,7 @@ class RecordMigratedSlotVisitor;
class ThreadLocalTop;
class YoungGenerationMarkingVisitor;
#if V8_CONCURRENT_MARKING
#ifdef V8_CONCURRENT_MARKING
using MarkingDeque = ConcurrentMarkingDeque;
#else
using MarkingDeque = SequentialMarkingDeque;

View File

@ -1284,7 +1284,7 @@ bool JSObject::PrototypeHasNoElements(Isolate* isolate, JSObject* object) {
reinterpret_cast<Object*>(base::NoBarrier_Load( \
reinterpret_cast<const base::AtomicWord*>(FIELD_ADDR_CONST(p, offset))))
#if V8_CONCURRENT_MARKING
#ifdef V8_CONCURRENT_MARKING
#define WRITE_FIELD(p, offset, value) \
base::NoBarrier_Store( \
reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \