Commit fee3bf09 authored by Omer Katz's avatar Omer Katz Committed by V8 LUCI CQ

heap: Remove build flag for MinorMC

The build flag is on by default and the actual functionality is guarded
by a runtime flag.

Bug: v8:12612
Change-Id: I6adbd5b766f502400af32eeeb035edca3a3606ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3448383Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79036}
parent ca849f24
...@@ -53,7 +53,6 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression ...@@ -53,7 +53,6 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression
# v8_can_use_fpu_instructions # v8_can_use_fpu_instructions
# v8_use_mips_abi_hardfloat # v8_use_mips_abi_hardfloat
# v8_enable_gdbjit # v8_enable_gdbjit
# v8_enable_minor_mc
# v8_check_header_includes # v8_check_header_includes
# v8_enable_shared_ro_heap # v8_enable_shared_ro_heap
# v8_enable_lazy_source_positions # v8_enable_lazy_source_positions
...@@ -122,11 +121,6 @@ v8_flag( ...@@ -122,11 +121,6 @@ v8_flag(
default = True, default = True,
) )
v8_flag(
name = "v8_enable_minor_mc",
default = True,
)
v8_flag(name = "v8_enable_object_print") v8_flag(name = "v8_enable_object_print")
v8_flag(name = "v8_enable_slow_dchecks") v8_flag(name = "v8_enable_slow_dchecks")
...@@ -259,7 +253,6 @@ v8_config( ...@@ -259,7 +253,6 @@ v8_config(
"v8_enable_hugepage": "ENABLE_HUGEPAGE", "v8_enable_hugepage": "ENABLE_HUGEPAGE",
"v8_enable_future": "V8_ENABLE_FUTURE", "v8_enable_future": "V8_ENABLE_FUTURE",
"v8_enable_lazy_source_positions": "V8_ENABLE_LAZY_SOURCE_POSITIONS", "v8_enable_lazy_source_positions": "V8_ENABLE_LAZY_SOURCE_POSITIONS",
"v8_enable_minor_mc": "ENABLE_MINOR_MC",
"v8_enable_object_print": "OBJECT_PRINT", "v8_enable_object_print": "OBJECT_PRINT",
"v8_enable_slow_dchecks": "ENABLE_SLOW_DCHECKS", "v8_enable_slow_dchecks": "ENABLE_SLOW_DCHECKS",
"v8_enable_snapshot_native_code_counters": "V8_SNAPSHOT_NATIVE_CODE_COUNTERS", "v8_enable_snapshot_native_code_counters": "V8_SNAPSHOT_NATIVE_CODE_COUNTERS",
......
...@@ -225,9 +225,6 @@ declare_args() { ...@@ -225,9 +225,6 @@ declare_args() {
(is_linux || is_chromeos || is_mac)) || (is_linux || is_chromeos || is_mac)) ||
(v8_current_cpu == "ppc64" && (is_linux || is_chromeos)) (v8_current_cpu == "ppc64" && (is_linux || is_chromeos))
# Enable minor mark compact.
v8_enable_minor_mc = true
# Check that each header can be included in isolation (requires also # Check that each header can be included in isolation (requires also
# setting the "check_v8_header_includes" gclient variable to run a # setting the "check_v8_header_includes" gclient variable to run a
# specific hook). # specific hook).
...@@ -861,9 +858,6 @@ config("features") { ...@@ -861,9 +858,6 @@ config("features") {
if (v8_enable_hugepage) { if (v8_enable_hugepage) {
defines += [ "ENABLE_HUGEPAGE" ] defines += [ "ENABLE_HUGEPAGE" ]
} }
if (v8_enable_minor_mc) {
defines += [ "ENABLE_MINOR_MC" ]
}
if (v8_enable_object_print) { if (v8_enable_object_print) {
defines += [ "OBJECT_PRINT" ] defines += [ "OBJECT_PRINT" ]
} }
......
...@@ -1855,14 +1855,9 @@ DEFINE_NEG_NEG_IMPLICATION(text_is_readable, partial_constant_pool) ...@@ -1855,14 +1855,9 @@ DEFINE_NEG_NEG_IMPLICATION(text_is_readable, partial_constant_pool)
// //
// Minor mark compact collector flags. // Minor mark compact collector flags.
// //
#ifdef ENABLE_MINOR_MC
DEFINE_BOOL(trace_minor_mc_parallel_marking, false, DEFINE_BOOL(trace_minor_mc_parallel_marking, false,
"trace parallel marking for the young generation") "trace parallel marking for the young generation")
DEFINE_BOOL(minor_mc, false, "perform young generation mark compact GCs") DEFINE_BOOL(minor_mc, false, "perform young generation mark compact GCs")
#else
DEFINE_BOOL_READONLY(minor_mc, false,
"perform young generation mark compact GCs")
#endif // ENABLE_MINOR_MC
// //
// Dev shell flags // Dev shell flags
......
...@@ -2577,7 +2577,6 @@ void Heap::MarkCompact() { ...@@ -2577,7 +2577,6 @@ void Heap::MarkCompact() {
} }
void Heap::MinorMarkCompact() { void Heap::MinorMarkCompact() {
#ifdef ENABLE_MINOR_MC
DCHECK(FLAG_minor_mc); DCHECK(FLAG_minor_mc);
DCHECK(new_space()); DCHECK(new_space());
...@@ -2603,9 +2602,6 @@ void Heap::MinorMarkCompact() { ...@@ -2603,9 +2602,6 @@ void Heap::MinorMarkCompact() {
minor_mark_compact_collector()->CollectGarbage(); minor_mark_compact_collector()->CollectGarbage();
SetGCState(NOT_IN_GC); SetGCState(NOT_IN_GC);
#else
UNREACHABLE();
#endif // ENABLE_MINOR_MC
} }
void Heap::MarkCompactEpilogue() { void Heap::MarkCompactEpilogue() {
...@@ -4669,9 +4665,7 @@ class OldToNewSlotVerifyingVisitor : public SlotVerifyingVisitor { ...@@ -4669,9 +4665,7 @@ class OldToNewSlotVerifyingVisitor : public SlotVerifyingVisitor {
void VisitEphemeron(HeapObject host, int index, ObjectSlot key, void VisitEphemeron(HeapObject host, int index, ObjectSlot key,
ObjectSlot target) override { ObjectSlot target) override {
VisitPointer(host, target); VisitPointer(host, target);
#ifdef ENABLE_MINOR_MC
if (FLAG_minor_mc) return VisitPointer(host, target); if (FLAG_minor_mc) return VisitPointer(host, target);
#endif
// Keys are handled separately and should never appear in this set. // Keys are handled separately and should never appear in this set.
CHECK(!InUntypedSet(key)); CHECK(!InUntypedSet(key));
Object k = *key; Object k = *key;
...@@ -5829,11 +5823,7 @@ void Heap::SetUpSpaces(LinearAllocationArea* new_allocation_info, ...@@ -5829,11 +5823,7 @@ void Heap::SetUpSpaces(LinearAllocationArea* new_allocation_info,
} }
tracer_.reset(new GCTracer(this)); tracer_.reset(new GCTracer(this));
#ifdef ENABLE_MINOR_MC
minor_mark_compact_collector_ = new MinorMarkCompactCollector(this); minor_mark_compact_collector_ = new MinorMarkCompactCollector(this);
#else
minor_mark_compact_collector_ = nullptr;
#endif // ENABLE_MINOR_MC
array_buffer_sweeper_.reset(new ArrayBufferSweeper(this)); array_buffer_sweeper_.reset(new ArrayBufferSweeper(this));
gc_idle_time_handler_.reset(new GCIdleTimeHandler()); gc_idle_time_handler_.reset(new GCIdleTimeHandler());
memory_measurement_.reset(new MemoryMeasurement(isolate())); memory_measurement_.reset(new MemoryMeasurement(isolate()));
...@@ -5854,11 +5844,9 @@ void Heap::SetUpSpaces(LinearAllocationArea* new_allocation_info, ...@@ -5854,11 +5844,9 @@ void Heap::SetUpSpaces(LinearAllocationArea* new_allocation_info,
LOG(isolate_, IntPtrTEvent("heap-available", Available())); LOG(isolate_, IntPtrTEvent("heap-available", Available()));
mark_compact_collector()->SetUp(); mark_compact_collector()->SetUp();
#ifdef ENABLE_MINOR_MC
if (minor_mark_compact_collector() != nullptr) { if (minor_mark_compact_collector() != nullptr) {
minor_mark_compact_collector()->SetUp(); minor_mark_compact_collector()->SetUp();
} }
#endif // ENABLE_MINOR_MC
if (new_space()) { if (new_space()) {
scavenge_job_.reset(new ScavengeJob()); scavenge_job_.reset(new ScavengeJob());
...@@ -6137,13 +6125,11 @@ void Heap::TearDown() { ...@@ -6137,13 +6125,11 @@ void Heap::TearDown() {
mark_compact_collector_.reset(); mark_compact_collector_.reset();
} }
#ifdef ENABLE_MINOR_MC
if (minor_mark_compact_collector_ != nullptr) { if (minor_mark_compact_collector_ != nullptr) {
minor_mark_compact_collector_->TearDown(); minor_mark_compact_collector_->TearDown();
delete minor_mark_compact_collector_; delete minor_mark_compact_collector_;
minor_mark_compact_collector_ = nullptr; minor_mark_compact_collector_ = nullptr;
} }
#endif // ENABLE_MINOR_MC
scavenger_collector_.reset(); scavenger_collector_.reset();
array_buffer_sweeper_.reset(); array_buffer_sweeper_.reset();
......
...@@ -483,12 +483,8 @@ class Heap { ...@@ -483,12 +483,8 @@ class Heap {
} }
static inline GarbageCollector YoungGenerationCollector() { static inline GarbageCollector YoungGenerationCollector() {
#if ENABLE_MINOR_MC
return (FLAG_minor_mc) ? GarbageCollector::MINOR_MARK_COMPACTOR return (FLAG_minor_mc) ? GarbageCollector::MINOR_MARK_COMPACTOR
: GarbageCollector::SCAVENGER; : GarbageCollector::SCAVENGER;
#else
return GarbageCollector::SCAVENGER;
#endif // ENABLE_MINOR_MC
} }
static inline const char* CollectorName(GarbageCollector collector) { static inline const char* CollectorName(GarbageCollector collector) {
......
...@@ -441,10 +441,8 @@ void IncrementalMarking::UpdateMarkingWorklistAfterScavenge() { ...@@ -441,10 +441,8 @@ void IncrementalMarking::UpdateMarkingWorklistAfterScavenge() {
Map filler_map = ReadOnlyRoots(heap_).one_pointer_filler_map(); Map filler_map = ReadOnlyRoots(heap_).one_pointer_filler_map();
#ifdef ENABLE_MINOR_MC
MinorMarkCompactCollector::MarkingState* minor_marking_state = MinorMarkCompactCollector::MarkingState* minor_marking_state =
heap()->minor_mark_compact_collector()->marking_state(); heap()->minor_mark_compact_collector()->marking_state();
#endif // ENABLE_MINOR_MC
collector_->local_marking_worklists()->Publish(); collector_->local_marking_worklists()->Publish();
MarkingBarrier::PublishAll(heap()); MarkingBarrier::PublishAll(heap());
...@@ -455,10 +453,8 @@ void IncrementalMarking::UpdateMarkingWorklistAfterScavenge() { ...@@ -455,10 +453,8 @@ void IncrementalMarking::UpdateMarkingWorklistAfterScavenge() {
// this is referred inside DCHECK. // this is referred inside DCHECK.
this, this,
#endif #endif
#ifdef ENABLE_MINOR_MC minor_marking_state, cage_base,
minor_marking_state, filler_map](HeapObject obj, HeapObject* out) -> bool {
#endif
cage_base, filler_map](HeapObject obj, HeapObject* out) -> bool {
DCHECK(obj.IsHeapObject()); DCHECK(obj.IsHeapObject());
// Only pointers to from space have to be updated. // Only pointers to from space have to be updated.
if (Heap::InFromPage(obj)) { if (Heap::InFromPage(obj)) {
...@@ -481,24 +477,20 @@ void IncrementalMarking::UpdateMarkingWorklistAfterScavenge() { ...@@ -481,24 +477,20 @@ void IncrementalMarking::UpdateMarkingWorklistAfterScavenge() {
// new space. // new space.
DCHECK(Heap::IsLargeObject(obj) || DCHECK(Heap::IsLargeObject(obj) ||
Page::FromHeapObject(obj)->IsFlagSet(Page::SWEEP_TO_ITERATE)); Page::FromHeapObject(obj)->IsFlagSet(Page::SWEEP_TO_ITERATE));
#ifdef ENABLE_MINOR_MC
if (minor_marking_state->IsWhite(obj)) { if (minor_marking_state->IsWhite(obj)) {
return false; return false;
} }
#endif // ENABLE_MINOR_MC // Either a large object or an object marked by the minor
// Either a large object or an object marked by the minor // mark-compactor.
// mark-compactor.
*out = obj; *out = obj;
return true; return true;
} else { } else {
// The object may be on a page that was moved from new to old space. // The object may be on a page that was moved from new to old space.
// Only applicable during minor MC garbage collections. // Only applicable during minor MC garbage collections.
if (Page::FromHeapObject(obj)->IsFlagSet(Page::SWEEP_TO_ITERATE)) { if (Page::FromHeapObject(obj)->IsFlagSet(Page::SWEEP_TO_ITERATE)) {
#ifdef ENABLE_MINOR_MC
if (minor_marking_state->IsWhite(obj)) { if (minor_marking_state->IsWhite(obj)) {
return false; return false;
} }
#endif // ENABLE_MINOR_MC
*out = obj; *out = obj;
return true; return true;
} }
......
...@@ -489,7 +489,6 @@ AllocationResult NewLargeObjectSpace::AllocateRaw(int object_size) { ...@@ -489,7 +489,6 @@ AllocationResult NewLargeObjectSpace::AllocateRaw(int object_size) {
page->SetYoungGenerationPageFlags(heap()->incremental_marking()->IsMarking()); page->SetYoungGenerationPageFlags(heap()->incremental_marking()->IsMarking());
page->SetFlag(MemoryChunk::TO_PAGE); page->SetFlag(MemoryChunk::TO_PAGE);
UpdatePendingObject(result); UpdatePendingObject(result);
#ifdef ENABLE_MINOR_MC
if (FLAG_minor_mc) { if (FLAG_minor_mc) {
page->AllocateYoungGenerationBitmap(); page->AllocateYoungGenerationBitmap();
heap() heap()
...@@ -497,7 +496,6 @@ AllocationResult NewLargeObjectSpace::AllocateRaw(int object_size) { ...@@ -497,7 +496,6 @@ AllocationResult NewLargeObjectSpace::AllocateRaw(int object_size) {
->non_atomic_marking_state() ->non_atomic_marking_state()
->ClearLiveness(page); ->ClearLiveness(page);
} }
#endif // ENABLE_MINOR_MC
page->InitializationMemoryFence(); page->InitializationMemoryFence();
DCHECK(page->IsLargePage()); DCHECK(page->IsLargePage());
DCHECK_EQ(page->owner_identity(), NEW_LO_SPACE); DCHECK_EQ(page->owner_identity(), NEW_LO_SPACE);
......
...@@ -40,8 +40,6 @@ void MarkCompactCollector::MarkRootObject(Root root, HeapObject obj) { ...@@ -40,8 +40,6 @@ void MarkCompactCollector::MarkRootObject(Root root, HeapObject obj) {
} }
} }
#ifdef ENABLE_MINOR_MC
void MinorMarkCompactCollector::MarkRootObject(HeapObject obj) { void MinorMarkCompactCollector::MarkRootObject(HeapObject obj) {
if (Heap::InYoungGeneration(obj) && if (Heap::InYoungGeneration(obj) &&
non_atomic_marking_state_.WhiteToGrey(obj)) { non_atomic_marking_state_.WhiteToGrey(obj)) {
...@@ -49,8 +47,6 @@ void MinorMarkCompactCollector::MarkRootObject(HeapObject obj) { ...@@ -49,8 +47,6 @@ void MinorMarkCompactCollector::MarkRootObject(HeapObject obj) {
} }
} }
#endif
void MarkCompactCollector::MarkExternallyReferencedObject(HeapObject obj) { void MarkCompactCollector::MarkExternallyReferencedObject(HeapObject obj) {
if (marking_state()->WhiteToGrey(obj)) { if (marking_state()->WhiteToGrey(obj)) {
local_marking_worklists()->Push(obj); local_marking_worklists()->Push(obj);
......
...@@ -613,9 +613,7 @@ void MarkCompactCollector::CollectGarbage() { ...@@ -613,9 +613,7 @@ void MarkCompactCollector::CollectGarbage() {
// update the state as they proceed. // update the state as they proceed.
DCHECK(state_ == PREPARE_GC); DCHECK(state_ == PREPARE_GC);
#ifdef ENABLE_MINOR_MC
heap()->minor_mark_compact_collector()->CleanupSweepToIteratePages(); heap()->minor_mark_compact_collector()->CleanupSweepToIteratePages();
#endif // ENABLE_MINOR_MC
MarkLiveObjects(); MarkLiveObjects();
ClearNonLiveReferences(); ClearNonLiveReferences();
...@@ -4806,8 +4804,6 @@ void MarkCompactCollector::StartSweepSpaces() { ...@@ -4806,8 +4804,6 @@ void MarkCompactCollector::StartSweepSpaces() {
} }
} }
#ifdef ENABLE_MINOR_MC
namespace { namespace {
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
...@@ -5989,7 +5985,5 @@ void MinorMarkCompactCollector::EvacuatePagesInParallel() { ...@@ -5989,7 +5985,5 @@ void MinorMarkCompactCollector::EvacuatePagesInParallel() {
} }
} }
#endif // ENABLE_MINOR_MC
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -844,8 +844,6 @@ class V8_NODISCARD EvacuationScope { ...@@ -844,8 +844,6 @@ class V8_NODISCARD EvacuationScope {
MarkCompactCollector* collector_; MarkCompactCollector* collector_;
}; };
#ifdef ENABLE_MINOR_MC
// Collector for young-generation only. // Collector for young-generation only.
class MinorMarkCompactCollector final : public MarkCompactCollectorBase { class MinorMarkCompactCollector final : public MarkCompactCollectorBase {
public: public:
...@@ -925,8 +923,6 @@ class MinorMarkCompactCollector final : public MarkCompactCollectorBase { ...@@ -925,8 +923,6 @@ class MinorMarkCompactCollector final : public MarkCompactCollectorBase {
friend class YoungGenerationMarkingVisitor; friend class YoungGenerationMarkingVisitor;
}; };
#endif // ENABLE_MINOR_MC
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -24,7 +24,6 @@ Page* SemiSpace::InitializePage(MemoryChunk* chunk) { ...@@ -24,7 +24,6 @@ Page* SemiSpace::InitializePage(MemoryChunk* chunk) {
Page* page = static_cast<Page*>(chunk); Page* page = static_cast<Page*>(chunk);
page->SetYoungGenerationPageFlags(heap()->incremental_marking()->IsMarking()); page->SetYoungGenerationPageFlags(heap()->incremental_marking()->IsMarking());
page->list_node().Initialize(); page->list_node().Initialize();
#ifdef ENABLE_MINOR_MC
if (FLAG_minor_mc) { if (FLAG_minor_mc) {
page->AllocateYoungGenerationBitmap(); page->AllocateYoungGenerationBitmap();
heap() heap()
...@@ -32,7 +31,6 @@ Page* SemiSpace::InitializePage(MemoryChunk* chunk) { ...@@ -32,7 +31,6 @@ Page* SemiSpace::InitializePage(MemoryChunk* chunk) {
->non_atomic_marking_state() ->non_atomic_marking_state()
->ClearLiveness(page); ->ClearLiveness(page);
} }
#endif // ENABLE_MINOR_MC
page->InitializationMemoryFence(); page->InitializationMemoryFence();
return page; return page;
} }
......
...@@ -1368,11 +1368,9 @@ class OneByteVectorResource : public v8::String::ExternalOneByteStringResource { ...@@ -1368,11 +1368,9 @@ class OneByteVectorResource : public v8::String::ExternalOneByteStringResource {
}; };
TEST(InternalizeExternal) { TEST(InternalizeExternal) {
#ifdef ENABLE_MINOR_MC
// TODO(mlippautz): Remove once we add support for forwarding ThinStrings in // TODO(mlippautz): Remove once we add support for forwarding ThinStrings in
// minor MC // minor MC
if (FLAG_minor_mc) return; if (FLAG_minor_mc) return;
#endif // ENABLE_MINOR_MC
FLAG_stress_incremental_marking = false; FLAG_stress_incremental_marking = false;
CcTest::InitializeVM(); CcTest::InitializeVM();
i::Isolate* isolate = CcTest::i_isolate(); i::Isolate* isolate = CcTest::i_isolate();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment