Add a separate aggressive GC mode

This commit is contained in:
Alexander Shabalin
2021-06-18 12:03:02 +00:00
committed by Space
parent 1cfe1c41ef
commit e240b8a8ee
10 changed files with 41 additions and 4 deletions
@@ -293,6 +293,10 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
GC.SAME_THREAD_MARK_AND_SWEEP
}
})
if (memoryModel != MemoryModel.EXPERIMENTAL && arguments.gcAggressive) {
configuration.report(ERROR, "-Xgc-aggressive is only supported for -memory-model experimental")
}
put(GARBAGE_COLLECTOR_AGRESSIVE, arguments.gcAggressive)
}
}
}
@@ -308,6 +308,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value="-Xgc", valueDescription = "<gc>", description = "GC to use, 'noop' and 'stms' are currently supported. Works only with -memory-model experimental")
var gc: String? = null
@Argument(value="-Xgc-aggressive", description = "Make GC agressive. Works only with -memory-model experimental")
var gcAggressive: Boolean = false
override fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> =
super.configureAnalysisFlags(collector).also {
val useExperimental = it[AnalysisFlags.useExperimental] as List<*>