Add support for contract feature in inliner
This commit is contained in:
@@ -68,7 +68,7 @@ open class FieldRemapper(
|
|||||||
|
|
||||||
val insnNode = capturedFieldAccess[currentInstruction] as FieldInsnNode
|
val insnNode = capturedFieldAccess[currentInstruction] as FieldInsnNode
|
||||||
if (canProcess(insnNode.owner, insnNode.name, true)) {
|
if (canProcess(insnNode.owner, insnNode.name, true)) {
|
||||||
insnNode.name = CAPTURED_FIELD_FOLD_PREFIX + getFieldNameForFolding(insnNode)
|
insnNode.name = Companion.foldName(getFieldNameForFolding(insnNode))
|
||||||
insnNode.opcode = Opcodes.GETSTATIC
|
insnNode.opcode = Opcodes.GETSTATIC
|
||||||
|
|
||||||
node.remove(InsnSequence(capturedFieldAccess[0], insnNode))
|
node.remove(InsnSequence(capturedFieldAccess[0], insnNode))
|
||||||
@@ -95,4 +95,9 @@ open class FieldRemapper(
|
|||||||
|
|
||||||
open fun getFieldForInline(node: FieldInsnNode, prefix: StackValue?): StackValue? =
|
open fun getFieldForInline(node: FieldInsnNode, prefix: StackValue?): StackValue? =
|
||||||
MethodInliner.findCapturedField(node, this).remapValue
|
MethodInliner.findCapturedField(node, this).remapValue
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun foldName(fieldName: String) =
|
||||||
|
CAPTURED_FIELD_FOLD_PREFIX + fieldName
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.codegen.optimization.ApiVersionCallsPreprocessingMet
|
|||||||
import org.jetbrains.kotlin.codegen.optimization.FixStackWithLabelNormalizationMethodTransformer
|
import org.jetbrains.kotlin.codegen.optimization.FixStackWithLabelNormalizationMethodTransformer
|
||||||
import org.jetbrains.kotlin.codegen.optimization.common.InsnSequence
|
import org.jetbrains.kotlin.codegen.optimization.common.InsnSequence
|
||||||
import org.jetbrains.kotlin.codegen.optimization.common.isMeaningful
|
import org.jetbrains.kotlin.codegen.optimization.common.isMeaningful
|
||||||
|
import org.jetbrains.kotlin.codegen.optimization.fixStack.peek
|
||||||
import org.jetbrains.kotlin.codegen.optimization.fixStack.top
|
import org.jetbrains.kotlin.codegen.optimization.fixStack.top
|
||||||
import org.jetbrains.kotlin.utils.SmartList
|
import org.jetbrains.kotlin.utils.SmartList
|
||||||
import org.jetbrains.kotlin.utils.SmartSet
|
import org.jetbrains.kotlin.utils.SmartSet
|
||||||
@@ -410,85 +411,111 @@ class MethodInliner(
|
|||||||
val frame = sources[instructions.indexOf(cur)]
|
val frame = sources[instructions.indexOf(cur)]
|
||||||
|
|
||||||
if (frame != null) {
|
if (frame != null) {
|
||||||
if (ReifiedTypeInliner.isNeedClassReificationMarker(cur)) {
|
when {
|
||||||
awaitClassReification = true
|
ReifiedTypeInliner.isNeedClassReificationMarker(cur) -> awaitClassReification = true
|
||||||
}
|
|
||||||
else if (cur is MethodInsnNode) {
|
|
||||||
if (isFinallyStart(cur)) {
|
|
||||||
//TODO deep index calc could be more precise
|
|
||||||
currentFinallyDeep = getConstant(cur.previous)
|
|
||||||
}
|
|
||||||
|
|
||||||
val owner = cur.owner
|
cur is MethodInsnNode -> {
|
||||||
val name = cur.name
|
if (isFinallyStart(cur)) {
|
||||||
//TODO check closure
|
//TODO deep index calc could be more precise
|
||||||
val argTypes = Type.getArgumentTypes(cur.desc)
|
currentFinallyDeep = getConstant(cur.previous)
|
||||||
val paramCount = argTypes.size + 1//non static
|
|
||||||
val firstParameterIndex = frame.stackSize - paramCount
|
|
||||||
if (isInvokeOnLambda(owner, name) /*&& methodInsnNode.owner.equals(INLINE_RUNTIME)*/) {
|
|
||||||
val sourceValue = frame.getStack(firstParameterIndex)
|
|
||||||
val lambdaInfo = getLambdaIfExistsAndMarkInstructions(sourceValue, true, instructions, sources, toDelete)
|
|
||||||
invokeCalls.add(InvokeCall(lambdaInfo, currentFinallyDeep))
|
|
||||||
}
|
|
||||||
else if (isSamWrapperConstructorCall(owner, name)) {
|
|
||||||
transformations.add(SamWrapperTransformationInfo(owner, inliningContext, isAlreadyRegenerated(owner)))
|
|
||||||
}
|
|
||||||
else if (isAnonymousConstructorCall(owner, name)) {
|
|
||||||
val lambdaMapping = HashMap<Int, LambdaInfo>()
|
|
||||||
|
|
||||||
var offset = 0
|
|
||||||
var capturesAnonymousObjectThatMustBeRegenerated = false
|
|
||||||
for (i in 0 until paramCount) {
|
|
||||||
val sourceValue = frame.getStack(firstParameterIndex + i)
|
|
||||||
val lambdaInfo = getLambdaIfExistsAndMarkInstructions(sourceValue, false, instructions, sources, toDelete
|
|
||||||
)
|
|
||||||
if (lambdaInfo != null) {
|
|
||||||
lambdaMapping.put(offset, lambdaInfo)
|
|
||||||
}
|
|
||||||
else if (i < argTypes.size && isAnonymousClassThatMustBeRegenerated(argTypes[i])) {
|
|
||||||
capturesAnonymousObjectThatMustBeRegenerated = true
|
|
||||||
}
|
|
||||||
|
|
||||||
offset += if (i == 0) 1 else argTypes[i - 1].size
|
|
||||||
}
|
}
|
||||||
|
|
||||||
transformations.add(
|
val owner = cur.owner
|
||||||
buildConstructorInvocation(
|
val name = cur.name
|
||||||
owner, cur.desc, lambdaMapping, awaitClassReification, capturesAnonymousObjectThatMustBeRegenerated
|
//TODO check closure
|
||||||
|
val argTypes = Type.getArgumentTypes(cur.desc)
|
||||||
|
val paramCount = argTypes.size + 1//non static
|
||||||
|
val firstParameterIndex = frame.stackSize - paramCount
|
||||||
|
if (isInvokeOnLambda(owner, name) /*&& methodInsnNode.owner.equals(INLINE_RUNTIME)*/) {
|
||||||
|
val sourceValue = frame.getStack(firstParameterIndex)
|
||||||
|
val lambdaInfo = getLambdaIfExistsAndMarkInstructions(sourceValue, true, instructions, sources, toDelete)
|
||||||
|
invokeCalls.add(InvokeCall(lambdaInfo, currentFinallyDeep))
|
||||||
|
}
|
||||||
|
else if (isSamWrapperConstructorCall(owner, name)) {
|
||||||
|
transformations.add(SamWrapperTransformationInfo(owner, inliningContext, isAlreadyRegenerated(owner)))
|
||||||
|
}
|
||||||
|
else if (isAnonymousConstructorCall(owner, name)) {
|
||||||
|
val lambdaMapping = HashMap<Int, LambdaInfo>()
|
||||||
|
|
||||||
|
var offset = 0
|
||||||
|
var capturesAnonymousObjectThatMustBeRegenerated = false
|
||||||
|
for (i in 0 until paramCount) {
|
||||||
|
val sourceValue = frame.getStack(firstParameterIndex + i)
|
||||||
|
val lambdaInfo = getLambdaIfExistsAndMarkInstructions(sourceValue, false, instructions, sources, toDelete
|
||||||
)
|
)
|
||||||
)
|
if (lambdaInfo != null) {
|
||||||
awaitClassReification = false
|
lambdaMapping.put(offset, lambdaInfo)
|
||||||
|
}
|
||||||
|
else if (i < argTypes.size && isAnonymousClassThatMustBeRegenerated(argTypes[i])) {
|
||||||
|
capturesAnonymousObjectThatMustBeRegenerated = true
|
||||||
|
}
|
||||||
|
|
||||||
|
offset += if (i == 0) 1 else argTypes[i - 1].size
|
||||||
|
}
|
||||||
|
|
||||||
|
transformations.add(
|
||||||
|
buildConstructorInvocation(
|
||||||
|
owner, cur.desc, lambdaMapping, awaitClassReification, capturesAnonymousObjectThatMustBeRegenerated
|
||||||
|
)
|
||||||
|
)
|
||||||
|
awaitClassReification = false
|
||||||
|
}
|
||||||
|
else if (inliningContext.isInliningLambda && ReifiedTypeInliner.isOperationReifiedMarker(cur)) {
|
||||||
|
val reificationArgument = cur.reificationArgument
|
||||||
|
val parameterName = reificationArgument!!.parameterName
|
||||||
|
result.reifiedTypeParametersUsages.addUsedReifiedParameter(parameterName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (inliningContext.isInliningLambda && ReifiedTypeInliner.isOperationReifiedMarker(cur)) {
|
|
||||||
val reificationArgument = cur.reificationArgument
|
cur.opcode == Opcodes.GETSTATIC -> {
|
||||||
val parameterName = reificationArgument!!.parameterName
|
val fieldInsnNode = cur as FieldInsnNode?
|
||||||
result.reifiedTypeParametersUsages.addUsedReifiedParameter(parameterName)
|
val className = fieldInsnNode!!.owner
|
||||||
|
if (isAnonymousSingletonLoad(className, fieldInsnNode.name)) {
|
||||||
|
transformations.add(
|
||||||
|
AnonymousObjectTransformationInfo(
|
||||||
|
className, awaitClassReification, isAlreadyRegenerated(className), true,
|
||||||
|
inliningContext.nameGenerator
|
||||||
|
)
|
||||||
|
)
|
||||||
|
awaitClassReification = false
|
||||||
|
}
|
||||||
|
else if (isWhenMappingAccess(className, fieldInsnNode.name)) {
|
||||||
|
transformations.add(
|
||||||
|
WhenMappingTransformationInfo(
|
||||||
|
className, inliningContext.nameGenerator, isAlreadyRegenerated(className), fieldInsnNode
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (cur.opcode == Opcodes.GETSTATIC) {
|
cur.opcode == Opcodes.POP -> getLambdaIfExistsAndMarkInstructions(frame.top()!!, true, instructions, sources, toDelete)?.let {
|
||||||
val fieldInsnNode = cur as FieldInsnNode?
|
|
||||||
val className = fieldInsnNode!!.owner
|
|
||||||
if (isAnonymousSingletonLoad(className, fieldInsnNode.name)) {
|
|
||||||
transformations.add(
|
|
||||||
AnonymousObjectTransformationInfo(
|
|
||||||
className, awaitClassReification, isAlreadyRegenerated(className), true,
|
|
||||||
inliningContext.nameGenerator
|
|
||||||
)
|
|
||||||
)
|
|
||||||
awaitClassReification = false
|
|
||||||
}
|
|
||||||
else if (isWhenMappingAccess(className, fieldInsnNode.name)) {
|
|
||||||
transformations.add(
|
|
||||||
WhenMappingTransformationInfo(
|
|
||||||
className, inliningContext.nameGenerator, isAlreadyRegenerated(className), fieldInsnNode
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (cur.opcode == Opcodes.POP) {
|
|
||||||
getLambdaIfExistsAndMarkInstructions(frame.top()!!, true, instructions, sources, toDelete)?.let {
|
|
||||||
toDelete.add(cur)
|
toDelete.add(cur)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur.opcode == Opcodes.PUTFIELD -> {
|
||||||
|
//Recognize next contract's pattern in inline lambda
|
||||||
|
// ALOAD 0
|
||||||
|
// SOME_VALUE
|
||||||
|
// PUTFIELD $capturedField
|
||||||
|
// and transform it to
|
||||||
|
// SOME_VALUE
|
||||||
|
// PUTSTATIC $$$$capturedField
|
||||||
|
val fieldInsn = cur as FieldInsnNode
|
||||||
|
if (isCapturedFieldName(fieldInsn.name) &&
|
||||||
|
nodeRemapper is InlinedLambdaRemapper &&
|
||||||
|
nodeRemapper.originalLambdaInternalName == fieldInsn.owner) {
|
||||||
|
val stackTransformations = mutableSetOf<AbstractInsnNode>()
|
||||||
|
val lambdaInfo = getLambdaIfExistsAndMarkInstructions(frame.peek(1)!!, false, instructions, sources, stackTransformations)
|
||||||
|
if (lambdaInfo != null && stackTransformations.all { it is VarInsnNode }) {
|
||||||
|
assert(lambdaInfo.lambdaClassType.internalName == nodeRemapper.originalLambdaInternalName) {
|
||||||
|
"Wrong bytecode template for contract template: ${lambdaInfo.lambdaClassType.internalName} != ${nodeRemapper.originalLambdaInternalName}"
|
||||||
|
}
|
||||||
|
fieldInsn.name = FieldRemapper.foldName(fieldInsn.name)
|
||||||
|
fieldInsn.opcode = Opcodes.PUTSTATIC
|
||||||
|
toDelete.addAll(stackTransformations)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// !LANGUAGE: +CallsInPlaceEffect
|
||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlin.internal.contracts.*
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||||
|
public inline fun <R> myrun(block: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun cond() = true
|
||||||
|
fun test(s: String) = s
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val x: String
|
||||||
|
myrun {
|
||||||
|
x = if (cond()) test("OK") else test("fail")
|
||||||
|
}
|
||||||
|
return x
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
// !LANGUAGE: +CallsInPlaceEffect
|
||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlin.internal.contracts.*
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||||
|
public inline fun <R> myrun(block: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun test(s: String) = s
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val x: String
|
||||||
|
myrun {
|
||||||
|
x = try { test("OK") } catch (e: Exception) { test("fail") }
|
||||||
|
}
|
||||||
|
return x
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
// !LANGUAGE: +CallsInPlaceEffect
|
||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlin.internal.contracts.*
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||||
|
public inline fun <R> myrun(block: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val x: Long
|
||||||
|
myrun {
|
||||||
|
x = 42L
|
||||||
|
}
|
||||||
|
return if (x.inc() == 43L) "OK" else "Fail: ${x.inc()}"
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
// !LANGUAGE: +CallsInPlaceEffect
|
||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlin.internal.contracts.*
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||||
|
public inline fun <R> myrun(block: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val x: Int
|
||||||
|
myrun {
|
||||||
|
myrun {
|
||||||
|
x = 42
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return if (x.inc() == 43) "OK" else "Fail: ${x.inc()}"
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// !LANGUAGE: +CallsInPlaceEffect
|
||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlin.internal.contracts.*
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||||
|
public inline fun <R> myrun(block: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val x: Int
|
||||||
|
myrun {
|
||||||
|
x = 42
|
||||||
|
}
|
||||||
|
return if (x.inc() == 43) "OK" else "Fail: ${x.inc()}"
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// !LANGUAGE: +CallsInPlaceEffect
|
||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlin.internal.contracts.*
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||||
|
public inline fun <R> myrun(block: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val x: Long
|
||||||
|
myrun {
|
||||||
|
x = 42L
|
||||||
|
if (x == 42L) return "OK"
|
||||||
|
}
|
||||||
|
return "fail"
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
// !LANGUAGE: +CallsInPlaceEffect
|
||||||
|
// WITH_RUNTIME
|
||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlin.internal.contracts.*
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||||
|
public inline fun <R> myrun(block: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun test(xs: List<String>): String {
|
||||||
|
var result = ""
|
||||||
|
|
||||||
|
myrun L@ {
|
||||||
|
for (x in xs) {
|
||||||
|
val y: String
|
||||||
|
myrun {
|
||||||
|
y = x
|
||||||
|
if (y.length > 1) return@L
|
||||||
|
}
|
||||||
|
result += y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return test(listOf("O", "K", "fail"))
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
// !LANGUAGE: +CallsInPlaceEffect
|
||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlin.internal.contracts.*
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||||
|
public inline fun <R> myrun(block: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
class A {
|
||||||
|
val z: String
|
||||||
|
init {
|
||||||
|
myrun {
|
||||||
|
z = "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return A().z
|
||||||
|
}
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// !LANGUAGE: +CallsInPlaceEffect
|
||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlin.internal.contracts.*
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||||
|
public inline fun <R> myrun(block: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return block()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
// NO_CHECK_LAMBDA_INLINING
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val x: Int
|
||||||
|
val res = myrun {
|
||||||
|
x = 42
|
||||||
|
{
|
||||||
|
x
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
return if (res == 42 && x.inc() == 43) "OK" else "Fail: ${x.inc()}"
|
||||||
|
}
|
||||||
+63
@@ -1017,6 +1017,69 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/boxInline/contracts")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class Contracts extends AbstractIrBlackBoxInlineCodegenTest {
|
||||||
|
public void testAllFilesPresentInContracts() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("complexInitializer.kt")
|
||||||
|
public void testComplexInitializer() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("complexInitializerWithStackTransformation.kt")
|
||||||
|
public void testComplexInitializerWithStackTransformation() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteLongValInitialization.kt")
|
||||||
|
public void testDefiniteLongValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteNestedValInitialization.kt")
|
||||||
|
public void testDefiniteNestedValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteValInitialization.kt")
|
||||||
|
public void testDefiniteValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nonLocalReturn.kt")
|
||||||
|
public void testNonLocalReturn() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nonLocalReturnWithCycle.kt")
|
||||||
|
public void testNonLocalReturnWithCycle() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/nonLocalReturnWithCycle.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyInitialization.kt")
|
||||||
|
public void testPropertyInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valInitializationAndUsageInNestedLambda.kt")
|
||||||
|
public void testValInitializationAndUsageInNestedLambda() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/valInitializationAndUsageInNestedLambda.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/boxInline/defaultValues")
|
@TestMetadata("compiler/testData/codegen/boxInline/defaultValues")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
+63
@@ -1017,6 +1017,69 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/boxInline/contracts")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class Contracts extends AbstractIrCompileKotlinAgainstInlineKotlinTest {
|
||||||
|
public void testAllFilesPresentInContracts() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("complexInitializer.kt")
|
||||||
|
public void testComplexInitializer() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("complexInitializerWithStackTransformation.kt")
|
||||||
|
public void testComplexInitializerWithStackTransformation() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteLongValInitialization.kt")
|
||||||
|
public void testDefiniteLongValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteNestedValInitialization.kt")
|
||||||
|
public void testDefiniteNestedValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteValInitialization.kt")
|
||||||
|
public void testDefiniteValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nonLocalReturn.kt")
|
||||||
|
public void testNonLocalReturn() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nonLocalReturnWithCycle.kt")
|
||||||
|
public void testNonLocalReturnWithCycle() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/nonLocalReturnWithCycle.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyInitialization.kt")
|
||||||
|
public void testPropertyInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valInitializationAndUsageInNestedLambda.kt")
|
||||||
|
public void testValInitializationAndUsageInNestedLambda() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/valInitializationAndUsageInNestedLambda.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/boxInline/defaultValues")
|
@TestMetadata("compiler/testData/codegen/boxInline/defaultValues")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
@@ -1017,6 +1017,69 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/boxInline/contracts")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class Contracts extends AbstractBlackBoxInlineCodegenTest {
|
||||||
|
public void testAllFilesPresentInContracts() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("complexInitializer.kt")
|
||||||
|
public void testComplexInitializer() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("complexInitializerWithStackTransformation.kt")
|
||||||
|
public void testComplexInitializerWithStackTransformation() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteLongValInitialization.kt")
|
||||||
|
public void testDefiniteLongValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteNestedValInitialization.kt")
|
||||||
|
public void testDefiniteNestedValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteValInitialization.kt")
|
||||||
|
public void testDefiniteValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nonLocalReturn.kt")
|
||||||
|
public void testNonLocalReturn() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nonLocalReturnWithCycle.kt")
|
||||||
|
public void testNonLocalReturnWithCycle() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/nonLocalReturnWithCycle.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyInitialization.kt")
|
||||||
|
public void testPropertyInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valInitializationAndUsageInNestedLambda.kt")
|
||||||
|
public void testValInitializationAndUsageInNestedLambda() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/valInitializationAndUsageInNestedLambda.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/boxInline/defaultValues")
|
@TestMetadata("compiler/testData/codegen/boxInline/defaultValues")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
+63
@@ -1017,6 +1017,69 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/boxInline/contracts")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class Contracts extends AbstractCompileKotlinAgainstInlineKotlinTest {
|
||||||
|
public void testAllFilesPresentInContracts() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("complexInitializer.kt")
|
||||||
|
public void testComplexInitializer() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("complexInitializerWithStackTransformation.kt")
|
||||||
|
public void testComplexInitializerWithStackTransformation() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteLongValInitialization.kt")
|
||||||
|
public void testDefiniteLongValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteNestedValInitialization.kt")
|
||||||
|
public void testDefiniteNestedValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("definiteValInitialization.kt")
|
||||||
|
public void testDefiniteValInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nonLocalReturn.kt")
|
||||||
|
public void testNonLocalReturn() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nonLocalReturnWithCycle.kt")
|
||||||
|
public void testNonLocalReturnWithCycle() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/nonLocalReturnWithCycle.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertyInitialization.kt")
|
||||||
|
public void testPropertyInitialization() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valInitializationAndUsageInNestedLambda.kt")
|
||||||
|
public void testValInitializationAndUsageInNestedLambda() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/contracts/valInitializationAndUsageInNestedLambda.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/boxInline/defaultValues")
|
@TestMetadata("compiler/testData/codegen/boxInline/defaultValues")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user