[JS IR BE] Remove generateModuleInGlobalScope for code generator
This method used to be a workaround for test speedup. Now we use proper close world module with runtime+stdlib module as pre-serialized klib.
This commit is contained in:
+1
-13
@@ -78,16 +78,6 @@ class IrModuleToJsTransformer(private val backendContext: JsIrBackendContext) :
|
|||||||
.toList()
|
.toList()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun generateModuleInGlobalScope(module: IrModuleFragment): JsProgram {
|
|
||||||
val program = JsProgram()
|
|
||||||
val rootContext = JsGenerationContext(JsRootScope(program), backendContext)
|
|
||||||
|
|
||||||
val moduleBody = generateModuleBody(module, rootContext)
|
|
||||||
program.globalBlock.statements += moduleBody
|
|
||||||
|
|
||||||
return program
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun generateModule(module: IrModuleFragment): JsProgram {
|
private fun generateModule(module: IrModuleFragment): JsProgram {
|
||||||
val program = JsProgram()
|
val program = JsProgram()
|
||||||
val rootContext = JsGenerationContext(JsRootScope(program), backendContext)
|
val rootContext = JsGenerationContext(JsRootScope(program), backendContext)
|
||||||
@@ -186,9 +176,7 @@ class IrModuleToJsTransformer(private val backendContext: JsIrBackendContext) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun visitModuleFragment(declaration: IrModuleFragment, data: Nothing?): JsNode =
|
override fun visitModuleFragment(declaration: IrModuleFragment, data: Nothing?): JsNode =
|
||||||
if (backendContext.compilationMode.generateKlib) generateModuleInGlobalScope(declaration)
|
generateModule(declaration)
|
||||||
else generateModule(declaration)
|
|
||||||
|
|
||||||
|
|
||||||
private fun processClassModels(
|
private fun processClassModels(
|
||||||
classModelMap: Map<JsName, JsClassModel>,
|
classModelMap: Map<JsName, JsClassModel>,
|
||||||
|
|||||||
Reference in New Issue
Block a user