[K/N] Rework GC switches with better naming

Additionally, deprecate -Xgc in favour of a new binary option "gc".
This will allow setting gc right in gradle.properties

Merge-request: KT-MR-10498
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
This commit is contained in:
Alexander Shabalin
2023-06-09 12:04:19 +00:00
committed by Space Team
parent fc7af2c9e0
commit 7815eec7c1
8 changed files with 82 additions and 36 deletions
@@ -141,7 +141,11 @@ internal enum class Sanitizer(val compilerFlag: String?) {
*/
internal enum class GCType(val compilerFlag: String?) {
UNSPECIFIED(null),
NOOP("-Xgc=noop"),
NOOP("-Xbinary=gc=noop"),
STWMS("-Xbinary=gc=stwms"),
PMCS("-Xbinary=gc=pmcs"),
// TODO: Remove these deprecated GC options.
STMS("-Xgc=stms"),
CMS("-Xgc=cms");
@@ -150,10 +154,14 @@ internal enum class GCType(val compilerFlag: String?) {
internal enum class GCScheduler(val compilerFlag: String?) {
UNSPECIFIED(null),
MANUAL("-Xbinary=gcSchedulerType=manual"),
ADAPTIVE("-Xbinary=gcSchedulerType=adaptive"),
AGGRESSIVE("-Xbinary=gcSchedulerType=aggressive"),
// TODO: Remove these deprecated GC scheduler options.
DISABLED("-Xbinary=gcSchedulerType=disabled"),
WITH_TIMER("-Xbinary=gcSchedulerType=with_timer"),
ON_SAFE_POINTS("-Xbinary=gcSchedulerType=on_safe_points"),
AGGRESSIVE("-Xbinary=gcSchedulerType=aggressive");
ON_SAFE_POINTS("-Xbinary=gcSchedulerType=on_safe_points");
override fun toString() = compilerFlag?.let { "($it)" }.orEmpty()
}