[K/N] Turn on optimistic escape analysis

For new MM (with tracing GC), it is safe to turn it on
This commit is contained in:
Igor Chevdar
2023-05-07 14:04:53 +03:00
committed by Space Team
parent b22e89e91d
commit a8135c60ce
2 changed files with 3 additions and 5 deletions
@@ -1710,7 +1710,8 @@ internal class CodeGeneratorVisitor(
private fun needLifetimeConstraintsCheck(valueToAssign: LLVMValueRef, irClass: IrClass): Boolean {
// TODO: Likely, we don't need isFrozen check here at all.
return functionGenerationContext.isObjectType(valueToAssign.type) && !irClass.isFrozen(context)
return context.config.memoryModel != MemoryModel.EXPERIMENTAL
&& functionGenerationContext.isObjectType(valueToAssign.type) && !irClass.isFrozen(context)
}
private fun isZeroConstValue(value: IrExpression): Boolean {
@@ -1812,10 +1812,7 @@ internal object EscapeAnalysis {
val intraproceduralAnalysisResult =
IntraproceduralAnalysis(context, moduleDFG, externalModulesDFG, callGraph).analyze()
InterproceduralAnalysis(context, generationState, callGraph, intraproceduralAnalysisResult, externalModulesDFG, lifetimes,
// TODO: This is a bit conservative, but for more aggressive option some support from runtime is
// needed (namely, determining that a pointer is from the stack; this is easy for x86 or x64,
// but what about all other platforms?).
propagateExiledToHeapObjects = true
propagateExiledToHeapObjects = context.config.memoryModel != MemoryModel.EXPERIMENTAL
).analyze()
} catch (t: Throwable) {
val extraUserInfo =