Get rid of deprecated asm remapping api
#KT-27774 In Progress
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
package org.jetbrains.kotlin.codegen.inline
|
||||
|
||||
import org.jetbrains.org.objectweb.asm.commons.Remapper
|
||||
import org.jetbrains.org.objectweb.asm.commons.RemappingSignatureAdapter
|
||||
import org.jetbrains.org.objectweb.asm.commons.SignatureRemapper
|
||||
import org.jetbrains.org.objectweb.asm.signature.SignatureReader
|
||||
import org.jetbrains.org.objectweb.asm.signature.SignatureVisitor
|
||||
|
||||
@@ -26,8 +26,8 @@ class AsmTypeRemapper(val typeRemapper: TypeRemapper, val result: InlineResult)
|
||||
return typeRemapper.map(type)
|
||||
}
|
||||
|
||||
override fun createRemappingSignatureAdapter(v: SignatureVisitor?): SignatureVisitor {
|
||||
return object : RemappingSignatureAdapter(v, this) {
|
||||
override fun createSignatureRemapper(v: SignatureVisitor?): SignatureVisitor {
|
||||
return object : SignatureRemapper(v, this) {
|
||||
override fun visitTypeVariable(name: String) {
|
||||
/*TODO try to erase absent type variable*/
|
||||
val mapping = typeRemapper.mapTypeParameter(name) ?: return super.visitTypeVariable(name)
|
||||
|
||||
@@ -36,7 +36,8 @@ import org.jetbrains.org.objectweb.asm.MethodVisitor
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||
import org.jetbrains.org.objectweb.asm.commons.RemappingMethodAdapter
|
||||
import org.jetbrains.org.objectweb.asm.commons.LocalVariablesSorter
|
||||
import org.jetbrains.org.objectweb.asm.commons.MethodRemapper
|
||||
import org.jetbrains.org.objectweb.asm.tree.*
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.*
|
||||
import org.jetbrains.org.objectweb.asm.util.Printer
|
||||
@@ -147,11 +148,15 @@ class MethodInliner(
|
||||
val iterator = transformations.iterator()
|
||||
|
||||
val remapper = TypeRemapper.createFrom(currentTypeMapping)
|
||||
val remappingMethodAdapter = RemappingMethodAdapter(
|
||||
|
||||
// MethodRemapper doesn't extends LocalVariablesSorter, but RemappingMethodAdapter does.
|
||||
// So wrapping with LocalVariablesSorter to keep old behavior
|
||||
val remappingMethodAdapter = MethodRemapper(
|
||||
LocalVariablesSorter(
|
||||
resultNode.access,
|
||||
resultNode.desc,
|
||||
resultNode,
|
||||
AsmTypeRemapper(remapper, result)
|
||||
resultNode
|
||||
), AsmTypeRemapper(remapper, result)
|
||||
)
|
||||
|
||||
val markerShift = calcMarkerShift(parameters, node)
|
||||
|
||||
Reference in New Issue
Block a user