IR: use IrFactory in SymbolTable
This commit is contained in:
+6
-6
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.scripting.repl.js.test
|
||||
import org.jetbrains.kotlin.backend.common.serialization.signature.IdSignatureDescriptor
|
||||
import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerDesc
|
||||
import org.jetbrains.kotlin.ir.backend.js.utils.NameTables
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.js.engine.ScriptEngineNashorn
|
||||
import org.jetbrains.kotlin.scripting.compiler.plugin.repl.ReplCodeAnalyzerBase
|
||||
@@ -23,9 +24,7 @@ class JsReplTestAgainstBinaries : AbstractJsReplTest() {
|
||||
|
||||
init {
|
||||
val nameTable = NameTables(emptyList())
|
||||
val mangler = JsManglerDesc
|
||||
val signaturer = IdSignatureDescriptor(mangler)
|
||||
val compiler = JsScriptDependencyCompiler(environment.configuration, nameTable, SymbolTable(signaturer))
|
||||
val compiler = JsScriptDependencyCompiler(environment.configuration, nameTable, createSymbolTable())
|
||||
val runtimeBinary = compiler.compile(dependencies)
|
||||
|
||||
dependencyLoader.saveScriptDependencyBinary(runtimeBinary)
|
||||
@@ -34,11 +33,12 @@ class JsReplTestAgainstBinaries : AbstractJsReplTest() {
|
||||
|
||||
override fun createCompilationState(): JsReplCompilationState {
|
||||
val replState = ReplCodeAnalyzerBase.ResettableAnalyzerState()
|
||||
val mangler = JsManglerDesc
|
||||
val signaturer = IdSignatureDescriptor(mangler)
|
||||
return JsReplCompilationState(ReentrantReadWriteLock(), dependencyLoader.loadNames(), dependencies, replState, SymbolTable(signaturer))
|
||||
return JsReplCompilationState(ReentrantReadWriteLock(), dependencyLoader.loadNames(), dependencies, replState, createSymbolTable())
|
||||
}
|
||||
|
||||
private fun createSymbolTable(): SymbolTable =
|
||||
SymbolTable(IdSignatureDescriptor(JsManglerDesc), IrFactoryImpl)
|
||||
|
||||
override fun createEvaluationState(): JsEvaluationState {
|
||||
val state = JsEvaluationState(ReentrantReadWriteLock(), ScriptEngineNashorn())
|
||||
JsReplEvaluator().eval(state, createCompileResult(dependencyLoader.loadScriptDependencyBinary()))
|
||||
|
||||
+2
-3
@@ -9,6 +9,7 @@ import com.intellij.openapi.util.Disposer
|
||||
import org.jetbrains.kotlin.backend.common.serialization.signature.IdSignatureDescriptor
|
||||
import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerDesc
|
||||
import org.jetbrains.kotlin.ir.backend.js.utils.NameTables
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.js.engine.ScriptEngineNashorn
|
||||
import org.jetbrains.kotlin.scripting.compiler.plugin.repl.ReplCodeAnalyzerBase
|
||||
@@ -21,9 +22,7 @@ class JsReplTestAgainstKlib : AbstractJsReplTest() {
|
||||
|
||||
override fun createCompilationState(): JsReplCompilationState {
|
||||
val nameTables = NameTables(emptyList())
|
||||
val mangler = JsManglerDesc
|
||||
val signaturer = IdSignatureDescriptor(mangler)
|
||||
val symbolTable = SymbolTable(signaturer)
|
||||
val symbolTable = SymbolTable(IdSignatureDescriptor(JsManglerDesc), IrFactoryImpl)
|
||||
val dependencyCompiler = JsScriptDependencyCompiler(environment.configuration, nameTables, symbolTable)
|
||||
val dependencies = readLibrariesFromConfiguration(environment.configuration)
|
||||
dependencyCode = dependencyCompiler.compile(dependencies)
|
||||
|
||||
Reference in New Issue
Block a user