Move all coroutine-related declarations from built-ins to stdlib

Also move internal declarations from runtime.jvm module into new package
kotlin.coroutines.jvm.internal in stdlib

The necessity of these declarations being in built-ins is controversial,
but also it will complicate the migration of current coroutine runtime
to a separate jar if we ever need this
This commit is contained in:
Denis Zharkov
2017-01-26 12:24:02 +03:00
parent b61c152b4e
commit 0e132b9857
32 changed files with 212 additions and 150 deletions
@@ -20,11 +20,14 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorEquivalenceForOverrides
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.descriptorUtil.module
val SUSPEND_COROUTINE_OR_RETURN_NAME = Name.identifier("suspendCoroutineOrReturn")
val SUSPENDED_MARKER_NAME = Name.identifier("SUSPENDED_MARKER")
val COROUTINES_INTRINSICS_PACKAGE_FQ_NAME = DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("intrinsics"))
fun FunctionDescriptor.isBuiltInSuspendCoroutineOrReturn(): Boolean {
if (name != SUSPEND_COROUTINE_OR_RETURN_NAME) return false
@@ -36,6 +39,6 @@ fun FunctionDescriptor.isBuiltInSuspendCoroutineOrReturn(): Boolean {
}
fun FunctionDescriptor.getBuiltInSuspendCoroutineOrReturn() =
builtIns.builtInsCoroutineIntrinsicsPackageFragment.getMemberScope()
module.getPackage(COROUTINES_INTRINSICS_PACKAGE_FQ_NAME).memberScope
.getContributedFunctions(SUSPEND_COROUTINE_OR_RETURN_NAME, NoLookupLocation.FROM_BACKEND)
.singleOrNull()
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.codegen.binding.CalculatedClosure;
import org.jetbrains.kotlin.codegen.context.ClosureContext;
import org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenUtilKt;
import org.jetbrains.kotlin.codegen.inline.InlineCodegenUtil;
import org.jetbrains.kotlin.codegen.serialization.JvmSerializerExtension;
import org.jetbrains.kotlin.codegen.signature.BothSignatureWriter;
@@ -429,7 +430,8 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
iv.load(0, superClassAsmType);
String superClassConstructorDescriptor;
if (superClassAsmType.equals(LAMBDA) || superClassAsmType.equals(FUNCTION_REFERENCE) || superClassAsmType.equals(COROUTINE_IMPL)) {
if (superClassAsmType.equals(LAMBDA) || superClassAsmType.equals(FUNCTION_REFERENCE) ||
superClassAsmType.equals(CoroutineCodegenUtilKt.COROUTINE_IMPL_ASM_TYPE)) {
int arity = calculateArity();
iv.iconst(arity);
if (shouldHaveBoundReferenceReceiver) {
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.DECLARATION
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.FAKE_OVERRIDE
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.MutableClassDescriptor
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithSpecialGenericSignature.getSpecialSignatureInfo
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithSpecialGenericSignature.isBuiltinWithSpecialDescriptorInJvm
import org.jetbrains.kotlin.load.java.descriptors.JavaClassDescriptor
@@ -17,11 +17,13 @@
package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.builtins.createFunctionType
import org.jetbrains.kotlin.codegen.coroutines.COROUTINES_JVM_INTERNAL_PACKAGE_FQ_NAME
import org.jetbrains.kotlin.codegen.coroutines.getOrCreateJvmSuspendFunctionView
import org.jetbrains.kotlin.coroutines.isSuspendLambda
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor
import org.jetbrains.kotlin.descriptors.impl.MutableClassDescriptor
import org.jetbrains.kotlin.descriptors.impl.MutablePackageFragmentDescriptor
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
@@ -31,6 +33,8 @@ import org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils
class JvmRuntimeTypes(module: ModuleDescriptor) {
private val kotlinJvmInternalPackage = MutablePackageFragmentDescriptor(module, FqName("kotlin.jvm.internal"))
private val kotlinCoroutinesJvmInternalPackage =
MutablePackageFragmentDescriptor(module, COROUTINES_JVM_INTERNAL_PACKAGE_FQ_NAME)
private fun klass(name: String) = lazy { createClass(kotlinJvmInternalPackage, name) }
@@ -38,7 +42,7 @@ class JvmRuntimeTypes(module: ModuleDescriptor) {
private val functionReference: ClassDescriptor by klass("FunctionReference")
private val localVariableReference: ClassDescriptor by klass("LocalVariableReference")
private val mutableLocalVariableReference: ClassDescriptor by klass("MutableLocalVariableReference")
private val coroutineImplClass by klass("CoroutineImpl")
private val coroutineImplClass by lazy { createClass(kotlinCoroutinesJvmInternalPackage, "CoroutineImpl") }
private val propertyReferences: List<ClassDescriptor> by lazy {
(0..2).map { i -> createClass(kotlinJvmInternalPackage, "PropertyReference$i") }
@@ -31,6 +31,8 @@ import org.jetbrains.kotlin.diagnostics.rendering.RenderingContext
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithSpecialGenericSignature.SpecialSignatureInfo
import org.jetbrains.kotlin.load.java.JvmAbi
import org.jetbrains.kotlin.load.java.descriptors.JavaCallableMemberDescriptor
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.KtObjectDeclaration
@@ -43,6 +45,7 @@ import org.jetbrains.kotlin.resolve.annotations.hasJvmStaticAnnotation
import org.jetbrains.kotlin.resolve.bindingContextUtil.getDataFlowInfoBefore
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin
import org.jetbrains.kotlin.serialization.deserialization.PLATFORM_DEPENDENT_ANNOTATION_FQ_NAME
@@ -339,3 +342,6 @@ fun MemberDescriptor.isToArrayFromCollection(): Boolean {
return isGenericToArray() || isNonGenericToArray()
}
fun FqName.topLevelClassInternalName() = JvmClassName.byClassId(ClassId(parent(), shortName())).internalName
fun FqName.topLevelClassAsmType(): Type = Type.getObjectType(topLevelClassInternalName())
@@ -27,6 +27,7 @@ import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtDeclarationWithBody
@@ -34,6 +35,7 @@ import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.psi.KtFunction
import org.jetbrains.kotlin.psi.KtFunctionLiteral
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin
import org.jetbrains.kotlin.resolve.jvm.diagnostics.OtherOrigin
@@ -106,11 +108,7 @@ class CoroutineCodegen private constructor(
funDescriptor.createCustomCopy {
setName(Name.identifier(SUSPEND_FUNCTION_CREATE_METHOD_NAME))
setReturnType(
KotlinTypeFactory.simpleNotNullType(
Annotations.EMPTY,
builtIns.continuationClassDescriptor,
listOf(builtIns.unitType.asTypeProjection())
)
funDescriptor.module.getContinuationOfTypeOrAny(builtIns.unitType)
)
setVisibility(Visibilities.PUBLIC)
}
@@ -178,7 +176,7 @@ class CoroutineCodegen private constructor(
v.thisName,
createCoroutineDescriptor.name.identifier,
Type.getMethodDescriptor(
AsmTypes.CONTINUATION,
CONTINUATION_ASM_TYPE,
*parameterTypes.toTypedArray()
),
false
@@ -192,7 +190,7 @@ class CoroutineCodegen private constructor(
override fun generateConstructor(): Method {
val args = calculateConstructorParameters(typeMapper, closure, asmType)
val argTypes = args.map { it.fieldType }.plus(AsmTypes.CONTINUATION).toTypedArray()
val argTypes = args.map { it.fieldType }.plus(CONTINUATION_ASM_TYPE).toTypedArray()
val constructor = Method("<init>", Type.VOID_TYPE, argTypes)
val mv = v.newMethod(
@@ -212,7 +210,7 @@ class CoroutineCodegen private constructor(
iv.iconst(calculateArity())
iv.load(argTypes.map { it.size }.sum(), AsmTypes.OBJECT_TYPE)
val superClassConstructorDescriptor = Type.getMethodDescriptor(Type.VOID_TYPE, Type.INT_TYPE, AsmTypes.CONTINUATION)
val superClassConstructorDescriptor = Type.getMethodDescriptor(Type.VOID_TYPE, Type.INT_TYPE, CONTINUATION_ASM_TYPE)
iv.invokespecial(superClassAsmType.internalName, "<init>", superClassConstructorDescriptor, false)
iv.visitInsn(Opcodes.RETURN)
@@ -107,7 +107,7 @@ class CoroutineTransformerMethodVisitor(
VarInsnNode(Opcodes.ALOAD, 0),
FieldInsnNode(
Opcodes.GETFIELD,
AsmTypes.COROUTINE_IMPL.internalName,
COROUTINE_IMPL_ASM_TYPE.internalName,
COROUTINE_LABEL_FIELD_NAME, Type.INT_TYPE.descriptor
),
TableSwitchInsnNode(0,
@@ -303,7 +303,7 @@ class CoroutineTransformerMethodVisitor(
VarInsnNode(Opcodes.ALOAD, 0),
*withInstructionAdapter { iconst(id) }.toArray(),
FieldInsnNode(
Opcodes.PUTFIELD, AsmTypes.COROUTINE_IMPL.internalName, COROUTINE_LABEL_FIELD_NAME,
Opcodes.PUTFIELD, COROUTINE_IMPL_ASM_TYPE.internalName, COROUTINE_LABEL_FIELD_NAME,
Type.INT_TYPE.descriptor
)
)
@@ -17,16 +17,20 @@
package org.jetbrains.kotlin.codegen.coroutines
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.backend.common.COROUTINES_INTRINSICS_PACKAGE_FQ_NAME
import org.jetbrains.kotlin.backend.common.SUSPENDED_MARKER_NAME
import org.jetbrains.kotlin.backend.common.isBuiltInSuspendCoroutineOrReturn
import org.jetbrains.kotlin.builtins.isBuiltinFunctionalType
import org.jetbrains.kotlin.codegen.StackValue
import org.jetbrains.kotlin.codegen.binding.CodegenBinding
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
import org.jetbrains.kotlin.codegen.topLevelClassAsmType
import org.jetbrains.kotlin.codegen.topLevelClassInternalName
import org.jetbrains.kotlin.coroutines.isSuspendLambda
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.KtPsiFactory
@@ -35,7 +39,9 @@ import org.jetbrains.kotlin.resolve.calls.model.*
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.KotlinTypeFactory
import org.jetbrains.kotlin.types.TypeConstructorSubstitution
import org.jetbrains.kotlin.types.typeUtil.asTypeProjection
@@ -58,7 +64,22 @@ const val COROUTINE_LABEL_FIELD_NAME = "label"
const val SUSPEND_FUNCTION_CREATE_METHOD_NAME = "create"
const val DO_RESUME_METHOD_NAME = "doResume"
private val INTERNAL_COROUTINE_INTRINSICS_OWNER = "kotlin/jvm/internal/CoroutineIntrinsics"
@JvmField
val COROUTINES_JVM_INTERNAL_PACKAGE_FQ_NAME =
DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("jvm")).child(Name.identifier("internal"))
@JvmField
val CONTINUATION_ASM_TYPE = DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME.topLevelClassAsmType()
@JvmField
val COROUTINE_IMPL_ASM_TYPE = COROUTINES_JVM_INTERNAL_PACKAGE_FQ_NAME.child(Name.identifier("CoroutineImpl")).topLevelClassAsmType()
private val COROUTINES_INTRINSICS_FILE_FACADE_INTERNAL_NAME =
COROUTINES_INTRINSICS_PACKAGE_FQ_NAME.child(Name.identifier("IntrinsicsKt")).topLevelClassAsmType()
private val INTERNAL_COROUTINE_INTRINSICS_OWNER_INTERNAL_NAME =
COROUTINES_JVM_INTERNAL_PACKAGE_FQ_NAME.child(Name.identifier("CoroutineIntrinsics")).topLevelClassInternalName()
private val NORMALIZE_CONTINUATION_METHOD_NAME = "normalizeContinuation"
data class ResolvedCallWithRealDescriptor(val resolvedCall: ResolvedCall<*>, val fakeContinuationExpression: KtExpression)
@@ -206,10 +227,16 @@ fun <D : FunctionDescriptor> D.createCustomCopy(
}
private fun FunctionDescriptor.getContinuationParameterTypeOfSuspendFunction() =
KotlinTypeFactory.simpleType(
builtIns.continuationClassDescriptor.defaultType,
arguments = listOf(returnType!!.asTypeProjection())
)
module.getContinuationOfTypeOrAny(returnType!!)
fun ModuleDescriptor.getContinuationOfTypeOrAny(kotlinType: KotlinType) =
module.findContinuationClassDescriptorOrNull(NoLookupLocation.FROM_BACKEND)?.defaultType?.let {
KotlinTypeFactory.simpleType(
it,
arguments = listOf(kotlinType.asTypeProjection())
)
} ?: module.builtIns.nullableAnyType
fun FunctionDescriptor.isBuiltInSuspendCoroutineOrReturnInJvm() =
getUserData(INITIAL_DESCRIPTOR_FOR_SUSPEND_FUNCTION)?.isBuiltInSuspendCoroutineOrReturn() == true
@@ -235,9 +262,9 @@ fun createMethodNodeForSuspendCoroutineOrReturn(
node.visitMethodInsn(
Opcodes.INVOKESTATIC,
INTERNAL_COROUTINE_INTRINSICS_OWNER,
INTERNAL_COROUTINE_INTRINSICS_OWNER_INTERNAL_NAME,
NORMALIZE_CONTINUATION_METHOD_NAME,
Type.getMethodDescriptor(AsmTypes.CONTINUATION, AsmTypes.CONTINUATION),
Type.getMethodDescriptor(CONTINUATION_ASM_TYPE, CONTINUATION_ASM_TYPE),
false
)
@@ -260,7 +287,7 @@ fun <D : CallableDescriptor?> D.unwrapInitialDescriptorForSuspendFunction(): D =
fun InstructionAdapter.loadSuspendMarker() {
invokestatic(
AsmTypes.COROUTINES_INTRINSICS_FILE_FACADE.internalName,
COROUTINES_INTRINSICS_FILE_FACADE_INTERNAL_NAME.internalName,
"get$SUSPENDED_MARKER_NAME",
Type.getMethodDescriptor(AsmTypes.OBJECT_TYPE),
false
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.codegen.AsmUtil;
import org.jetbrains.kotlin.codegen.ClassBuilder;
import org.jetbrains.kotlin.codegen.FieldInfo;
import org.jetbrains.kotlin.codegen.StackValue;
import org.jetbrains.kotlin.resolve.jvm.AsmTypes;
import org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenUtilKt;
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin;
import org.jetbrains.org.objectweb.asm.*;
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
@@ -68,7 +68,7 @@ public class AnonymousObjectTransformer extends ObjectTransformer<AnonymousObjec
public void visit(int version, int access, @NotNull String name, String signature, String superName, String[] interfaces) {
InlineCodegenUtil.assertVersionNotGreaterThanGeneratedOne(version, name, inliningContext.state);
classBuilder.defineClass(null, version, access, name, signature, superName, interfaces);
if(AsmTypes.COROUTINE_IMPL.getInternalName().equals(superName)) {
if(CoroutineCodegenUtilKt.COROUTINE_IMPL_ASM_TYPE.getInternalName().equals(superName)) {
inliningContext.setContinuation(true);
}
}
@@ -40,9 +40,6 @@ public class AsmTypes {
public static final Type MUTABLE_PROPERTY_REFERENCE0 = Type.getObjectType("kotlin/jvm/internal/MutablePropertyReference0");
public static final Type MUTABLE_PROPERTY_REFERENCE1 = Type.getObjectType("kotlin/jvm/internal/MutablePropertyReference1");
public static final Type MUTABLE_PROPERTY_REFERENCE2 = Type.getObjectType("kotlin/jvm/internal/MutablePropertyReference2");
public static final Type COROUTINE_IMPL = Type.getObjectType("kotlin/jvm/internal/CoroutineImpl");
public static final Type COROUTINES_INTRINSICS_FILE_FACADE = Type.getObjectType("kotlin/coroutines/intrinsics/IntrinsicsKt");
public static final Type CONTINUATION = Type.getObjectType("kotlin/coroutines/Continuation");
public static final Type[] PROPERTY_REFERENCE_IMPL = {
@@ -0,0 +1,6 @@
@kotlin.Metadata
public final class CreateCoroutinesOnManualInstancesKt {
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
public synthetic static method runCustomLambdaAsCoroutine$default(p0: java.lang.Throwable, p1: kotlin.jvm.functions.Function1, p2: int, p3: java.lang.Object): java.lang.String
public final static @org.jetbrains.annotations.NotNull method runCustomLambdaAsCoroutine(@org.jetbrains.annotations.Nullable p0: java.lang.Throwable, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function1): java.lang.String
}
@@ -88,7 +88,7 @@ public class LoadBuiltinsTest extends KotlinTestWithEnvironment {
ModuleDescriptor module =
LazyResolveTestUtilsKt.createResolveSessionForFiles(getEnvironment().getProject(), files, false).getModuleDescriptor();
for (FqName packageFqName : CollectionsKt.listOf(BUILT_INS_PACKAGE_FQ_NAME, COLLECTIONS_PACKAGE_FQ_NAME, RANGES_PACKAGE_FQ_NAME, COROUTINES_PACKAGE_FQ_NAME)) {
for (FqName packageFqName : CollectionsKt.listOf(BUILT_INS_PACKAGE_FQ_NAME, COLLECTIONS_PACKAGE_FQ_NAME, RANGES_PACKAGE_FQ_NAME)) {
PackageFragmentDescriptor fromLazyResolve =
CollectionsKt.single(module.getPackage(packageFqName).getFragments());
if (fromLazyResolve instanceof LazyPackageDescriptor) {
@@ -19,10 +19,14 @@ package org.jetbrains.kotlin.load.kotlin
import org.jetbrains.kotlin.builtins.*
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.MutableClassDescriptor
import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
import org.jetbrains.kotlin.load.java.typeEnhancement.hasEnhancedNullability
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.SpecialNames
import org.jetbrains.kotlin.platform.JavaToKotlinClassMap
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType
@@ -60,6 +64,25 @@ interface TypeMappingConfiguration<out T : Any> {
const val NON_EXISTENT_CLASS_NAME = "error/NonExistentClass"
private val FAKE_CONTINUATION_CLASS_DESCRIPTOR =
MutableClassDescriptor(
ErrorUtils.getErrorModule(),
ClassKind.INTERFACE, /* isInner = */ false, /* isExternal = */ false,
DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME.shortName(), SourceElement.NO_SOURCE
).apply {
modality = Modality.ABSTRACT
visibility = Visibilities.PUBLIC
setTypeParameterDescriptors(
TypeParameterDescriptorImpl.createWithDefaultBound(
this, Annotations.EMPTY, false, Variance.IN_VARIANCE, Name.identifier("T"), 0
).let(::listOf)
)
createTypeConstructor()
}
private val CONTINUATION_INTERNAL_NAME =
JvmClassName.byClassId(ClassId.topLevel(DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME)).internalName
fun <T : Any> mapType(
kotlinType: KotlinType,
factory: JvmTypeFactory<T>,
@@ -76,7 +99,11 @@ fun <T : Any> mapType(
kotlinType.getReceiverTypeFromFunctionType(),
kotlinType.getValueParameterTypesFromFunctionType().map(TypeProjection::getType) +
KotlinTypeFactory.simpleType(
Annotations.EMPTY, kotlinType.builtIns.continuationClassDescriptor.typeConstructor,
Annotations.EMPTY,
// Continuation interface is not a part of built-ins anymore, it has been moved to stdlib.
// While it must be somewhere in the dependencies, but here we don't have a reference to the module,
// and it's rather complicated to inject it by now, so we just use a fake class descriptor.
FAKE_CONTINUATION_CLASS_DESCRIPTOR.typeConstructor,
listOf(kotlinType.getReturnTypeFromFunctionType().asTypeProjection()), nullable = false
),
// TODO: names
@@ -189,6 +216,11 @@ private fun <T : Any> mapBuiltInType(
): T? {
val descriptor = type.constructor.declarationDescriptor as? ClassDescriptor ?: return null
if (descriptor === FAKE_CONTINUATION_CLASS_DESCRIPTOR) {
return typeFactory.createObjectType(CONTINUATION_INTERNAL_NAME)
}
val fqName = descriptor.fqNameUnsafe
val primitiveType = KotlinBuiltIns.getPrimitiveTypeByFqName(fqName)
@@ -57,8 +57,6 @@ public abstract class KotlinBuiltIns {
public static final FqName BUILT_INS_PACKAGE_FQ_NAME = FqName.topLevel(BUILT_INS_PACKAGE_NAME);
private static final FqName ANNOTATION_PACKAGE_FQ_NAME = BUILT_INS_PACKAGE_FQ_NAME.child(Name.identifier("annotation"));
public static final FqName COLLECTIONS_PACKAGE_FQ_NAME = BUILT_INS_PACKAGE_FQ_NAME.child(Name.identifier("collections"));
public static final FqName COROUTINES_PACKAGE_FQ_NAME = BUILT_INS_PACKAGE_FQ_NAME.child(Name.identifier("coroutines"));
private static final FqName COROUTINES_INTRINSICS_PACKAGE_FQ_NAME = COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("intrinsics"));
public static final FqName RANGES_PACKAGE_FQ_NAME = BUILT_INS_PACKAGE_FQ_NAME.child(Name.identifier("ranges"));
public static final FqName TEXT_PACKAGE_FQ_NAME = BUILT_INS_PACKAGE_FQ_NAME.child(Name.identifier("text"));
@@ -68,8 +66,6 @@ public abstract class KotlinBuiltIns {
RANGES_PACKAGE_FQ_NAME,
ANNOTATION_PACKAGE_FQ_NAME,
ReflectionTypesKt.getKOTLIN_REFLECT_FQ_NAME(),
COROUTINES_PACKAGE_FQ_NAME,
COROUTINES_INTRINSICS_PACKAGE_FQ_NAME,
BUILT_INS_PACKAGE_FQ_NAME.child(Name.identifier("internal"))
);
@@ -98,13 +94,9 @@ public abstract class KotlinBuiltIns {
PackageFragmentDescriptor kotlinCollections = createPackage(provider, nameToFragment, COLLECTIONS_PACKAGE_FQ_NAME);
createPackage(provider, nameToFragment, RANGES_PACKAGE_FQ_NAME);
PackageFragmentDescriptor kotlinAnnotation = createPackage(provider, nameToFragment, ANNOTATION_PACKAGE_FQ_NAME);
PackageFragmentDescriptor coroutinePackage = createPackage(provider, null, COROUTINES_PACKAGE_FQ_NAME);
PackageFragmentDescriptor coroutineIntrinsicsPackage =
createPackage(provider, null, COROUTINES_INTRINSICS_PACKAGE_FQ_NAME);
Set<PackageFragmentDescriptor> allImportedByDefault = new LinkedHashSet<PackageFragmentDescriptor>(nameToFragment.values());
return new PackageFragments(kotlin, kotlinCollections, kotlinAnnotation, coroutinePackage, coroutineIntrinsicsPackage, allImportedByDefault);
return new PackageFragments(kotlin, kotlinCollections, kotlinAnnotation, allImportedByDefault);
}
});
@@ -133,7 +125,7 @@ public abstract class KotlinBuiltIns {
public ClassDescriptor invoke(Integer arity) {
return new FunctionClassDescriptor(
getStorageManager(),
packageFragments.invoke().coroutinePackageFragment,
packageFragments.invoke().builtInsPackageFragment,
FunctionClassDescriptor.Kind.SuspendFunction,
arity
);
@@ -252,23 +244,17 @@ public abstract class KotlinBuiltIns {
public final PackageFragmentDescriptor builtInsPackageFragment;
public final PackageFragmentDescriptor collectionsPackageFragment;
public final PackageFragmentDescriptor annotationPackageFragment;
public final PackageFragmentDescriptor coroutinePackageFragment;
public final PackageFragmentDescriptor coroutineIntrinsicsPackage;
public final Set<PackageFragmentDescriptor> allImportedByDefaultBuiltInsPackageFragments;
private PackageFragments(
@NotNull PackageFragmentDescriptor builtInsPackageFragment,
@NotNull PackageFragmentDescriptor collectionsPackageFragment,
@NotNull PackageFragmentDescriptor annotationPackageFragment,
@NotNull PackageFragmentDescriptor coroutinePackageFragment,
@NotNull PackageFragmentDescriptor coroutineIntrinsicsPackage,
@NotNull Set<PackageFragmentDescriptor> allImportedByDefaultBuiltInsPackageFragments
) {
this.builtInsPackageFragment = builtInsPackageFragment;
this.collectionsPackageFragment = collectionsPackageFragment;
this.annotationPackageFragment = annotationPackageFragment;
this.coroutinePackageFragment = coroutinePackageFragment;
this.coroutineIntrinsicsPackage = coroutineIntrinsicsPackage;
this.allImportedByDefaultBuiltInsPackageFragments = allImportedByDefaultBuiltInsPackageFragments;
}
}
@@ -398,11 +384,6 @@ public abstract class KotlinBuiltIns {
return packageFragments.invoke().allImportedByDefaultBuiltInsPackageFragments;
}
@NotNull
public PackageFragmentDescriptor getBuiltInsCoroutineIntrinsicsPackageFragment() {
return packageFragments.invoke().coroutineIntrinsicsPackage;
}
@NotNull
public PackageFragmentDescriptor getBuiltInsPackageFragment() {
return packageFragments.invoke().builtInsPackageFragment;
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.builtins.functions
import org.jetbrains.kotlin.builtins.BuiltInsPackageFragment
import org.jetbrains.kotlin.builtins.KOTLIN_REFLECT_FQ_NAME
import org.jetbrains.kotlin.builtins.KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME
import org.jetbrains.kotlin.builtins.KotlinBuiltIns.COROUTINES_PACKAGE_FQ_NAME
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.AbstractClassDescriptor
@@ -51,7 +50,7 @@ class FunctionClassDescriptor(
enum class Kind(val packageFqName: FqName, val classNamePrefix: String) {
Function(BUILT_INS_PACKAGE_FQ_NAME, "Function"),
SuspendFunction(COROUTINES_PACKAGE_FQ_NAME, "SuspendFunction"),
SuspendFunction(BUILT_INS_PACKAGE_FQ_NAME, "SuspendFunction"),
KFunction(KOTLIN_REFLECT_FQ_NAME, "KFunction");
fun numberedClassName(arity: Int) = Name.identifier("$classNamePrefix$arity")
@@ -16,12 +16,10 @@
package org.jetbrains.kotlin.descriptors
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.builtins.isFunctionType
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.utils.sure
fun ModuleDescriptor.resolveClassByFqName(fqName: FqName, lookupLocation: LookupLocation): ClassDescriptor? {
if (fqName.isRoot) return null
@@ -34,4 +32,8 @@ fun ModuleDescriptor.resolveClassByFqName(fqName: FqName, lookupLocation: Lookup
?.getContributedClassifier(fqName.shortName(), lookupLocation) as? ClassDescriptor
}
val KotlinBuiltIns.continuationClassDescriptor get() = getBuiltInClassByFqName(DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME)
fun ModuleDescriptor.findContinuationClassDescriptorOrNull(lookupLocation: LookupLocation) =
resolveClassByFqName(DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME, lookupLocation)
fun ModuleDescriptor.findContinuationClassDescriptor(lookupLocation: LookupLocation) =
findContinuationClassDescriptorOrNull(lookupLocation).sure { "Continuation interface is not found" }
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,15 +14,12 @@
* limitations under the License.
*/
package org.jetbrains.kotlin.codegen;
package org.jetbrains.kotlin.descriptors.impl;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
import org.jetbrains.kotlin.descriptors.impl.ClassConstructorDescriptorImpl;
import org.jetbrains.kotlin.descriptors.impl.ClassDescriptorBase;
import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.resolve.scopes.MemberScope;
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
@@ -51,8 +51,8 @@ public class DescriptorUtils {
public static final FqName JVM_NAME = new FqName("kotlin.jvm.JvmName");
private static final FqName VOLATILE = new FqName("kotlin.jvm.Volatile");
private static final FqName SYNCHRONIZED = new FqName("kotlin.jvm.Synchronized");
public static final FqName CONTINUATION_INTERFACE_FQ_NAME =
KotlinBuiltIns.COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("Continuation"));
public static final FqName COROUTINES_PACKAGE_FQ_NAME = new FqName("kotlin.coroutines");
public static final FqName CONTINUATION_INTERFACE_FQ_NAME = COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("Continuation"));
private DescriptorUtils() {
}
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.descriptors.annotations.AnnotationWithTarget
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.types.KotlinType
private val NO_INFER_ANNOTATION_FQ_NAME = FqName("kotlin.internal.NoInfer")
@@ -32,7 +33,7 @@ val LOW_PRIORITY_IN_OVERLOAD_RESOLUTION_FQ_NAME = FqName("kotlin.internal.LowPri
private val HIDES_MEMBERS_ANNOTATION_FQ_NAME = FqName("kotlin.internal.HidesMembers")
private val ONLY_INPUT_TYPES_FQ_NAME = FqName("kotlin.internal.OnlyInputTypes")
private val DYNAMIC_EXTENSION_FQ_NAME = FqName("kotlin.internal.DynamicExtension")
private val RESTRICTS_SUSPENSION_FQ_NAME = FqName("kotlin.coroutines.RestrictsSuspension")
private val RESTRICTS_SUSPENSION_FQ_NAME = DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("RestrictsSuspension"))
// @HidesMembers annotation only has effect for members with these names
val HIDES_MEMBERS_NAME_LIST = setOf(Name.identifier("forEach"))
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations;
import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor;
import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor;
import org.jetbrains.kotlin.descriptors.impl.TypeAliasConstructorDescriptor;
import org.jetbrains.kotlin.incremental.components.NoLookupLocation;
import org.jetbrains.kotlin.js.backend.ast.*;
import org.jetbrains.kotlin.js.backend.ast.metadata.MetadataProperties;
import org.jetbrains.kotlin.js.config.JsConfig;
@@ -108,8 +109,9 @@ public class TranslationContext {
if (declarationDescriptor instanceof FunctionDescriptor) {
FunctionDescriptor function = (FunctionDescriptor) declarationDescriptor;
if (function.isSuspend() && !(function instanceof AnonymousFunctionDescriptor)) {
ClassDescriptor continuationDescriptor = getCurrentModule().getBuiltIns().getBuiltInClassByFqName(
DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME);
ClassDescriptor continuationDescriptor =
DescriptorUtilKt.findContinuationClassDescriptor(getCurrentModule(), NoLookupLocation.FROM_BACKEND);
return new LocalVariableDescriptor(
declarationDescriptor,
Annotations.Companion.getEMPTY(),
@@ -364,7 +364,7 @@ public final class TranslationUtils {
@NotNull
public static ClassDescriptor getCoroutineBaseClass(@NotNull TranslationContext context) {
FqName className = KotlinBuiltIns.COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("CoroutineImpl"));
FqName className = DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("CoroutineImpl"));
ClassDescriptor descriptor = FindClassInModuleKt.findClassAcrossModuleDependencies(
context.getCurrentModule(), ClassId.topLevel(className));
assert descriptor != null;
@@ -17,6 +17,7 @@
package org.jetbrains.kotlin.js.translate.utils
import com.intellij.util.SmartList
import org.jetbrains.kotlin.backend.common.COROUTINES_INTRINSICS_PACKAGE_FQ_NAME
import org.jetbrains.kotlin.backend.common.SUSPENDED_MARKER_NAME
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
@@ -32,7 +33,6 @@ import org.jetbrains.kotlin.js.translate.context.TranslationContext
import org.jetbrains.kotlin.js.translate.intrinsic.functions.basic.FunctionIntrinsicWithReceiverComputed
import org.jetbrains.kotlin.js.translate.reference.ReferenceTranslator
import org.jetbrains.kotlin.js.translate.utils.TranslationUtils.simpleReturnFunction
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.types.KotlinType
@@ -173,5 +173,3 @@ fun JsFunction.fillCoroutineMetadata(
hasReceiver = descriptor.dispatchReceiverParameter != null
)
}
private val COROUTINES_INTRINSICS_PACKAGE_FQ_NAME = FqName("kotlin.coroutines.intrinsics")
@@ -4,7 +4,8 @@ package kotlin.coroutines
import java.lang.IllegalStateException
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater
import kotlin.coroutines.intrinsics.*
import kotlin.coroutines.intrinsics.SUSPENDED_MARKER
import kotlin.coroutines.intrinsics.suspendCoroutineOrReturn
/**
* Creates coroutine with receiver type [R] and result type [T].
@@ -17,7 +18,7 @@ import kotlin.coroutines.intrinsics.*
public fun <R, T> (suspend R.() -> T).createCoroutine(
receiver: R,
completion: Continuation<T>
): Continuation<Unit> = ((this as kotlin.jvm.internal.CoroutineImpl).create(receiver, completion) as kotlin.jvm.internal.CoroutineImpl).facade
): Continuation<Unit> = ((this as kotlin.coroutines.jvm.internal.CoroutineImpl).create(receiver, completion) as kotlin.coroutines.jvm.internal.CoroutineImpl).facade
/**
* Starts coroutine with receiver type [R] and result type [T].
@@ -43,7 +44,7 @@ public fun <R, T> (suspend R.() -> T).startCoroutine(
@Suppress("UNCHECKED_CAST")
public fun <T> (suspend () -> T).createCoroutine(
completion: Continuation<T>
): Continuation<Unit> = ((this as kotlin.jvm.internal.CoroutineImpl).create(completion) as kotlin.jvm.internal.CoroutineImpl).facade
): Continuation<Unit> = ((this as kotlin.coroutines.jvm.internal.CoroutineImpl).create(completion) as kotlin.coroutines.jvm.internal.CoroutineImpl).facade
/**
* Starts coroutine without receiver and with result type [T].
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,19 +14,21 @@
* limitations under the License.
*/
package kotlin.jvm.internal
@file:JvmVersion
package kotlin.coroutines.jvm.internal
import java.lang.IllegalStateException
import kotlin.coroutines.Continuation
import kotlin.coroutines.ContinuationInterceptor
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.intrinsics.SUSPENDED_MARKER
import kotlin.jvm.internal.Lambda
abstract class CoroutineImpl(
arity: Int,
@JvmField
protected var completion: Continuation<Any?>?
) : Lambda(arity), Continuation<Any?> {
) : Lambda(arity), Continuation<Any?> {
// label == -1 when coroutine cannot be started (it is just a factory object) or has already finished execution
// label == 0 in initial part of the coroutine
@@ -13,10 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:kotlin.jvm.JvmName("CoroutineIntrinsics")
package kotlin.jvm.internal
@file:JvmVersion
@file:JvmName("CoroutineIntrinsics")
package kotlin.coroutines.jvm.internal
import kotlin.coroutines.Continuation
fun <T> normalizeContinuation(continuation: Continuation<T>): Continuation<T> =
(continuation as? CoroutineImpl)?.facade ?: continuation
(continuation as? kotlin.coroutines.jvm.internal.CoroutineImpl)?.facade ?: continuation
@@ -14,6 +14,8 @@
* limitations under the License.
*/
@file:kotlin.jvm.JvmName("IntrinsicsKt")
package kotlin.coroutines.intrinsics
import kotlin.coroutines.Continuation
@@ -179,42 +179,6 @@ public abstract class kotlin/collections/ShortIterator : java/util/Iterator, kot
public fun remove ()V
}
public abstract interface class kotlin/coroutines/Continuation {
public abstract fun getContext ()Lkotlin/coroutines/CoroutineContext;
public abstract fun resume (Ljava/lang/Object;)V
public abstract fun resumeWithException (Ljava/lang/Throwable;)V
}
public abstract interface class kotlin/coroutines/ContinuationInterceptor : kotlin/coroutines/CoroutineContext$Element {
public static final field Key Lkotlin/coroutines/ContinuationInterceptor$Key;
public abstract fun interceptContinuation (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
}
public final class kotlin/coroutines/ContinuationInterceptor$Key : kotlin/coroutines/CoroutineContext$Key {
}
public abstract interface class kotlin/coroutines/CoroutineContext {
public abstract fun fold (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
public abstract fun get (Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext$Element;
public abstract fun minusKey (Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext;
public abstract fun plus (Lkotlin/coroutines/CoroutineContext;)Lkotlin/coroutines/CoroutineContext;
}
public abstract interface class kotlin/coroutines/CoroutineContext$Element : kotlin/coroutines/CoroutineContext {
public abstract fun getKey ()Lkotlin/coroutines/CoroutineContext$Key;
}
public abstract interface class kotlin/coroutines/CoroutineContext$Key {
}
public abstract interface annotation class kotlin/coroutines/RestrictsSuspension : java/lang/annotation/Annotation {
}
public final class kotlin/coroutines/intrinsics/IntrinsicsKt {
public static final fun getSUSPENDED_MARKER ()Ljava/lang/Object;
public static final fun suspendCoroutineOrReturn (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
public final class kotlin/jvm/JvmClassMappingKt {
public static final fun getAnnotationClass (Ljava/lang/annotation/Annotation;)Lkotlin/reflect/KClass;
public static final fun getJavaClass (Ljava/lang/Object;)Ljava/lang/Class;
@@ -481,23 +445,6 @@ public class kotlin/jvm/internal/CollectionToArray {
public static fun toArray (Ljava/util/Collection;[Ljava/lang/Object;)[Ljava/lang/Object;
}
public abstract class kotlin/jvm/internal/CoroutineImpl : kotlin/jvm/internal/Lambda, kotlin/coroutines/Continuation {
protected field completion Lkotlin/coroutines/Continuation;
protected field label I
public fun <init> (ILkotlin/coroutines/Continuation;)V
public fun create (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
public fun create (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
protected abstract fun doResume (Ljava/lang/Object;Ljava/lang/Throwable;)Ljava/lang/Object;
public fun getContext ()Lkotlin/coroutines/CoroutineContext;
public final fun getFacade ()Lkotlin/coroutines/Continuation;
public fun resume (Ljava/lang/Object;)V
public fun resumeWithException (Ljava/lang/Throwable;)V
}
public final class kotlin/jvm/internal/CoroutineIntrinsics {
public static final fun normalizeContinuation (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
}
public final class kotlin/jvm/internal/DoubleCompanionObject {
public static final field INSTANCE Lkotlin/jvm/internal/DoubleCompanionObject;
public final fun getMAX_VALUE ()D
@@ -2012,7 +2012,23 @@ public final class kotlin/coroutines/SafeContinuation$Companion {
public final class kotlin/coroutines/intrinsics/IntrinsicsKt {
public static final fun getSUSPENDED_MARKER ()Ljava/lang/Object;
public static final fun suspendCoroutineOrReturn (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
public abstract class kotlin/coroutines/jvm/internal/CoroutineImpl : kotlin/jvm/internal/Lambda, kotlin/coroutines/Continuation {
protected field completion Lkotlin/coroutines/Continuation;
protected field label I
public fun <init> (ILkotlin/coroutines/Continuation;)V
public fun create (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
public fun create (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
protected abstract fun doResume (Ljava/lang/Object;Ljava/lang/Throwable;)Ljava/lang/Object;
public fun getContext ()Lkotlin/coroutines/CoroutineContext;
public final fun getFacade ()Lkotlin/coroutines/Continuation;
public fun resume (Ljava/lang/Object;)V
public fun resumeWithException (Ljava/lang/Throwable;)V
}
public final class kotlin/coroutines/jvm/internal/CoroutineIntrinsics {
public static final fun normalizeContinuation (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
}
public final class kotlin/internal/PlatformImplementationsKt {
@@ -2411,23 +2427,6 @@ public class kotlin/jvm/internal/CollectionToArray {
public static fun toArray (Ljava/util/Collection;[Ljava/lang/Object;)[Ljava/lang/Object;
}
public abstract class kotlin/jvm/internal/CoroutineImpl : kotlin/jvm/internal/Lambda, kotlin/coroutines/Continuation {
protected field completion Lkotlin/coroutines/Continuation;
protected field label I
public fun <init> (ILkotlin/coroutines/Continuation;)V
public fun create (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
public fun create (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
protected abstract fun doResume (Ljava/lang/Object;Ljava/lang/Throwable;)Ljava/lang/Object;
public fun getContext ()Lkotlin/coroutines/CoroutineContext;
public final fun getFacade ()Lkotlin/coroutines/Continuation;
public fun resume (Ljava/lang/Object;)V
public fun resumeWithException (Ljava/lang/Throwable;)V
}
public final class kotlin/jvm/internal/CoroutineIntrinsics {
public static final fun normalizeContinuation (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
}
public final class kotlin/jvm/internal/DoubleCompanionObject {
public static final field INSTANCE Lkotlin/jvm/internal/DoubleCompanionObject;
public final fun getMAX_VALUE ()D
@@ -1768,6 +1768,34 @@ public abstract class kotlin/coroutines/AbstractCoroutineContextElement : kotlin
public fun plus (Lkotlin/coroutines/CoroutineContext;)Lkotlin/coroutines/CoroutineContext;
}
public abstract interface class kotlin/coroutines/Continuation {
public abstract fun getContext ()Lkotlin/coroutines/CoroutineContext;
public abstract fun resume (Ljava/lang/Object;)V
public abstract fun resumeWithException (Ljava/lang/Throwable;)V
}
public abstract interface class kotlin/coroutines/ContinuationInterceptor : kotlin/coroutines/CoroutineContext$Element {
public static final field Key Lkotlin/coroutines/ContinuationInterceptor$Key;
public abstract fun interceptContinuation (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
}
public final class kotlin/coroutines/ContinuationInterceptor$Key : kotlin/coroutines/CoroutineContext$Key {
}
public abstract interface class kotlin/coroutines/CoroutineContext {
public abstract fun fold (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
public abstract fun get (Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext$Element;
public abstract fun minusKey (Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext;
public abstract fun plus (Lkotlin/coroutines/CoroutineContext;)Lkotlin/coroutines/CoroutineContext;
}
public abstract interface class kotlin/coroutines/CoroutineContext$Element : kotlin/coroutines/CoroutineContext {
public abstract fun getKey ()Lkotlin/coroutines/CoroutineContext$Key;
}
public abstract interface class kotlin/coroutines/CoroutineContext$Key {
}
public final class kotlin/coroutines/CoroutinesKt {
public static final fun createCoroutine (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
public static final fun createCoroutine (Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
@@ -1786,6 +1814,9 @@ public final class kotlin/coroutines/EmptyCoroutineContext : kotlin/coroutines/C
public fun toString ()Ljava/lang/String;
}
public abstract interface annotation class kotlin/coroutines/RestrictsSuspension : java/lang/annotation/Annotation {
}
public final class kotlin/coroutines/SafeContinuation : kotlin/coroutines/Continuation {
public static final field Companion Lkotlin/coroutines/SafeContinuation$Companion;
public fun <init> (Lkotlin/coroutines/Continuation;)V
@@ -1798,6 +1829,28 @@ public final class kotlin/coroutines/SafeContinuation : kotlin/coroutines/Contin
public final class kotlin/coroutines/SafeContinuation$Companion {
}
public final class kotlin/coroutines/intrinsics/IntrinsicsKt {
public static final fun getSUSPENDED_MARKER ()Ljava/lang/Object;
public static final fun suspendCoroutineOrReturn (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
public abstract class kotlin/coroutines/jvm/internal/CoroutineImpl : kotlin/jvm/internal/Lambda, kotlin/coroutines/Continuation {
protected field completion Lkotlin/coroutines/Continuation;
protected field label I
public fun <init> (ILkotlin/coroutines/Continuation;)V
public fun create (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
public fun create (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
protected abstract fun doResume (Ljava/lang/Object;Ljava/lang/Throwable;)Ljava/lang/Object;
public fun getContext ()Lkotlin/coroutines/CoroutineContext;
public final fun getFacade ()Lkotlin/coroutines/Continuation;
public fun resume (Ljava/lang/Object;)V
public fun resumeWithException (Ljava/lang/Throwable;)V
}
public final class kotlin/coroutines/jvm/internal/CoroutineIntrinsics {
public static final fun normalizeContinuation (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
}
public final class kotlin/internal/PlatformImplementationsKt {
public static final synthetic fun platformCloseSuppressed (Ljava/io/Closeable;Ljava/lang/Throwable;)V
}