Delete MarkCompact GC
Test: test-art-host
Bug: 77721758
Change-Id: I99889353eb97f46c59de7ed44f2944f83867031d
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index f16138c..6849220 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -48,7 +48,6 @@
#include "gc/accounting/remembered_set.h"
#include "gc/accounting/space_bitmap-inl.h"
#include "gc/collector/concurrent_copying.h"
-#include "gc/collector/mark_compact.h"
#include "gc/collector/mark_sweep.h"
#include "gc/collector/partial_mark_sweep.h"
#include "gc/collector/semi_space.h"
@@ -262,7 +261,6 @@
verify_object_mode_(kVerifyObjectModeDisabled),
disable_moving_gc_count_(0),
semi_space_collector_(nullptr),
- mark_compact_collector_(nullptr),
concurrent_copying_collector_(nullptr),
is_running_on_memory_tool_(Runtime::Current()->IsRunningOnMemoryTool()),
use_tlab_(use_tlab),
@@ -603,10 +601,6 @@
concurrent_copying_collector_->SetRegionSpace(region_space_);
garbage_collectors_.push_back(concurrent_copying_collector_);
}
- if (MayUseCollector(kCollectorTypeMC)) {
- mark_compact_collector_ = new collector::MarkCompact(this);
- garbage_collectors_.push_back(mark_compact_collector_);
- }
}
if (!GetBootImageSpaces().empty() && non_moving_space_ != nullptr &&
(is_zygote || separate_non_moving_space || foreground_collector_type_ == kCollectorTypeGSS)) {
@@ -2122,10 +2116,6 @@
void Heap::ChangeCollector(CollectorType collector_type) {
// TODO: Only do this with all mutators suspended to avoid races.
if (collector_type != collector_type_) {
- if (collector_type == kCollectorTypeMC) {
- // Don't allow mark compact unless support is compiled in.
- CHECK(kMarkCompactSupport);
- }
collector_type_ = collector_type;
gc_plan_.clear();
switch (collector_type_) {
@@ -2138,7 +2128,6 @@
}
break;
}
- case kCollectorTypeMC: // Fall-through.
case kCollectorTypeSS: // Fall-through.
case kCollectorTypeGSS: {
gc_plan_.push_back(collector::kGcTypeFull);
@@ -2487,13 +2476,9 @@
semi_space_collector_->SetToSpace(target_space);
semi_space_collector_->Run(gc_cause, false);
return semi_space_collector_;
- } else {
- CHECK(target_space->IsBumpPointerSpace())
- << "In-place compaction is only supported for bump pointer spaces";
- mark_compact_collector_->SetSpace(target_space->AsBumpPointerSpace());
- mark_compact_collector_->Run(kGcCauseCollectorTransition, false);
- return mark_compact_collector_;
}
+ LOG(FATAL) << "Unsupported";
+ UNREACHABLE();
}
void Heap::TraceHeapSize(size_t heap_size) {
@@ -2583,14 +2568,10 @@
case kCollectorTypeCC:
collector = concurrent_copying_collector_;
break;
- case kCollectorTypeMC:
- mark_compact_collector_->SetSpace(bump_pointer_space_);
- collector = mark_compact_collector_;
- break;
default:
LOG(FATAL) << "Invalid collector type " << static_cast<size_t>(collector_type_);
}
- if (collector != mark_compact_collector_ && collector != concurrent_copying_collector_) {
+ if (collector != concurrent_copying_collector_) {
temp_space_->GetMemMap()->Protect(PROT_READ | PROT_WRITE);
if (kIsDebugBuild) {
// Try to read each page of the memory map in case mprotect didn't work properly b/19894268.