[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:
parent
1be27497ba
commit
f1e82a2ee9
6
BUILD.gn
6
BUILD.gn
@ -76,6 +76,9 @@ declare_args() {
|
|||||||
# Sets -dV8_TRACE_IGNITION.
|
# Sets -dV8_TRACE_IGNITION.
|
||||||
v8_enable_trace_ignition = false
|
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
|
# With post mortem support enabled, metadata is embedded into libv8 that
|
||||||
# describes various parameters of the VM for use by debuggers. See
|
# describes various parameters of the VM for use by debuggers. See
|
||||||
# tools/gen-postmortem-metadata.py for details.
|
# tools/gen-postmortem-metadata.py for details.
|
||||||
@ -257,6 +260,9 @@ config("features") {
|
|||||||
if (v8_use_external_startup_data) {
|
if (v8_use_external_startup_data) {
|
||||||
defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
|
defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
|
||||||
}
|
}
|
||||||
|
if (v8_enable_concurrent_marking) {
|
||||||
|
defines += [ "V8_CONCURRENT_MARKING" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
config("toolchain") {
|
config("toolchain") {
|
||||||
|
@ -668,7 +668,13 @@ DEFINE_BOOL(age_code, true,
|
|||||||
DEFINE_BOOL(incremental_marking, true, "use incremental marking")
|
DEFINE_BOOL(incremental_marking, true, "use incremental marking")
|
||||||
DEFINE_BOOL(incremental_marking_wrappers, true,
|
DEFINE_BOOL(incremental_marking_wrappers, true,
|
||||||
"use incremental marking for marking wrappers")
|
"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(trace_concurrent_marking, false, "trace concurrent marking")
|
||||||
DEFINE_BOOL(minor_mc_parallel_marking, true,
|
DEFINE_BOOL(minor_mc_parallel_marking, true,
|
||||||
"use parallel marking for the young generation")
|
"use parallel marking for the young generation")
|
||||||
|
@ -118,8 +118,6 @@ namespace internal {
|
|||||||
#define V8_DOUBLE_FIELDS_UNBOXING 0
|
#define V8_DOUBLE_FIELDS_UNBOXING 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define V8_CONCURRENT_MARKING 0
|
|
||||||
|
|
||||||
// Some types of tracing require the SFI to store a unique ID.
|
// Some types of tracing require the SFI to store a unique ID.
|
||||||
#if defined(V8_TRACE_MAPS) || defined(V8_TRACE_IGNITION)
|
#if defined(V8_TRACE_MAPS) || defined(V8_TRACE_IGNITION)
|
||||||
#define V8_SFI_HAS_UNIQUE_ID 1
|
#define V8_SFI_HAS_UNIQUE_ID 1
|
||||||
|
@ -236,10 +236,10 @@ ConcurrentMarking::ConcurrentMarking(Heap* heap, ConcurrentMarkingDeque* deque)
|
|||||||
deque_(deque),
|
deque_(deque),
|
||||||
visitor_(new ConcurrentMarkingVisitor(deque_)),
|
visitor_(new ConcurrentMarkingVisitor(deque_)),
|
||||||
is_task_pending_(false) {
|
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.
|
// 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_; }
|
ConcurrentMarking::~ConcurrentMarking() { delete visitor_; }
|
||||||
|
@ -5651,7 +5651,7 @@ bool Heap::SetUp() {
|
|||||||
mark_compact_collector_ = new MarkCompactCollector(this);
|
mark_compact_collector_ = new MarkCompactCollector(this);
|
||||||
incremental_marking_->set_marking_deque(
|
incremental_marking_->set_marking_deque(
|
||||||
mark_compact_collector_->marking_deque());
|
mark_compact_collector_->marking_deque());
|
||||||
#if V8_CONCURRENT_MARKING
|
#ifdef V8_CONCURRENT_MARKING
|
||||||
concurrent_marking_ =
|
concurrent_marking_ =
|
||||||
new ConcurrentMarking(this, mark_compact_collector_->marking_deque());
|
new ConcurrentMarking(this, mark_compact_collector_->marking_deque());
|
||||||
#else
|
#else
|
||||||
|
@ -141,7 +141,7 @@ void IncrementalMarking::MarkBlackAndPush(HeapObject* obj) {
|
|||||||
// Color the object black and push it into the bailout deque.
|
// Color the object black and push it into the bailout deque.
|
||||||
ObjectMarking::WhiteToGrey<kAtomicity>(obj, marking_state(obj));
|
ObjectMarking::WhiteToGrey<kAtomicity>(obj, marking_state(obj));
|
||||||
if (ObjectMarking::GreyToBlack<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);
|
marking_deque()->Push(obj, MarkingThread::kMain, TargetDeque::kBailout);
|
||||||
#else
|
#else
|
||||||
if (!marking_deque()->Push(obj)) {
|
if (!marking_deque()->Push(obj)) {
|
||||||
|
@ -182,7 +182,7 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
|
|||||||
static const intptr_t kActivationThreshold = 0;
|
static const intptr_t kActivationThreshold = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if V8_CONCURRENT_MARKING
|
#ifdef V8_CONCURRENT_MARKING
|
||||||
static const MarkBit::AccessMode kAtomicity = MarkBit::AccessMode::ATOMIC;
|
static const MarkBit::AccessMode kAtomicity = MarkBit::AccessMode::ATOMIC;
|
||||||
#else
|
#else
|
||||||
static const MarkBit::AccessMode kAtomicity = MarkBit::AccessMode::NON_ATOMIC;
|
static const MarkBit::AccessMode kAtomicity = MarkBit::AccessMode::NON_ATOMIC;
|
||||||
|
@ -33,7 +33,7 @@ class RecordMigratedSlotVisitor;
|
|||||||
class ThreadLocalTop;
|
class ThreadLocalTop;
|
||||||
class YoungGenerationMarkingVisitor;
|
class YoungGenerationMarkingVisitor;
|
||||||
|
|
||||||
#if V8_CONCURRENT_MARKING
|
#ifdef V8_CONCURRENT_MARKING
|
||||||
using MarkingDeque = ConcurrentMarkingDeque;
|
using MarkingDeque = ConcurrentMarkingDeque;
|
||||||
#else
|
#else
|
||||||
using MarkingDeque = SequentialMarkingDeque;
|
using MarkingDeque = SequentialMarkingDeque;
|
||||||
|
@ -1284,7 +1284,7 @@ bool JSObject::PrototypeHasNoElements(Isolate* isolate, JSObject* object) {
|
|||||||
reinterpret_cast<Object*>(base::NoBarrier_Load( \
|
reinterpret_cast<Object*>(base::NoBarrier_Load( \
|
||||||
reinterpret_cast<const base::AtomicWord*>(FIELD_ADDR_CONST(p, offset))))
|
reinterpret_cast<const base::AtomicWord*>(FIELD_ADDR_CONST(p, offset))))
|
||||||
|
|
||||||
#if V8_CONCURRENT_MARKING
|
#ifdef V8_CONCURRENT_MARKING
|
||||||
#define WRITE_FIELD(p, offset, value) \
|
#define WRITE_FIELD(p, offset, value) \
|
||||||
base::NoBarrier_Store( \
|
base::NoBarrier_Store( \
|
||||||
reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \
|
reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \
|
||||||
|
Loading…
Reference in New Issue
Block a user