package kotlin.reflect.internal;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0000\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0002\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u00028\u00000\u0002B'\u0012\u001e\u0010\u0006\u001a\u001a\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u0004\u0012\f\u0012\n\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u00050\u0003¢\u0006\u0004\b\u0007\u0010\bJ%\u0010\u000b\u001a\n\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u00052\f\u0010\n\u001a\b\u0012\u0004\u0012\u00020\t0\u0004H\u0016¢\u0006\u0004\b\u000b\u0010\fR,\u0010\u0006\u001a\u001a\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u0004\u0012\f\u0012\n\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u00050\u00038\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u000b\u0010\rR*\u0010\u0013\u001a\u0018\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u000f\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00100\u000e8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0011\u0010\u0012¨\u0006\u0014"}, d2 = {"Lkotlinx/serialization/internal/ConcurrentHashMapCache;", "T", "Lkotlinx/serialization/internal/SerializerCache;", "Lkotlin/Function1;", "Lkotlin/reflect/KClass;", "Lkotlinx/serialization/KSerializer;", "compute", "<init>", "(Lkotlin/jvm/functions/Function1;)V", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "key", "a", "(Lkotlin/reflect/KClass;)Lkotlinx/serialization/KSerializer;", "Lkotlin/jvm/functions/Function1;", "Ljava/util/concurrent/ConcurrentHashMap;", "Ljava/lang/Class;", "Lkotlinx/serialization/internal/CacheEntry;", "b", "Ljava/util/concurrent/ConcurrentHashMap;", "cache", "kotlinx-serialization-core"}, k = 1, mv = {2, 0, 0}, xi = 48)
@kotlin.jvm.internal.SourceDebugExtension
final class ConcurrentHashMapCache<T> implements kotlin.reflect.internal.SerializerCache<T> {

    /* JADX INFO: renamed from: a, reason: from kotlin metadata */
    private final kotlin.jvm.functions.Function1 compute;

    /* JADX INFO: renamed from: b, reason: from kotlin metadata */
    private final java.util.concurrent.ConcurrentHashMap cache;

    public ConcurrentHashMapCache(kotlin.jvm.functions.Function1 function1) {
        kotlin.jvm.internal.Intrinsics.l(function1, "compute");
        this.compute = function1;
        this.cache = new java.util.concurrent.ConcurrentHashMap();
    }

    @Override // kotlin.reflect.internal.SerializerCache
    public kotlin.reflect.KSerializer a(kotlin.reflect.KClass key) {
        java.lang.Object objPutIfAbsent;
        kotlin.jvm.internal.Intrinsics.l(key, "key");
        java.util.concurrent.ConcurrentHashMap concurrentHashMap = this.cache;
        java.lang.Class clsB = kotlin.jvm.JvmClassMappingKt.b(key);
        java.lang.Object cacheEntry = concurrentHashMap.get(clsB);
        if (cacheEntry == null && (objPutIfAbsent = concurrentHashMap.putIfAbsent(clsB, (cacheEntry = new kotlin.reflect.internal.CacheEntry((kotlin.reflect.KSerializer) this.compute.invoke(key))))) != null) {
            cacheEntry = objPutIfAbsent;
        }
        return ((kotlin.reflect.internal.CacheEntry) cacheEntry).serializer;
    }
}
