Make project compilable after types enhancement
This commit is contained in:
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
||||
import org.jetbrains.kotlin.types.JetType
|
||||
import java.util.*
|
||||
|
||||
public class AccessorForConstructorDescriptor(
|
||||
@@ -38,6 +39,8 @@ public class AccessorForConstructorDescriptor(
|
||||
|
||||
override fun isPrimary(): Boolean = false
|
||||
|
||||
override fun getReturnType(): JetType = super<AbstractAccessorForFunctionDescriptor>.getReturnType()!!
|
||||
|
||||
init {
|
||||
initialize(
|
||||
DescriptorUtils.getReceiverParameterType(getExtensionReceiverParameter()),
|
||||
|
||||
@@ -49,7 +49,7 @@ open class BranchedValue(
|
||||
open fun condJump(jumpLabel: Label, v: InstructionAdapter, jumpIfFalse: Boolean) {
|
||||
if (arg1 is CondJump) arg1.condJump(jumpLabel, v, jumpIfFalse) else arg1.put(operandType, v)
|
||||
arg2?.put(operandType, v)
|
||||
v.visitJumpInsn(patchOpcode(if (jumpIfFalse) opcode else negatedOperations[opcode], v), jumpLabel);
|
||||
v.visitJumpInsn(patchOpcode(if (jumpIfFalse) opcode else negatedOperations[opcode]!!, v), jumpLabel);
|
||||
}
|
||||
|
||||
open fun loopJump(jumpLabel: Label, v: InstructionAdapter, jumpIfFalse: Boolean) {
|
||||
|
||||
@@ -284,7 +284,7 @@ class RawFileMapping(val name: String, val path: String) {
|
||||
if (rangeMappings.isNotEmpty() && isLastMapped && couldFoldInRange(lastMappedWithNewIndex, source)) {
|
||||
rangeMapping = rangeMappings.last()
|
||||
rangeMapping.range += source - lastMappedWithNewIndex
|
||||
dest = lineMappings[lastMappedWithNewIndex] + source - lastMappedWithNewIndex
|
||||
dest = lineMappings[lastMappedWithNewIndex]!! + source - lastMappedWithNewIndex
|
||||
}
|
||||
else {
|
||||
dest = currentIndex + 1
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ public object LabelNormalizationMethodTransformer : MethodTransformer() {
|
||||
}
|
||||
|
||||
private fun isRemoved(labelNode: LabelNode): Boolean = removedLabelNodes.contains(labelNode)
|
||||
private fun getNew(oldLabelNode: LabelNode): LabelNode = newLabelNodes[oldLabelNode]
|
||||
private fun getNew(oldLabelNode: LabelNode): LabelNode = newLabelNodes[oldLabelNode]!!
|
||||
}
|
||||
|
||||
private fun InsnList.replaceNodeGetNext(oldNode: AbstractInsnNode, newNode: AbstractInsnNode): AbstractInsnNode? {
|
||||
|
||||
+3
-3
@@ -134,19 +134,19 @@ public class FixStackAnalyzer(
|
||||
val returnValue = pop()
|
||||
clearStack()
|
||||
val savedValues = savedStacks[beforeInlineMarker]
|
||||
pushAll(savedValues)
|
||||
pushAll(savedValues!!)
|
||||
push(returnValue)
|
||||
}
|
||||
else {
|
||||
val savedValues = savedStacks[beforeInlineMarker]
|
||||
pushAll(savedValues)
|
||||
pushAll(savedValues!!)
|
||||
}
|
||||
}
|
||||
|
||||
private fun FixStackFrame.executeRestoreStackInTryCatch(insn: AbstractInsnNode) {
|
||||
val saveNode = context.saveStackMarkerForRestoreMarker[insn]
|
||||
val savedValues = savedStacks.getOrElse(saveNode) {
|
||||
throw AssertionError("${indexOf(insn)}: Restore stack is unavailable for ${indexOf(saveNode)}")
|
||||
throw AssertionError("${indexOf(insn)}: Restore stack is unavailable for ${indexOf(saveNode!!)}")
|
||||
}
|
||||
pushAll(savedValues)
|
||||
}
|
||||
|
||||
+6
-6
@@ -39,7 +39,7 @@ internal class LocalVariablesManager(val context: FixStackContext, val methodNod
|
||||
}
|
||||
|
||||
fun allocateVariablesForSaveStackMarker(saveStackMarker: AbstractInsnNode, savedStackValues: List<BasicValue>): SavedStackDescriptor {
|
||||
val numRestoreStackMarkers = context.restoreStackMarkersForSaveMarker[saveStackMarker].size()
|
||||
val numRestoreStackMarkers = context.restoreStackMarkersForSaveMarker[saveStackMarker]!!.size()
|
||||
return allocateNewHandle(numRestoreStackMarkers, saveStackMarker, savedStackValues)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ internal class LocalVariablesManager(val context: FixStackContext, val methodNod
|
||||
|
||||
fun getSavedStackDescriptorOrNull(restoreStackMarker: AbstractInsnNode): SavedStackDescriptor {
|
||||
val saveStackMarker = context.saveStackMarkerForRestoreMarker[restoreStackMarker]
|
||||
return allocatedHandles[saveStackMarker].savedStackDescriptor
|
||||
return allocatedHandles[saveStackMarker]!!.savedStackDescriptor
|
||||
}
|
||||
|
||||
private fun getFirstUnusedLocalVariableIndex(): Int =
|
||||
@@ -64,7 +64,7 @@ internal class LocalVariablesManager(val context: FixStackContext, val methodNod
|
||||
|
||||
fun markRestoreStackMarkerEmitted(restoreStackMarker: AbstractInsnNode) {
|
||||
val saveStackMarker = context.saveStackMarkerForRestoreMarker[restoreStackMarker]
|
||||
markEmitted(saveStackMarker)
|
||||
markEmitted(saveStackMarker!!)
|
||||
}
|
||||
|
||||
fun allocateVariablesForBeforeInlineMarker(beforeInlineMarker: AbstractInsnNode, savedStackValues: List<BasicValue>): SavedStackDescriptor {
|
||||
@@ -73,16 +73,16 @@ internal class LocalVariablesManager(val context: FixStackContext, val methodNod
|
||||
|
||||
fun getBeforeInlineDescriptor(afterInlineMarker: AbstractInsnNode): SavedStackDescriptor {
|
||||
val beforeInlineMarker = context.openingInlineMethodMarker[afterInlineMarker]
|
||||
return allocatedHandles[beforeInlineMarker].savedStackDescriptor
|
||||
return allocatedHandles[beforeInlineMarker]!!.savedStackDescriptor
|
||||
}
|
||||
|
||||
fun markAfterInlineMarkerEmitted(afterInlineMarker: AbstractInsnNode) {
|
||||
val beforeInlineMarker = context.openingInlineMethodMarker[afterInlineMarker]
|
||||
markEmitted(beforeInlineMarker)
|
||||
markEmitted(beforeInlineMarker!!)
|
||||
}
|
||||
|
||||
private fun markEmitted(saveStackMarker: AbstractInsnNode) {
|
||||
val allocatedHandle = allocatedHandles[saveStackMarker]
|
||||
val allocatedHandle = allocatedHandles[saveStackMarker]!!
|
||||
allocatedHandle.markRestoreNodeEmitted()
|
||||
if (allocatedHandle.isFullyEmitted()) {
|
||||
allocatedHandles.remove(saveStackMarker)
|
||||
|
||||
Reference in New Issue
Block a user