[K/N] Enable CMS GC by default for the new MM

Issue #KT-50713 Fixed
This commit is contained in:
Ilya Matveev
2022-01-19 19:59:45 +07:00
parent f835433221
commit 1e78036a1b
6 changed files with 9 additions and 4 deletions
@@ -327,7 +327,7 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value="-Xdestroy-runtime-mode", valueDescription = "<mode>", description = "When to destroy runtime. 'legacy' and 'on-shutdown' are currently supported. NOTE: 'legacy' mode is deprecated and will be removed.")
var destroyRuntimeMode: String? = "on-shutdown"
@Argument(value="-Xgc", valueDescription = "<gc>", description = "GC to use, 'noop' and 'stms' are currently supported. Works only with -memory-model experimental")
@Argument(value="-Xgc", valueDescription = "<gc>", description = "GC to use, 'noop', 'stms' and 'cms' are currently supported. Works only with -memory-model experimental")
var gc: String? = null
@Argument(value = "-Xir-property-lazy-initialization", valueDescription = "{disable|enable}", description = "Initialize top level properties lazily per file")
@@ -86,7 +86,7 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
val (gcFallbackReason, realGc) = when {
configGc == GC.CONCURRENT_MARK_AND_SWEEP && !target.supportsThreads() ->
"Concurrent mark and sweep gc is not supported for this target. Fallback to Same thread mark and sweep is done" to GC.SAME_THREAD_MARK_AND_SWEEP
configGc == null -> null to GC.SAME_THREAD_MARK_AND_SWEEP
configGc == null -> null to GC.CONCURRENT_MARK_AND_SWEEP
else -> null to configGc
}
if (gcFallbackReason != null) {
@@ -99,6 +99,7 @@ gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(
}
}
});
RuntimeLogDebug({kTagGC}, "Concurrent Mark & Sweep GC initialized");
}
gc::ConcurrentMarkAndSweep::~ConcurrentMarkAndSweep() {
@@ -51,7 +51,9 @@ public:
private:
};
NoOpGC(mm::ObjectFactory<NoOpGC>&, GCScheduler&) noexcept {}
NoOpGC(mm::ObjectFactory<NoOpGC>&, GCScheduler&) noexcept {
RuntimeLogDebug({kTagGC}, "No-op GC initialized");
}
~NoOpGC() = default;
GCScheduler& scheduler() noexcept { return scheduler_; }
@@ -112,6 +112,7 @@ gc::SameThreadMarkAndSweep::SameThreadMarkAndSweep(
RuntimeLogDebug({kTagGC}, "Scheduling GC by thread %d", konan::currentThreadId());
}
});
RuntimeLogDebug({kTagGC}, "Same thread Mark & Sweep GC initialized");
}
bool gc::SameThreadMarkAndSweep::PerformFullGC() noexcept {
@@ -87,7 +87,8 @@ internal enum class ThreadStateChecker(val compilerFlag: String?) {
internal enum class GCType(val compilerFlag: String?) {
UNSPECIFIED(null),
NOOP("-Xgc=noop"),
STMS("-Xgc=stms");
STMS("-Xgc=stms"),
CMS("-Xgc=cms");
override fun toString() = compilerFlag?.let { "($it)" }.orEmpty()
}