[K/N] Enable lazy property initialization with the new MM
This commit is contained in:
committed by
Space
parent
b5fa129540
commit
a7460e9061
@@ -328,7 +328,20 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
RuntimeAssertsMode.IGNORE
|
||||
}
|
||||
})
|
||||
put(PROPERTY_LAZY_INITIALIZATION, arguments.propertyLazyInitialization)
|
||||
put(PROPERTY_LAZY_INITIALIZATION, when (arguments.propertyLazyInitialization) {
|
||||
null -> {
|
||||
when (memoryModel) {
|
||||
MemoryModel.EXPERIMENTAL -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
"enable" -> true
|
||||
"disable" -> false
|
||||
else -> {
|
||||
configuration.report(ERROR, "Expected 'enable' or 'disable' for lazy property initialization")
|
||||
false
|
||||
}
|
||||
})
|
||||
put(WORKER_EXCEPTION_HANDLING, when (arguments.workerExceptionHandling) {
|
||||
null -> if (memoryModel == MemoryModel.EXPERIMENTAL) WorkerExceptionHandling.USE_HOOK else WorkerExceptionHandling.LEGACY
|
||||
"legacy" -> WorkerExceptionHandling.LEGACY
|
||||
|
||||
+2
-2
@@ -323,8 +323,8 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
||||
@Argument(value="-Xgc-aggressive", description = "Make GC agressive. Works only with -memory-model experimental")
|
||||
var gcAggressive: Boolean = false
|
||||
|
||||
@Argument(value = "-Xir-property-lazy-initialization", description = "Initialize top level properties lazily per file")
|
||||
var propertyLazyInitialization: Boolean = false
|
||||
@Argument(value = "-Xir-property-lazy-initialization", valueDescription = "{disable|enable}", description = "Initialize top level properties lazily per file")
|
||||
var propertyLazyInitialization: String? = null
|
||||
|
||||
@Argument(value="-Xruntime-asserts-mode", valueDescription = "<mode>", description = "Enable asserts in runtime. Possible values: 'ignore', 'log', 'panic'")
|
||||
var runtimeAssertsMode: String? = "ignore"
|
||||
|
||||
Reference in New Issue
Block a user