[KLIB] Implement new linker based on IdSignature
- Remove klib dependency on metadata and uniqID - Refactored proto format to make it more effective and compact -- Use special encoding for some types of data (coordinates, flags, types) -- Remove symbols table -- Use packed proto list if it is possible - Remove extension from metadata - Remove special ids for function interfaces - Fix klib IO - Fix incremental cache - General code clean up
This commit is contained in:
+8
-2
@@ -5,6 +5,8 @@
|
||||
|
||||
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.util.SymbolTable
|
||||
import org.jetbrains.kotlin.js.engine.ScriptEngineNashorn
|
||||
@@ -21,7 +23,9 @@ class JsReplTestAgainstBinaries : AbstractJsReplTest() {
|
||||
|
||||
init {
|
||||
val nameTable = NameTables(emptyList())
|
||||
val compiler = JsScriptDependencyCompiler(environment.configuration, nameTable, SymbolTable())
|
||||
val mangler = JsManglerDesc
|
||||
val signaturer = IdSignatureDescriptor(mangler)
|
||||
val compiler = JsScriptDependencyCompiler(environment.configuration, nameTable, SymbolTable(signaturer))
|
||||
val runtimeBinary = compiler.compile(dependencies)
|
||||
|
||||
dependencyLoader.saveScriptDependencyBinary(runtimeBinary)
|
||||
@@ -30,7 +34,9 @@ class JsReplTestAgainstBinaries : AbstractJsReplTest() {
|
||||
|
||||
override fun createCompilationState(): JsReplCompilationState {
|
||||
val replState = ReplCodeAnalyzer.ResettableAnalyzerState()
|
||||
return JsReplCompilationState(ReentrantReadWriteLock(), dependencyLoader.loadNames(), dependencies, replState, SymbolTable())
|
||||
val mangler = JsManglerDesc
|
||||
val signaturer = IdSignatureDescriptor(mangler)
|
||||
return JsReplCompilationState(ReentrantReadWriteLock(), dependencyLoader.loadNames(), dependencies, replState, SymbolTable(signaturer))
|
||||
}
|
||||
|
||||
override fun createEvaluationState(): JsEvaluationState {
|
||||
|
||||
+5
-1
@@ -6,6 +6,8 @@
|
||||
package org.jetbrains.kotlin.scripting.repl.js.test
|
||||
|
||||
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.util.SymbolTable
|
||||
import org.jetbrains.kotlin.js.engine.ScriptEngineNashorn
|
||||
@@ -19,7 +21,9 @@ class JsReplTestAgainstKlib : AbstractJsReplTest() {
|
||||
|
||||
override fun createCompilationState(): JsReplCompilationState {
|
||||
val nameTables = NameTables(emptyList())
|
||||
val symbolTable = SymbolTable()
|
||||
val mangler = JsManglerDesc
|
||||
val signaturer = IdSignatureDescriptor(mangler)
|
||||
val symbolTable = SymbolTable(signaturer)
|
||||
val dependencyCompiler = JsScriptDependencyCompiler(environment.configuration, nameTables, symbolTable)
|
||||
val dependencies = readLibrariesFromConfiguration(environment.configuration)
|
||||
dependencyCode = dependencyCompiler.compile(dependencies)
|
||||
|
||||
Reference in New Issue
Block a user