JVM IR: clear BindingContext after psi2ir
This helps to reduce peak memory in lowerings/codegen by a lot. A more robust approach would be to have a separate BindingContext for each file, and clear each of them after running psi2ir on it. This would also lower peak memory usage in psi2ir. Provide a fallback workaround compiler argument -Xir-do-not-clear-binding-context just in case BindingContext is in fact used somewhere and it's not caught by tests.
This commit is contained in:
+1
@@ -169,6 +169,7 @@ class DebuggerTestCompilerFacility(
|
||||
val configuration = CompilerConfiguration()
|
||||
configuration.put(JVMConfigurationKeys.JVM_TARGET, jvmTarget)
|
||||
configuration.put(JVMConfigurationKeys.IR, useIrBackend)
|
||||
configuration.put(JVMConfigurationKeys.DO_NOT_CLEAR_BINDING_CONTEXT, true)
|
||||
|
||||
val state = GenerationUtils.generateFiles(project, files, configuration, ClassBuilderFactories.BINARIES, analysisResult) {
|
||||
generateDeclaredClassFilter(GenerationState.GenerateClassFilter.GENERATE_ALL)
|
||||
|
||||
Reference in New Issue
Block a user