.class public Lkotlinx/coroutines/channels/BufferedChannel; .super Ljava/lang/Object; .source "SourceFile" # interfaces .implements Lkotlinx/coroutines/channels/Channel; # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lkotlinx/coroutines/channels/BufferedChannel$BufferedChannelIterator; } .end annotation # static fields .field public static final _closeCause$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .field public static final bufferEnd$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .field public static final bufferEndSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .field public static final closeHandler$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .field public static final completedExpandBuffersAndPauseFlag$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .field public static final receiveSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .field public static final receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .field public static final sendSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .field public static final sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; # instance fields .field private volatile _closeCause:Ljava/lang/Object; .field private volatile bufferEnd:J .field private volatile bufferEndSegment:Ljava/lang/Object; .field public final capacity:I .field private volatile closeHandler:Ljava/lang/Object; .field private volatile completedExpandBuffersAndPauseFlag:J .field public final onUndeliveredElement:Lkotlin/jvm/functions/Function1; .field public final onUndeliveredElementReceiveCancellationConstructor:Lkotlin/jvm/functions/Function3; .field private volatile receiveSegment:Ljava/lang/Object; .field private volatile receivers:J .field private volatile sendSegment:Ljava/lang/Object; .field private volatile sendersAndCloseStatus:J # direct methods .method static constructor ()V .locals 3 const-string v0, "sendersAndCloseStatus" const-class v1, Lkotlinx/coroutines/channels/BufferedChannel; invoke-static {v1, v0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; const-string v0, "receivers" invoke-static {v1, v0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; const-string v0, "bufferEnd" invoke-static {v1, v0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEnd$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; const-string v0, "completedExpandBuffersAndPauseFlag" invoke-static {v1, v0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->completedExpandBuffersAndPauseFlag$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; const-string v0, "sendSegment" const-class v2, Ljava/lang/Object; invoke-static {v1, v2, v0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; const-string v0, "receiveSegment" invoke-static {v1, v2, v0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receiveSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; const-string v0, "bufferEndSegment" invoke-static {v1, v2, v0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEndSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; const-string v0, "_closeCause" invoke-static {v1, v2, v0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->_closeCause$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; const-string v0, "closeHandler" invoke-static {v1, v2, v0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->closeHandler$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; return-void .end method .method public constructor (ILkotlin/jvm/functions/Function1;)V .locals 8 .line 36 invoke-direct {p0}, Ljava/lang/Object;->()V iput p1, p0, Lkotlinx/coroutines/channels/BufferedChannel;->capacity:I iput-object p2, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-ltz p1, :cond_2 .line 68 invoke-static {p1}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$initialBufferEnd(I)J move-result-wide v0 iput-wide v0, p0, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEnd:J .line 87 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide v0 iput-wide v0, p0, Lkotlinx/coroutines/channels/BufferedChannel;->completedExpandBuffersAndPauseFlag:J .line 98 new-instance p1, Lkotlinx/coroutines/channels/ChannelSegment; const-wide/16 v3, 0x0 const/4 v5, 0x0 const/4 v7, 0x3 move-object v2, p1 move-object v6, p0 invoke-direct/range {v2 .. v7}, Lkotlinx/coroutines/channels/ChannelSegment;->(JLkotlinx/coroutines/channels/ChannelSegment;Lkotlinx/coroutines/channels/BufferedChannel;I)V iput-object p1, p0, Lkotlinx/coroutines/channels/BufferedChannel;->sendSegment:Ljava/lang/Object; iput-object p1, p0, Lkotlinx/coroutines/channels/BufferedChannel;->receiveSegment:Ljava/lang/Object; .line 105 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isRendezvousOrUnlimited()Z move-result v0 if-eqz v0, :cond_0 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getNULL_SEGMENT$p()Lkotlinx/coroutines/channels/ChannelSegment; move-result-object p1 const-string v0, "null cannot be cast to non-null type kotlinx.coroutines.channels.ChannelSegment" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V :cond_0 iput-object p1, p0, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEndSegment:Ljava/lang/Object; if-eqz p2, :cond_1 .line 1542 new-instance p1, Lkotlinx/coroutines/channels/BufferedChannel$onUndeliveredElementReceiveCancellationConstructor$1$1; invoke-direct {p1, p0}, Lkotlinx/coroutines/channels/BufferedChannel$onUndeliveredElementReceiveCancellationConstructor$1$1;->(Lkotlinx/coroutines/channels/BufferedChannel;)V goto :goto_0 :cond_1 const/4 p1, 0x0 :goto_0 iput-object p1, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElementReceiveCancellationConstructor:Lkotlin/jvm/functions/Function3; .line 1721 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getNO_CLOSE_CAUSE$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 iput-object p1, p0, Lkotlinx/coroutines/channels/BufferedChannel;->_closeCause:Ljava/lang/Object; return-void .line 46 :cond_2 new-instance p2, Ljava/lang/StringBuilder; invoke-direct {p2}, Ljava/lang/StringBuilder;->()V const-string v0, "Invalid channel capacity: " invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; const-string p1, ", should be >=0" invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 new-instance p2, Ljava/lang/IllegalArgumentException; invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p2 .end method .method public static final synthetic access$findSegmentReceive(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; .locals 0 .line 36 invoke-virtual {p0, p1, p2, p3}, Lkotlinx/coroutines/channels/BufferedChannel;->findSegmentReceive(JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object p0 return-object p0 .end method .method public static final synthetic access$findSegmentSend(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; .locals 0 .line 36 invoke-virtual {p0, p1, p2, p3}, Lkotlinx/coroutines/channels/BufferedChannel;->findSegmentSend(JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object p0 return-object p0 .end method .method public static final synthetic access$getReceiveException(Lkotlinx/coroutines/channels/BufferedChannel;)Ljava/lang/Throwable; .locals 0 .line 36 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiveException()Ljava/lang/Throwable; move-result-object p0 return-object p0 .end method .method public static final synthetic access$getReceiveSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .locals 1 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receiveSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; return-object v0 .end method .method public static final synthetic access$getReceivers$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .locals 1 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; return-object v0 .end method .method public static final synthetic access$getSendSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .locals 1 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; return-object v0 .end method .method public static final synthetic access$getSendersAndCloseStatus$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .locals 1 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; return-object v0 .end method .method public static final synthetic access$isClosedForSend0(Lkotlinx/coroutines/channels/BufferedChannel;J)Z .locals 0 .line 36 invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForSend0(J)Z move-result p0 return p0 .end method .method public static final synthetic access$onClosedReceiveCatchingOnNoWaiterSuspend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/CancellableContinuation;)V .locals 0 .line 36 invoke-virtual {p0, p1}, Lkotlinx/coroutines/channels/BufferedChannel;->onClosedReceiveCatchingOnNoWaiterSuspend(Lkotlinx/coroutines/CancellableContinuation;)V return-void .end method .method public static final synthetic access$onClosedReceiveOnNoWaiterSuspend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/CancellableContinuation;)V .locals 0 .line 36 invoke-virtual {p0, p1}, Lkotlinx/coroutines/channels/BufferedChannel;->onClosedReceiveOnNoWaiterSuspend(Lkotlinx/coroutines/CancellableContinuation;)V return-void .end method .method public static final synthetic access$onClosedSendOnNoWaiterSuspend(Lkotlinx/coroutines/channels/BufferedChannel;Ljava/lang/Object;Lkotlinx/coroutines/CancellableContinuation;)V .locals 0 .line 36 invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->onClosedSendOnNoWaiterSuspend(Ljava/lang/Object;Lkotlinx/coroutines/CancellableContinuation;)V return-void .end method .method public static final synthetic access$prepareReceiverForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V .locals 0 .line 36 invoke-virtual {p0, p1, p2, p3}, Lkotlinx/coroutines/channels/BufferedChannel;->prepareReceiverForSuspension(Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V return-void .end method .method public static final synthetic access$prepareSenderForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V .locals 0 .line 36 invoke-virtual {p0, p1, p2, p3}, Lkotlinx/coroutines/channels/BufferedChannel;->prepareSenderForSuspension(Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V return-void .end method .method public static final synthetic access$receiveCatchingOnNoWaiterSuspend-GKJJFZk(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;IJLkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 0 .line 36 invoke-virtual/range {p0 .. p5}, Lkotlinx/coroutines/channels/BufferedChannel;->receiveCatchingOnNoWaiterSuspend-GKJJFZk(Lkotlinx/coroutines/channels/ChannelSegment;IJLkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object p0 return-object p0 .end method .method public static final synthetic access$updateCellReceive(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; .locals 0 .line 36 invoke-virtual/range {p0 .. p5}, Lkotlinx/coroutines/channels/BufferedChannel;->updateCellReceive(Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object p0 return-object p0 .end method .method public static final synthetic access$updateCellSend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I .locals 0 .line 36 invoke-virtual/range {p0 .. p7}, Lkotlinx/coroutines/channels/BufferedChannel;->updateCellSend(Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I move-result p0 return p0 .end method .method public static synthetic incCompletedExpandBufferAttempts$default(Lkotlinx/coroutines/channels/BufferedChannel;JILjava/lang/Object;)V .locals 0 if-nez p4, :cond_1 and-int/lit8 p3, p3, 0x1 if-eqz p3, :cond_0 const-wide/16 p1, 0x1 .line 1368 :cond_0 invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->incCompletedExpandBufferAttempts(J)V return-void :cond_1 new-instance p0, Ljava/lang/UnsupportedOperationException; const-string p1, "Super calls with default arguments not supported in this target, function: incCompletedExpandBufferAttempts" invoke-direct {p0, p1}, Ljava/lang/UnsupportedOperationException;->(Ljava/lang/String;)V throw p0 .end method .method public static synthetic receive$suspendImpl(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 13 const/4 v6, 0x0 .line 667 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceiveSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v0 .line 886 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Lkotlinx/coroutines/channels/ChannelSegment; .line 890 :goto_0 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForReceive()Z move-result v1 if-nez v1, :cond_6 .line 681 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceivers$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v1 .line 893 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J move-result-wide v10 .line 895 sget v1, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v2, v1 div-long v2, v10, v2 int-to-long v4, v1 .line 896 rem-long v4, v10, v4 long-to-int v9, v4 .line 899 iget-wide v4, v0, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v1, v4, v2 if-eqz v1, :cond_1 .line 901 invoke-static {p0, v2, v3, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->access$findSegmentReceive(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v1 if-nez v1, :cond_0 goto :goto_0 :cond_0 move-object v8, v1 goto :goto_1 :cond_1 move-object v8, v0 :goto_1 move-object v0, p0 move-object v1, v8 move v2, v9 move-wide v3, v10 move-object v5, v6 .line 908 invoke-static/range {v0 .. v5}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellReceive(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object v0 .line 910 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-eq v0, v1, :cond_5 .line 916 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_3 .line 923 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v0 cmp-long v0, v10, v0 if-gez v0, :cond_2 invoke-virtual {v8}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V :cond_2 move-object v0, v8 goto :goto_0 .line 926 :cond_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND_NO_WAITER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_4 move-object v7, p0 move-object v12, p1 .line 685 invoke-virtual/range {v7 .. v12}, Lkotlinx/coroutines/channels/BufferedChannel;->receiveOnNoWaiterSuspend(Lkotlinx/coroutines/channels/ChannelSegment;IJLkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object p0 return-object p0 .line 935 :cond_4 invoke-virtual {v8}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V return-object v0 .line 914 :cond_5 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "unexpected" .line 679 invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 .line 681 :cond_6 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiveException()Ljava/lang/Throwable; move-result-object p0 invoke-static {p0}, Lkotlinx/coroutines/internal/StackTraceRecoveryKt;->recoverStackTrace(Ljava/lang/Throwable;)Ljava/lang/Throwable; move-result-object p0 throw p0 .end method .method public static synthetic receiveCatching-JP2dKIU$suspendImpl(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 14 instance-of v0, p1, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatching$1; if-eqz v0, :cond_0 move-object v0, p1 check-cast v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatching$1; iget v1, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatching$1;->label:I const/high16 v2, -0x80000000 and-int v3, v1, v2 if-eqz v3, :cond_0 sub-int/2addr v1, v2 iput v1, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatching$1;->label:I :goto_0 move-object v6, v0 goto :goto_1 :cond_0 new-instance v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatching$1; invoke-direct {v0, p0, p1}, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatching$1;->(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlin/coroutines/Continuation;)V goto :goto_0 :goto_1 iget-object p1, v6, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatching$1;->result:Ljava/lang/Object; invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v0 .line 731 iget v1, v6, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatching$1;->label:I const/4 v2, 0x1 if-eqz v1, :cond_2 if-ne v1, v2, :cond_1 invoke-static {p1}, Lkotlin/ResultKt;->throwOnFailure(Ljava/lang/Object;)V check-cast p1, Lkotlinx/coroutines/channels/ChannelResult; invoke-virtual {p1}, Lkotlinx/coroutines/channels/ChannelResult;->unbox-impl()Ljava/lang/Object; move-result-object p0 goto/16 :goto_4 :cond_1 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "call to \'resume\' before \'invoke\' with coroutine" invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 :cond_2 invoke-static {p1}, Lkotlin/ResultKt;->throwOnFailure(Ljava/lang/Object;)V const/4 p1, 0x0 .line 732 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceiveSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v1 .line 886 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 check-cast v1, Lkotlinx/coroutines/channels/ChannelSegment; .line 890 :goto_2 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForReceive()Z move-result v3 if-eqz v3, :cond_3 .line 738 sget-object p1, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getCloseCause()Ljava/lang/Throwable; move-result-object p0 invoke-virtual {p1, p0}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->closed-JP2dKIU(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object p0 goto/16 :goto_4 .line 890 :cond_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceivers$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v3 .line 893 invoke-virtual {v3, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J move-result-wide v4 .line 895 sget v3, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v7, v3 div-long v7, v4, v7 int-to-long v9, v3 .line 896 rem-long v9, v4, v9 long-to-int v3, v9 .line 899 iget-wide v9, v1, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v9, v9, v7 if-eqz v9, :cond_5 .line 901 invoke-static {p0, v7, v8, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->access$findSegmentReceive(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v7 if-nez v7, :cond_4 goto :goto_2 :cond_4 move-object v13, v7 goto :goto_3 :cond_5 move-object v13, v1 :goto_3 move-object v7, p0 move-object v8, v13 move v9, v3 move-wide v10, v4 move-object v12, p1 .line 908 invoke-static/range {v7 .. v12}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellReceive(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object v1 .line 910 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 if-eq v1, v7, :cond_a .line 916 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 if-ne v1, v7, :cond_7 .line 923 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v7 cmp-long v1, v4, v7 if-gez v1, :cond_6 invoke-virtual {v13}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V :cond_6 move-object v1, v13 goto :goto_2 .line 926 :cond_7 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND_NO_WAITER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 if-ne v1, p1, :cond_8 .line 739 iput v2, v6, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatching$1;->label:I move-object v1, p0 move-object v2, v13 invoke-virtual/range {v1 .. v6}, Lkotlinx/coroutines/channels/BufferedChannel;->receiveCatchingOnNoWaiterSuspend-GKJJFZk(Lkotlinx/coroutines/channels/ChannelSegment;IJLkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object p0 if-ne p0, v0, :cond_9 return-object v0 .line 935 :cond_8 invoke-virtual {v13}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 735 sget-object p0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p0 :cond_9 :goto_4 return-object p0 .line 914 :cond_a new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "unexpected" .line 737 invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 .end method .method public static synthetic send$suspendImpl(Lkotlinx/coroutines/channels/BufferedChannel;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 15 move-object v8, p0 const/4 v9, 0x0 .line 113 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getSendSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v0 .line 273 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Lkotlinx/coroutines/channels/ChannelSegment; .line 274 :cond_0 :goto_0 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getSendersAndCloseStatus$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v1 .line 277 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J move-result-wide v1 const-wide v3, 0xfffffffffffffffL and-long v10, v1, v3 .line 280 invoke-static {p0, v1, v2}, Lkotlinx/coroutines/channels/BufferedChannel;->access$isClosedForSend0(Lkotlinx/coroutines/channels/BufferedChannel;J)Z move-result v12 .line 282 sget v1, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v2, v1 div-long v2, v10, v2 int-to-long v4, v1 .line 283 rem-long v4, v10, v4 long-to-int v13, v4 .line 286 iget-wide v4, v0, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v1, v4, v2 if-eqz v1, :cond_2 .line 288 invoke-static {p0, v2, v3, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->access$findSegmentSend(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v1 if-nez v1, :cond_1 if-eqz v12, :cond_0 .line 126 invoke-virtual/range {p0 .. p2}, Lkotlinx/coroutines/channels/BufferedChannel;->onClosedSend(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object v0 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v1 if-ne v0, v1, :cond_9 return-object v0 :cond_1 move-object v14, v1 goto :goto_1 :cond_2 move-object v14, v0 :goto_1 move-object v0, p0 move-object v1, v14 move v2, v13 move-object/from16 v3, p1 move-wide v4, v10 move-object v6, v9 move v7, v12 .line 304 invoke-static/range {v0 .. v7}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellSend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I move-result v0 if-eqz v0, :cond_8 const/4 v1, 0x1 if-eq v0, v1, :cond_9 const/4 v1, 0x2 if-eq v0, v1, :cond_7 const/4 v1, 0x3 if-eq v0, v1, :cond_6 const/4 v1, 0x4 if-eq v0, v1, :cond_4 const/4 v1, 0x5 if-eq v0, v1, :cond_3 goto :goto_2 .line 341 :cond_3 invoke-virtual {v14}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V :goto_2 move-object v0, v14 goto :goto_0 .line 334 :cond_4 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v0 cmp-long v0, v10, v0 if-gez v0, :cond_5 invoke-virtual {v14}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 126 :cond_5 invoke-virtual/range {p0 .. p2}, Lkotlinx/coroutines/channels/BufferedChannel;->onClosedSend(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object v0 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v1 if-ne v0, v1, :cond_9 return-object v0 :cond_6 move-object v0, p0 move-object v1, v14 move v2, v13 move-object/from16 v3, p1 move-wide v4, v10 move-object/from16 v6, p2 .line 130 invoke-virtual/range {v0 .. v6}, Lkotlinx/coroutines/channels/BufferedChannel;->sendOnNoWaiterSuspend(Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object v0 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v1 if-ne v0, v1, :cond_9 return-object v0 :cond_7 if-eqz v12, :cond_9 .line 323 invoke-virtual {v14}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V .line 126 invoke-virtual/range {p0 .. p2}, Lkotlinx/coroutines/channels/BufferedChannel;->onClosedSend(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object v0 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v1 if-ne v0, v1, :cond_9 return-object v0 .line 310 :cond_8 invoke-virtual {v14}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 347 :cond_9 sget-object v0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; return-object v0 .end method # virtual methods .method public final bufferOrRendezvousSend(J)Z .locals 4 .line 614 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide v0 cmp-long v0, p1, v0 if-ltz v0, :cond_1 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v0 iget v2, p0, Lkotlinx/coroutines/channels/BufferedChannel;->capacity:I int-to-long v2, v2 add-long/2addr v0, v2 cmp-long p1, p1, v0 if-gez p1, :cond_0 goto :goto_0 :cond_0 const/4 p1, 0x0 goto :goto_1 :cond_1 :goto_0 const/4 p1, 0x1 :goto_1 return p1 .end method .method public final cancel(Ljava/util/concurrent/CancellationException;)V .locals 0 .line 1762 invoke-virtual {p0, p1}, Lkotlinx/coroutines/channels/BufferedChannel;->cancelImpl$kotlinx_coroutines_core(Ljava/lang/Throwable;)Z return-void .end method .method public cancelImpl$kotlinx_coroutines_core(Ljava/lang/Throwable;)Z .locals 1 if-nez p1, :cond_0 .line 1765 new-instance p1, Ljava/util/concurrent/CancellationException; const-string v0, "Channel was cancelled" invoke-direct {p1, v0}, Ljava/util/concurrent/CancellationException;->(Ljava/lang/String;)V :cond_0 const/4 v0, 0x1 invoke-virtual {p0, p1, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->closeOrCancelImpl(Ljava/lang/Throwable;Z)Z move-result p1 return p1 .end method .method public final cancelSuspendedReceiveRequests(Lkotlinx/coroutines/channels/ChannelSegment;J)V .locals 8 const/4 v0, 0x0 const/4 v1, 0x1 .line 2115 invoke-static {v0, v1, v0}, Lkotlinx/coroutines/internal/InlineList;->constructor-impl$default(Ljava/lang/Object;ILkotlin/jvm/internal/DefaultConstructorMarker;)Ljava/lang/Object; move-result-object v0 :goto_0 const/4 v2, -0x1 if-eqz p1, :cond_6 .line 2118 sget v3, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I sub-int/2addr v3, v1 :goto_1 if-ge v2, v3, :cond_5 .line 2120 iget-wide v4, p1, Lkotlinx/coroutines/internal/Segment;->id:J sget v6, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v6, v6 mul-long/2addr v4, v6 int-to-long v6, v3 add-long/2addr v4, v6 cmp-long v4, v4, p2 if-ltz v4, :cond_6 .line 2123 :cond_0 invoke-virtual {p1, v3}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v4 if-eqz v4, :cond_3 .line 2125 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getIN_BUFFER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v5 if-ne v4, v5, :cond_1 goto :goto_2 .line 2131 :cond_1 instance-of v5, v4, Lkotlinx/coroutines/channels/WaiterEB; if-eqz v5, :cond_2 .line 2132 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v5 invoke-virtual {p1, v3, v4, v5}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v5 if-eqz v5, :cond_0 .line 2133 check-cast v4, Lkotlinx/coroutines/channels/WaiterEB; iget-object v4, v4, Lkotlinx/coroutines/channels/WaiterEB;->waiter:Lkotlinx/coroutines/Waiter; invoke-static {v0, v4}, Lkotlinx/coroutines/internal/InlineList;->plus-FjFbRPM(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 .line 2134 invoke-virtual {p1, v3, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->onCancelledRequest(IZ)V goto :goto_3 .line 2138 :cond_2 instance-of v5, v4, Lkotlinx/coroutines/Waiter; if-eqz v5, :cond_4 .line 2139 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v5 invoke-virtual {p1, v3, v4, v5}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v5 if-eqz v5, :cond_0 .line 2140 invoke-static {v0, v4}, Lkotlinx/coroutines/internal/InlineList;->plus-FjFbRPM(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 .line 2141 invoke-virtual {p1, v3, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->onCancelledRequest(IZ)V goto :goto_3 .line 2126 :cond_3 :goto_2 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v5 invoke-virtual {p1, v3, v4, v5}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v4 if-eqz v4, :cond_0 .line 2127 invoke-virtual {p1}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V :cond_4 :goto_3 add-int/lit8 v3, v3, -0x1 goto :goto_1 .line 2150 :cond_5 invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->getPrev()Lkotlinx/coroutines/internal/ConcurrentLinkedListNode; move-result-object p1 check-cast p1, Lkotlinx/coroutines/channels/ChannelSegment; goto :goto_0 :cond_6 if-eqz v0, :cond_8 .line 39 instance-of p1, v0, Ljava/util/ArrayList; if-nez p1, :cond_7 check-cast v0, Lkotlinx/coroutines/Waiter; .line 2153 invoke-virtual {p0, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->resumeReceiverOnClosedChannel(Lkotlinx/coroutines/Waiter;)V goto :goto_5 :cond_7 const-string p1, "null cannot be cast to non-null type java.util.ArrayList{ kotlin.collections.TypeAliasesKt.ArrayList }" .line 41 invoke-static {v0, p1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V check-cast v0, Ljava/util/ArrayList; .line 42 invoke-virtual {v0}, Ljava/util/ArrayList;->size()I move-result p1 sub-int/2addr p1, v1 :goto_4 if-ge v2, p1, :cond_8 .line 43 invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object; move-result-object p2 check-cast p2, Lkotlinx/coroutines/Waiter; .line 2153 invoke-virtual {p0, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->resumeReceiverOnClosedChannel(Lkotlinx/coroutines/Waiter;)V add-int/lit8 p1, p1, -0x1 goto :goto_4 :cond_8 :goto_5 return-void .end method .method public close(Ljava/lang/Throwable;)Z .locals 1 const/4 v0, 0x0 .line 1754 invoke-virtual {p0, p1, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->closeOrCancelImpl(Ljava/lang/Throwable;Z)Z move-result p1 return p1 .end method .method public final closeLinkedList()Lkotlinx/coroutines/channels/ChannelSegment; .locals 6 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEndSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 1953 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->sendSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 1954 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 check-cast v1, Lkotlinx/coroutines/channels/ChannelSegment; iget-wide v2, v1, Lkotlinx/coroutines/internal/Segment;->id:J move-object v4, v0 check-cast v4, Lkotlinx/coroutines/channels/ChannelSegment; iget-wide v4, v4, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v2, v2, v4 if-lez v2, :cond_0 move-object v0, v1 :cond_0 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->receiveSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 1955 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 check-cast v1, Lkotlinx/coroutines/channels/ChannelSegment; iget-wide v2, v1, Lkotlinx/coroutines/internal/Segment;->id:J move-object v4, v0 check-cast v4, Lkotlinx/coroutines/channels/ChannelSegment; iget-wide v4, v4, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v2, v2, v4 if-lez v2, :cond_1 move-object v0, v1 .line 1958 :cond_1 check-cast v0, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode; invoke-static {v0}, Lkotlinx/coroutines/internal/ConcurrentLinkedListKt;->close(Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;)Lkotlinx/coroutines/internal/ConcurrentLinkedListNode; move-result-object v0 check-cast v0, Lkotlinx/coroutines/channels/ChannelSegment; return-object v0 .end method .method public closeOrCancelImpl(Ljava/lang/Throwable;Z)Z .locals 2 if-eqz p2, :cond_0 .line 1788 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->markCancellationStarted()V :cond_0 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->_closeCause$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 1791 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getNO_CLOSE_CAUSE$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 invoke-static {v0, p0, v1, p1}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result p1 if-eqz p2, :cond_1 .line 1793 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->markCancelled()V goto :goto_0 :cond_1 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->markClosed()V .line 1795 :goto_0 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->completeCloseOrCancel()V .line 1799 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->onClosedIdempotent()V if-eqz p1, :cond_2 .line 1800 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->invokeCloseHandler()V :cond_2 return p1 .end method .method public final completeCancel(J)V .locals 0 .line 1942 invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->completeClose(J)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object p1 .line 1945 invoke-virtual {p0, p1}, Lkotlinx/coroutines/channels/BufferedChannel;->removeUnprocessedElements(Lkotlinx/coroutines/channels/ChannelSegment;)V return-void .end method .method public final completeClose(J)Lkotlinx/coroutines/channels/ChannelSegment; .locals 5 .line 1913 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->closeLinkedList()Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v0 .line 1923 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isConflatedDropOldest()Z move-result v1 if-eqz v1, :cond_0 .line 1924 invoke-virtual {p0, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->markAllEmptyCellsAsClosed(Lkotlinx/coroutines/channels/ChannelSegment;)J move-result-wide v1 const-wide/16 v3, -0x1 cmp-long v3, v1, v3 if-eqz v3, :cond_0 .line 1926 invoke-virtual {p0, v1, v2}, Lkotlinx/coroutines/channels/BufferedChannel;->dropFirstElementUntilTheSpecifiedCellIsInTheBuffer(J)V .line 1930 :cond_0 invoke-virtual {p0, v0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->cancelSuspendedReceiveRequests(Lkotlinx/coroutines/channels/ChannelSegment;J)V return-object v0 .end method .method public final completeCloseOrCancel()V .locals 0 .line 1902 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForSend()Z return-void .end method .method public final dropFirstElementUntilTheSpecifiedCellIsInTheBuffer(J)V .locals 10 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receiveSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 810 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Lkotlinx/coroutines/channels/ChannelSegment; :cond_0 :goto_0 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 814 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v8 iget v2, p0, Lkotlinx/coroutines/channels/BufferedChannel;->capacity:I int-to-long v2, v2 add-long/2addr v2, v8 .line 815 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide v4 invoke-static {v2, v3, v4, v5}, Ljava/lang/Math;->max(JJ)J move-result-wide v2 cmp-long v2, p1, v2 if-gez v2, :cond_1 return-void :cond_1 const-wide/16 v2, 0x1 add-long v5, v8, v2 move-object v2, p0 move-wide v3, v8 .line 818 invoke-virtual/range {v1 .. v6}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result v1 if-eqz v1, :cond_0 .line 820 sget v1, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v2, v1 div-long v2, v8, v2 int-to-long v4, v1 .line 821 rem-long v4, v8, v4 long-to-int v4, v4 .line 824 iget-wide v5, v0, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v1, v5, v2 if-eqz v1, :cond_3 .line 826 invoke-virtual {p0, v2, v3, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->findSegmentReceive(JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v1 if-nez v1, :cond_2 goto :goto_0 :cond_2 move-object v0, v1 :cond_3 const/4 v7, 0x0 move-object v2, p0 move-object v3, v0 move-wide v5, v8 .line 836 invoke-virtual/range {v2 .. v7}, Lkotlinx/coroutines/channels/BufferedChannel;->updateCellReceive(Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object v1 .line 838 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 if-ne v1, v2, :cond_4 .line 842 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v1 cmp-long v1, v8, v1 if-gez v1, :cond_0 invoke-virtual {v0}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_0 .line 847 :cond_4 invoke-virtual {v0}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V iget-object v2, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-eqz v2, :cond_0 const/4 v3, 0x2 const/4 v4, 0x0 .line 849 invoke-static {v2, v1, v4, v3, v4}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->callUndeliveredElementCatchingException$default(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlinx/coroutines/internal/UndeliveredElementException;ILjava/lang/Object;)Lkotlinx/coroutines/internal/UndeliveredElementException; move-result-object v1 if-nez v1, :cond_5 goto :goto_0 :cond_5 throw v1 .end method .method public final expandBuffer()V .locals 14 .line 1173 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isRendezvousOrUnlimited()Z move-result v0 if-eqz v0, :cond_0 return-void :cond_0 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEndSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 1176 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Lkotlinx/coroutines/channels/ChannelSegment; :goto_0 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEnd$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1181 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J move-result-wide v7 .line 1182 sget v9, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v1, v9 div-long v2, v7, v1 .line 1190 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v4 cmp-long v1, v4, v7 const/4 v10, 0x0 const/4 v11, 0x1 const-wide/16 v12, 0x0 if-gtz v1, :cond_2 .line 1193 iget-wide v4, v0, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v1, v4, v2 if-gez v1, :cond_1 invoke-virtual {v0}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->getNext()Lkotlinx/coroutines/internal/ConcurrentLinkedListNode; move-result-object v1 if-eqz v1, :cond_1 .line 1194 invoke-virtual {p0, v2, v3, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->moveSegmentBufferEndToSpecifiedOrLast(JLkotlinx/coroutines/channels/ChannelSegment;)V .line 1196 :cond_1 invoke-static {p0, v12, v13, v11, v10}, Lkotlinx/coroutines/channels/BufferedChannel;->incCompletedExpandBufferAttempts$default(Lkotlinx/coroutines/channels/BufferedChannel;JILjava/lang/Object;)V return-void .line 1201 :cond_2 iget-wide v4, v0, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v1, v4, v2 if-eqz v1, :cond_4 move-object v1, p0 move-object v4, v0 move-wide v5, v7 .line 1202 invoke-virtual/range {v1 .. v6}, Lkotlinx/coroutines/channels/BufferedChannel;->findSegmentBufferEnd(JLkotlinx/coroutines/channels/ChannelSegment;J)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v1 if-nez v1, :cond_3 goto :goto_0 :cond_3 move-object v0, v1 :cond_4 int-to-long v1, v9 .line 1213 rem-long v1, v7, v1 long-to-int v1, v1 .line 1214 invoke-virtual {p0, v0, v1, v7, v8}, Lkotlinx/coroutines/channels/BufferedChannel;->updateCellExpandBuffer(Lkotlinx/coroutines/channels/ChannelSegment;IJ)Z move-result v1 if-eqz v1, :cond_5 .line 1222 invoke-static {p0, v12, v13, v11, v10}, Lkotlinx/coroutines/channels/BufferedChannel;->incCompletedExpandBufferAttempts$default(Lkotlinx/coroutines/channels/BufferedChannel;JILjava/lang/Object;)V return-void .line 1228 :cond_5 invoke-static {p0, v12, v13, v11, v10}, Lkotlinx/coroutines/channels/BufferedChannel;->incCompletedExpandBufferAttempts$default(Lkotlinx/coroutines/channels/BufferedChannel;JILjava/lang/Object;)V goto :goto_0 .end method .method public final findSegmentBufferEnd(JLkotlinx/coroutines/channels/ChannelSegment;J)Lkotlinx/coroutines/channels/ChannelSegment; .locals 15 move-object v6, p0 move-wide/from16 v0, p1 sget-object v2, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEndSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 2465 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->createSegmentFunction()Lkotlin/reflect/KFunction; move-result-object v3 check-cast v3, Lkotlin/jvm/functions/Function2; move-object/from16 v4, p3 .line 73 :goto_0 invoke-static {v4, v0, v1, v3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListKt;->findSegmentInternal(Lkotlinx/coroutines/internal/Segment;JLkotlin/jvm/functions/Function2;)Ljava/lang/Object; move-result-object v5 .line 74 invoke-static {v5}, Lkotlinx/coroutines/internal/SegmentOrClosed;->isClosed-impl(Ljava/lang/Object;)Z move-result v7 if-nez v7, :cond_4 invoke-static {v5}, Lkotlinx/coroutines/internal/SegmentOrClosed;->getSegment-impl(Ljava/lang/Object;)Lkotlinx/coroutines/internal/Segment; move-result-object v7 :cond_0 :goto_1 invoke-virtual {v2, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v8 check-cast v8, Lkotlinx/coroutines/internal/Segment; .line 46 iget-wide v9, v8, Lkotlinx/coroutines/internal/Segment;->id:J iget-wide v11, v7, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v9, v9, v11 if-ltz v9, :cond_1 goto :goto_2 .line 47 :cond_1 invoke-virtual {v7}, Lkotlinx/coroutines/internal/Segment;->tryIncPointers$kotlinx_coroutines_core()Z move-result v9 if-nez v9, :cond_2 goto :goto_0 .line 48 :cond_2 invoke-static {v2, p0, v8, v7}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v9 if-eqz v9, :cond_3 .line 49 invoke-virtual {v8}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result v2 if-eqz v2, :cond_4 invoke-virtual {v8}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V goto :goto_2 .line 52 :cond_3 invoke-virtual {v7}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result v8 if-eqz v8, :cond_0 invoke-virtual {v7}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V goto :goto_1 .line 2466 :cond_4 :goto_2 invoke-static {v5}, Lkotlinx/coroutines/internal/SegmentOrClosed;->isClosed-impl(Ljava/lang/Object;)Z move-result v2 const/4 v7, 0x1 const-wide/16 v8, 0x0 const/4 v10, 0x0 if-eqz v2, :cond_5 .line 2471 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->completeCloseOrCancel()V .line 2474 invoke-virtual/range {p0 .. p3}, Lkotlinx/coroutines/channels/BufferedChannel;->moveSegmentBufferEndToSpecifiedOrLast(JLkotlinx/coroutines/channels/ChannelSegment;)V .line 2477 invoke-static {p0, v8, v9, v7, v10}, Lkotlinx/coroutines/channels/BufferedChannel;->incCompletedExpandBufferAttempts$default(Lkotlinx/coroutines/channels/BufferedChannel;JILjava/lang/Object;)V goto :goto_3 .line 2481 :cond_5 invoke-static {v5}, Lkotlinx/coroutines/internal/SegmentOrClosed;->getSegment-impl(Ljava/lang/Object;)Lkotlinx/coroutines/internal/Segment; move-result-object v2 move-object v11, v2 check-cast v11, Lkotlinx/coroutines/channels/ChannelSegment; .line 2483 iget-wide v2, v11, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v0, v2, v0 if-lez v0, :cond_7 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEnd$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; const-wide/16 v4, 0x1 add-long v4, p4, v4 .line 2489 sget v12, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v13, v12 mul-long/2addr v13, v2 move-object v1, p0 move-wide v2, v4 move-wide v4, v13 invoke-virtual/range {v0 .. v5}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result v0 if-eqz v0, :cond_6 .line 2490 iget-wide v0, v11, Lkotlinx/coroutines/internal/Segment;->id:J int-to-long v2, v12 mul-long/2addr v0, v2 sub-long v0, v0, p4 invoke-virtual {p0, v0, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->incCompletedExpandBufferAttempts(J)V goto :goto_3 .line 2492 :cond_6 invoke-static {p0, v8, v9, v7, v10}, Lkotlinx/coroutines/channels/BufferedChannel;->incCompletedExpandBufferAttempts$default(Lkotlinx/coroutines/channels/BufferedChannel;JILjava/lang/Object;)V goto :goto_3 :cond_7 move-object v10, v11 :goto_3 return-object v10 .end method .method public final findSegmentReceive(JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; .locals 9 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receiveSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 2416 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->createSegmentFunction()Lkotlin/reflect/KFunction; move-result-object v1 check-cast v1, Lkotlin/jvm/functions/Function2; .line 73 :goto_0 invoke-static {p3, p1, p2, v1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListKt;->findSegmentInternal(Lkotlinx/coroutines/internal/Segment;JLkotlin/jvm/functions/Function2;)Ljava/lang/Object; move-result-object v2 .line 74 invoke-static {v2}, Lkotlinx/coroutines/internal/SegmentOrClosed;->isClosed-impl(Ljava/lang/Object;)Z move-result v3 if-nez v3, :cond_4 invoke-static {v2}, Lkotlinx/coroutines/internal/SegmentOrClosed;->getSegment-impl(Ljava/lang/Object;)Lkotlinx/coroutines/internal/Segment; move-result-object v3 :cond_0 :goto_1 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v4 check-cast v4, Lkotlinx/coroutines/internal/Segment; .line 46 iget-wide v5, v4, Lkotlinx/coroutines/internal/Segment;->id:J iget-wide v7, v3, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v5, v5, v7 if-ltz v5, :cond_1 goto :goto_2 .line 47 :cond_1 invoke-virtual {v3}, Lkotlinx/coroutines/internal/Segment;->tryIncPointers$kotlinx_coroutines_core()Z move-result v5 if-nez v5, :cond_2 goto :goto_0 .line 48 :cond_2 invoke-static {v0, p0, v4, v3}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v5 if-eqz v5, :cond_3 .line 49 invoke-virtual {v4}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result v0 if-eqz v0, :cond_4 invoke-virtual {v4}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V goto :goto_2 .line 52 :cond_3 invoke-virtual {v3}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result v4 if-eqz v4, :cond_0 invoke-virtual {v3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V goto :goto_1 .line 2417 :cond_4 :goto_2 invoke-static {v2}, Lkotlinx/coroutines/internal/SegmentOrClosed;->isClosed-impl(Ljava/lang/Object;)Z move-result v0 const/4 v1, 0x0 if-eqz v0, :cond_5 .line 2422 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->completeCloseOrCancel()V .line 2428 iget-wide p1, p3, Lkotlinx/coroutines/internal/Segment;->id:J sget v0, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v2, v0 mul-long/2addr p1, v2 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v2 cmp-long p1, p1, v2 if-gez p1, :cond_a invoke-virtual {p3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_5 .line 2433 :cond_5 invoke-static {v2}, Lkotlinx/coroutines/internal/SegmentOrClosed;->getSegment-impl(Ljava/lang/Object;)Lkotlinx/coroutines/internal/Segment; move-result-object p3 check-cast p3, Lkotlinx/coroutines/channels/ChannelSegment; .line 2435 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isRendezvousOrUnlimited()Z move-result v0 if-nez v0, :cond_8 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide v2 sget v0, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v4, v0 div-long/2addr v2, v4 cmp-long v0, p1, v2 if-gtz v0, :cond_8 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEndSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; :cond_6 :goto_3 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v2 check-cast v2, Lkotlinx/coroutines/internal/Segment; .line 46 iget-wide v3, v2, Lkotlinx/coroutines/internal/Segment;->id:J iget-wide v5, p3, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v3, v3, v5 if-gez v3, :cond_8 .line 47 invoke-virtual {p3}, Lkotlinx/coroutines/internal/Segment;->tryIncPointers$kotlinx_coroutines_core()Z move-result v3 if-eqz v3, :cond_8 .line 48 invoke-static {v0, p0, v2, p3}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v3 if-eqz v3, :cond_7 .line 49 invoke-virtual {v2}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result v0 if-eqz v0, :cond_8 invoke-virtual {v2}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V goto :goto_4 .line 52 :cond_7 invoke-virtual {p3}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result v2 if-eqz v2, :cond_6 invoke-virtual {p3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V goto :goto_3 .line 2439 :cond_8 :goto_4 iget-wide v2, p3, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long p1, v2, p1 if-lez p1, :cond_9 .line 2443 sget p1, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v4, p1 mul-long/2addr v2, v4 invoke-virtual {p0, v2, v3}, Lkotlinx/coroutines/channels/BufferedChannel;->updateReceiversCounterIfLower(J)V .line 2449 iget-wide v2, p3, Lkotlinx/coroutines/internal/Segment;->id:J int-to-long p1, p1 mul-long/2addr v2, p1 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide p1 cmp-long p1, v2, p1 if-gez p1, :cond_a invoke-virtual {p3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_5 :cond_9 move-object v1, p3 :cond_a :goto_5 return-object v1 .end method .method public final findSegmentSend(JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; .locals 9 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 2361 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->createSegmentFunction()Lkotlin/reflect/KFunction; move-result-object v1 check-cast v1, Lkotlin/jvm/functions/Function2; .line 73 :goto_0 invoke-static {p3, p1, p2, v1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListKt;->findSegmentInternal(Lkotlinx/coroutines/internal/Segment;JLkotlin/jvm/functions/Function2;)Ljava/lang/Object; move-result-object v2 .line 74 invoke-static {v2}, Lkotlinx/coroutines/internal/SegmentOrClosed;->isClosed-impl(Ljava/lang/Object;)Z move-result v3 if-nez v3, :cond_4 invoke-static {v2}, Lkotlinx/coroutines/internal/SegmentOrClosed;->getSegment-impl(Ljava/lang/Object;)Lkotlinx/coroutines/internal/Segment; move-result-object v3 :cond_0 :goto_1 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v4 check-cast v4, Lkotlinx/coroutines/internal/Segment; .line 46 iget-wide v5, v4, Lkotlinx/coroutines/internal/Segment;->id:J iget-wide v7, v3, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v5, v5, v7 if-ltz v5, :cond_1 goto :goto_2 .line 47 :cond_1 invoke-virtual {v3}, Lkotlinx/coroutines/internal/Segment;->tryIncPointers$kotlinx_coroutines_core()Z move-result v5 if-nez v5, :cond_2 goto :goto_0 .line 48 :cond_2 invoke-static {v0, p0, v4, v3}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v5 if-eqz v5, :cond_3 .line 49 invoke-virtual {v4}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result v0 if-eqz v0, :cond_4 invoke-virtual {v4}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V goto :goto_2 .line 52 :cond_3 invoke-virtual {v3}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result v4 if-eqz v4, :cond_0 invoke-virtual {v3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V goto :goto_1 .line 2362 :cond_4 :goto_2 invoke-static {v2}, Lkotlinx/coroutines/internal/SegmentOrClosed;->isClosed-impl(Ljava/lang/Object;)Z move-result v0 const/4 v1, 0x0 if-eqz v0, :cond_5 .line 2367 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->completeCloseOrCancel()V .line 2373 iget-wide p1, p3, Lkotlinx/coroutines/internal/Segment;->id:J sget v0, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v2, v0 mul-long/2addr p1, v2 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v2 cmp-long p1, p1, v2 if-gez p1, :cond_7 invoke-virtual {p3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_3 .line 2378 :cond_5 invoke-static {v2}, Lkotlinx/coroutines/internal/SegmentOrClosed;->getSegment-impl(Ljava/lang/Object;)Lkotlinx/coroutines/internal/Segment; move-result-object p3 check-cast p3, Lkotlinx/coroutines/channels/ChannelSegment; .line 2380 iget-wide v2, p3, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long p1, v2, p1 if-lez p1, :cond_6 .line 2384 sget p1, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v4, p1 mul-long/2addr v2, v4 invoke-virtual {p0, v2, v3}, Lkotlinx/coroutines/channels/BufferedChannel;->updateSendersCounterIfLower(J)V .line 2390 iget-wide v2, p3, Lkotlinx/coroutines/internal/Segment;->id:J int-to-long p1, p1 mul-long/2addr v2, p1 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide p1 cmp-long p1, v2, p1 if-gez p1, :cond_7 invoke-virtual {p3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_3 :cond_6 move-object v1, p3 :cond_7 :goto_3 return-object v1 .end method .method public final getBufferEndCounter()J .locals 2 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEnd$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 72 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v0 return-wide v0 .end method .method public final getCloseCause()Ljava/lang/Throwable; .locals 1 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->_closeCause$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 1723 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/lang/Throwable; return-object v0 .end method .method public final getReceiveException()Ljava/lang/Throwable; .locals 2 .line 1729 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getCloseCause()Ljava/lang/Throwable; move-result-object v0 if-nez v0, :cond_0 new-instance v0, Lkotlinx/coroutines/channels/ClosedReceiveChannelException; const-string v1, "Channel was closed" invoke-direct {v0, v1}, Lkotlinx/coroutines/channels/ClosedReceiveChannelException;->(Ljava/lang/String;)V :cond_0 return-object v0 .end method .method public final getReceiversCounter$kotlinx_coroutines_core()J .locals 2 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 71 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v0 return-wide v0 .end method .method public final getSendException()Ljava/lang/Throwable; .locals 2 .line 1726 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getCloseCause()Ljava/lang/Throwable; move-result-object v0 if-nez v0, :cond_0 new-instance v0, Lkotlinx/coroutines/channels/ClosedSendChannelException; const-string v1, "Channel was closed" invoke-direct {v0, v1}, Lkotlinx/coroutines/channels/ClosedSendChannelException;->(Ljava/lang/String;)V :cond_0 return-object v0 .end method .method public final getSendersCounter$kotlinx_coroutines_core()J .locals 4 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 70 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v0 const-wide v2, 0xfffffffffffffffL and-long/2addr v0, v2 return-wide v0 .end method .method public final hasElements$kotlinx_coroutines_core()Z .locals 10 :cond_0 :goto_0 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receiveSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 2249 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 check-cast v1, Lkotlinx/coroutines/channels/ChannelSegment; .line 2251 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v4 .line 2252 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v2 cmp-long v2, v2, v4 const/4 v3, 0x0 if-gtz v2, :cond_1 return v3 .line 2258 :cond_1 sget v2, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v6, v2 div-long v6, v4, v6 .line 2259 iget-wide v8, v1, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v8, v8, v6 if-eqz v8, :cond_2 .line 2261 invoke-virtual {p0, v6, v7, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->findSegmentReceive(JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v1 if-nez v1, :cond_2 .line 2267 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Lkotlinx/coroutines/channels/ChannelSegment; iget-wide v0, v0, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v0, v0, v6 if-gez v0, :cond_0 return v3 .line 2269 :cond_2 invoke-virtual {v1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V int-to-long v2, v2 .line 2271 rem-long v2, v4, v2 long-to-int v0, v2 .line 2272 invoke-virtual {p0, v1, v0, v4, v5}, Lkotlinx/coroutines/channels/BufferedChannel;->isCellNonEmpty(Lkotlinx/coroutines/channels/ChannelSegment;IJ)Z move-result v0 if-eqz v0, :cond_3 const/4 v0, 0x1 return v0 :cond_3 sget-object v2, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; const-wide/16 v0, 0x1 add-long v6, v4, v0 move-object v3, p0 .line 2274 invoke-virtual/range {v2 .. v7}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z goto :goto_0 .end method .method public final incCompletedExpandBufferAttempts(J)V .locals 4 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->completedExpandBuffersAndPauseFlag$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1370 invoke-virtual {v0, p0, p1, p2}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->addAndGet(Ljava/lang/Object;J)J move-result-wide p1 const-wide/high16 v0, 0x4000000000000000L # 2.0 and-long/2addr p1, v0 const-wide/16 v2, 0x0 cmp-long p1, p1, v2 if-eqz p1, :cond_0 :goto_0 sget-object p1, Lkotlinx/coroutines/channels/BufferedChannel;->completedExpandBuffersAndPauseFlag$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1376 invoke-virtual {p1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide p1 and-long/2addr p1, v0 cmp-long p1, p1, v2 if-eqz p1, :cond_0 goto :goto_0 :cond_0 return-void .end method .method public final invokeCloseHandler()V .locals 3 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->closeHandler$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 1809 :cond_0 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 if-nez v1, :cond_1 .line 1813 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getCLOSE_HANDLER_CLOSED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 goto :goto_0 .line 1817 :cond_1 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getCLOSE_HANDLER_INVOKED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 .line 1810 :goto_0 invoke-static {v0, p0, v1, v2}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v2 if-eqz v2, :cond_0 if-nez v1, :cond_2 return-void :cond_2 const/4 v0, 0x1 .line 1822 invoke-static {v1, v0}, Lkotlin/jvm/internal/TypeIntrinsics;->beforeCheckcastToFunctionOfArity(Ljava/lang/Object;I)Ljava/lang/Object; move-result-object v0 check-cast v0, Lkotlin/jvm/functions/Function1; .line 1823 check-cast v1, Lkotlin/jvm/functions/Function1; invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getCloseCause()Ljava/lang/Throwable; move-result-object v0 invoke-interface {v1, v0}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object; return-void .end method .method public invokeOnClose(Lkotlin/jvm/functions/Function1;)V .locals 4 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->closeHandler$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; const/4 v1, 0x0 .line 1828 invoke-static {v0, p0, v1, p1}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_0 return-void .line 1830 :cond_0 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 .line 1839 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getCLOSE_HANDLER_CLOSED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 if-ne v1, v2, :cond_1 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->closeHandler$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 1843 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getCLOSE_HANDLER_CLOSED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getCLOSE_HANDLER_INVOKED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v3 invoke-static {v1, p0, v2, v3}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_0 .line 1844 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getCloseCause()Ljava/lang/Throwable; move-result-object v0 invoke-interface {p1, v0}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object; return-void .line 1848 :cond_1 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getCLOSE_HANDLER_INVOKED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 if-ne v1, p1, :cond_2 new-instance p1, Ljava/lang/IllegalStateException; const-string v0, "Another handler was already registered and successfully invoked" invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p1 :cond_2 new-instance p1, Ljava/lang/IllegalStateException; .line 1849 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v2, "Another handler is already registered: " invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p1 .end method .method public final isCellNonEmpty(Lkotlinx/coroutines/channels/ChannelSegment;IJ)Z .locals 4 .line 2295 :cond_0 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v0 const/4 v1, 0x0 if-eqz v0, :cond_a .line 2298 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getIN_BUFFER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 if-ne v0, v2, :cond_1 goto :goto_0 .line 2309 :cond_1 sget-object p1, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; const/4 p2, 0x1 if-ne v0, p1, :cond_2 return p2 .line 2311 :cond_2 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_SEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 if-ne v0, p1, :cond_3 return v1 .line 2313 :cond_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 if-ne v0, p1, :cond_4 return v1 .line 2316 :cond_4 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getDONE_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 if-ne v0, p1, :cond_5 return v1 .line 2319 :cond_5 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getPOISONED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 if-ne v0, p1, :cond_6 return v1 .line 2323 :cond_6 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_EB$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 if-ne v0, p1, :cond_7 return p2 .line 2327 :cond_7 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 if-ne v0, p1, :cond_8 return v1 .line 2338 :cond_8 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v2 cmp-long p1, p3, v2 if-nez p1, :cond_9 move v1, p2 :cond_9 return v1 .line 2300 :cond_a :goto_0 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getPOISONED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 invoke-virtual {p1, p2, v0, v2}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 .line 2304 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->expandBuffer()V return v1 .end method .method public final isClosed(JZ)Z .locals 6 const/16 v0, 0x3c shr-long v0, p1, v0 long-to-int v0, v0 const/4 v1, 0x0 if-eqz v0, :cond_3 const/4 v2, 0x1 if-eq v0, v2, :cond_3 const/4 v3, 0x2 const-wide v4, 0xfffffffffffffffL if-eq v0, v3, :cond_2 const/4 p3, 0x3 if-ne v0, p3, :cond_1 and-long/2addr p1, v4 .line 2219 invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->completeCancel(J)V :cond_0 :goto_0 move v1, v2 goto :goto_1 .line 2222 :cond_1 new-instance p1, Ljava/lang/StringBuilder; invoke-direct {p1}, Ljava/lang/StringBuilder;->()V const-string p2, "unexpected close status: " invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 new-instance p2, Ljava/lang/IllegalStateException; invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p2, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p2 :cond_2 and-long/2addr p1, v4 .line 2209 invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->completeClose(J)Lkotlinx/coroutines/channels/ChannelSegment; if-eqz p3, :cond_0 .line 2213 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->hasElements$kotlinx_coroutines_core()Z move-result p1 if-nez p1, :cond_3 goto :goto_0 :cond_3 :goto_1 return v1 .end method .method public isClosedForReceive()Z .locals 2 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 2188 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v0 invoke-virtual {p0, v0, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForReceive0(J)Z move-result v0 return v0 .end method .method public final isClosedForReceive0(J)Z .locals 1 const/4 v0, 0x1 .line 2191 invoke-virtual {p0, p1, p2, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosed(JZ)Z move-result p1 return p1 .end method .method public isClosedForSend()Z .locals 2 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 2181 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v0 invoke-virtual {p0, v0, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForSend0(J)Z move-result v0 return v0 .end method .method public final isClosedForSend0(J)Z .locals 1 const/4 v0, 0x0 .line 2184 invoke-virtual {p0, p1, p2, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosed(JZ)Z move-result p1 return p1 .end method .method public isConflatedDropOldest()Z .locals 1 const/4 v0, 0x0 return v0 .end method .method public final isRendezvousOrUnlimited()Z .locals 4 .line 90 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide v0 const-wide/16 v2, 0x0 cmp-long v2, v0, v2 if-eqz v2, :cond_1 const-wide v2, 0x7fffffffffffffffL cmp-long v0, v0, v2 if-nez v0, :cond_0 goto :goto_0 :cond_0 const/4 v0, 0x0 goto :goto_1 :cond_1 :goto_0 const/4 v0, 0x1 :goto_1 return v0 .end method .method public iterator()Lkotlinx/coroutines/channels/ChannelIterator; .locals 1 .line 1551 new-instance v0, Lkotlinx/coroutines/channels/BufferedChannel$BufferedChannelIterator; invoke-direct {v0, p0}, Lkotlinx/coroutines/channels/BufferedChannel$BufferedChannelIterator;->(Lkotlinx/coroutines/channels/BufferedChannel;)V return-object v0 .end method .method public final markAllEmptyCellsAsClosed(Lkotlinx/coroutines/channels/ChannelSegment;)J .locals 7 .line 1974 :cond_0 sget v0, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I add-int/lit8 v0, v0, -0x1 :goto_0 const-wide/16 v1, -0x1 const/4 v3, -0x1 if-ge v3, v0, :cond_5 .line 1976 iget-wide v3, p1, Lkotlinx/coroutines/internal/Segment;->id:J sget v5, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v5, v5 mul-long/2addr v3, v5 int-to-long v5, v0 add-long/2addr v3, v5 .line 1977 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v5 cmp-long v5, v3, v5 if-gez v5, :cond_1 return-wide v1 .line 1980 :cond_1 invoke-virtual {p1, v0}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v1 if-eqz v1, :cond_3 .line 1983 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getIN_BUFFER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 if-ne v1, v2, :cond_2 goto :goto_1 .line 1991 :cond_2 sget-object v2, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; if-ne v1, v2, :cond_4 return-wide v3 .line 1985 :cond_3 :goto_1 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 invoke-virtual {p1, v0, v1, v2}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_1 .line 1986 invoke-virtual {p1}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V :cond_4 add-int/lit8 v0, v0, -0x1 goto :goto_0 .line 1998 :cond_5 invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->getPrev()Lkotlinx/coroutines/internal/ConcurrentLinkedListNode; move-result-object p1 check-cast p1, Lkotlinx/coroutines/channels/ChannelSegment; if-nez p1, :cond_0 return-wide v1 .end method .method public final markCancellationStarted()V .locals 7 sget-object v6, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; :cond_0 invoke-virtual {v6, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v2 const/16 v0, 0x3c shr-long v0, v2, v0 long-to-int v0, v0 if-nez v0, :cond_1 const-wide v0, 0xfffffffffffffffL and-long/2addr v0, v2 const/4 v4, 0x1 .line 1894 invoke-static {v0, v1, v4}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$constructSendersAndCloseStatus(JI)J move-result-wide v4 move-object v0, v6 move-object v1, p0 .line 1893 invoke-virtual/range {v0 .. v5}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result v0 if-eqz v0, :cond_0 :cond_1 return-void .end method .method public final markCancelled()V .locals 7 sget-object v6, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; :cond_0 invoke-virtual {v6, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v2 const-wide v0, 0xfffffffffffffffL and-long/2addr v0, v2 const/4 v4, 0x3 .line 1882 invoke-static {v0, v1, v4}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$constructSendersAndCloseStatus(JI)J move-result-wide v4 move-object v0, v6 move-object v1, p0 invoke-virtual/range {v0 .. v5}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result v0 if-eqz v0, :cond_0 return-void .end method .method public final markClosed()V .locals 7 sget-object v6, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; :cond_0 invoke-virtual {v6, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v2 const/16 v0, 0x3c shr-long v0, v2, v0 long-to-int v0, v0 const-wide v4, 0xfffffffffffffffL if-eqz v0, :cond_2 const/4 v1, 0x1 if-eq v0, v1, :cond_1 return-void :cond_1 and-long v0, v2, v4 const/4 v4, 0x3 .line 1869 invoke-static {v0, v1, v4}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$constructSendersAndCloseStatus(JI)J move-result-wide v0 :goto_0 move-wide v4, v0 goto :goto_1 :cond_2 and-long v0, v2, v4 const/4 v4, 0x2 .line 1867 invoke-static {v0, v1, v4}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$constructSendersAndCloseStatus(JI)J move-result-wide v0 goto :goto_0 :goto_1 move-object v0, v6 move-object v1, p0 .line 1865 invoke-virtual/range {v0 .. v5}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result v0 if-eqz v0, :cond_0 return-void .end method .method public final moveSegmentBufferEndToSpecifiedOrLast(JLkotlinx/coroutines/channels/ChannelSegment;)V .locals 4 .line 2513 :goto_0 iget-wide v0, p3, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v0, v0, p1 if-gez v0, :cond_1 .line 2514 invoke-virtual {p3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->getNext()Lkotlinx/coroutines/internal/ConcurrentLinkedListNode; move-result-object v0 check-cast v0, Lkotlinx/coroutines/channels/ChannelSegment; if-nez v0, :cond_0 goto :goto_1 :cond_0 move-object p3, v0 goto :goto_0 .line 2520 :cond_1 :goto_1 invoke-virtual {p3}, Lkotlinx/coroutines/internal/Segment;->isRemoved()Z move-result p1 if-eqz p1, :cond_3 .line 2521 invoke-virtual {p3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->getNext()Lkotlinx/coroutines/internal/ConcurrentLinkedListNode; move-result-object p1 check-cast p1, Lkotlinx/coroutines/channels/ChannelSegment; if-nez p1, :cond_2 goto :goto_2 :cond_2 move-object p3, p1 goto :goto_1 :cond_3 :goto_2 sget-object p1, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEndSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 2526 :cond_4 :goto_3 invoke-virtual {p1, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p2 check-cast p2, Lkotlinx/coroutines/internal/Segment; .line 46 iget-wide v0, p2, Lkotlinx/coroutines/internal/Segment;->id:J iget-wide v2, p3, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v0, v0, v2 if-ltz v0, :cond_5 goto :goto_4 .line 47 :cond_5 invoke-virtual {p3}, Lkotlinx/coroutines/internal/Segment;->tryIncPointers$kotlinx_coroutines_core()Z move-result v0 if-nez v0, :cond_6 goto :goto_1 .line 48 :cond_6 invoke-static {p1, p0, p2, p3}, Landroidx/concurrent/futures/AbstractResolvableFuture$SafeAtomicHelper$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_8 .line 49 invoke-virtual {p2}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result p1 if-eqz p1, :cond_7 invoke-virtual {p2}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V :cond_7 :goto_4 return-void .line 52 :cond_8 invoke-virtual {p3}, Lkotlinx/coroutines/internal/Segment;->decPointers$kotlinx_coroutines_core()Z move-result p2 if-eqz p2, :cond_4 invoke-virtual {p3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->remove()V goto :goto_3 .end method .method public onClosedIdempotent()V .locals 0 return-void .end method .method public final onClosedReceiveCatchingOnNoWaiterSuspend(Lkotlinx/coroutines/CancellableContinuation;)V .locals 2 .line 759 sget-object v0, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getCloseCause()Ljava/lang/Throwable; move-result-object v1 invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->closed-JP2dKIU(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object v0 invoke-static {v0}, Lkotlinx/coroutines/channels/ChannelResult;->box-impl(Ljava/lang/Object;)Lkotlinx/coroutines/channels/ChannelResult; move-result-object v0 invoke-static {v0}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 invoke-interface {p1, v0}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V return-void .end method .method public final onClosedReceiveOnNoWaiterSuspend(Lkotlinx/coroutines/CancellableContinuation;)V .locals 1 .line 721 sget-object v0, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiveException()Ljava/lang/Throwable; move-result-object v0 invoke-static {v0}, Lkotlin/ResultKt;->createFailure(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object v0 invoke-static {v0}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 invoke-interface {p1, v0}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V return-void .end method .method public final onClosedSend(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 4 .line 315 new-instance v0, Lkotlinx/coroutines/CancellableContinuationImpl; invoke-static {p2}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->intercepted(Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation; move-result-object v1 const/4 v2, 0x1 invoke-direct {v0, v1, v2}, Lkotlinx/coroutines/CancellableContinuationImpl;->(Lkotlin/coroutines/Continuation;I)V .line 321 invoke-virtual {v0}, Lkotlinx/coroutines/CancellableContinuationImpl;->initCancellability()V iget-object v1, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-eqz v1, :cond_0 const/4 v2, 0x2 const/4 v3, 0x0 .line 135 invoke-static {v1, p1, v3, v2, v3}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->callUndeliveredElementCatchingException$default(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlinx/coroutines/internal/UndeliveredElementException;ILjava/lang/Object;)Lkotlinx/coroutines/internal/UndeliveredElementException; move-result-object p1 if-eqz p1, :cond_0 .line 137 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable; move-result-object v1 invoke-static {p1, v1}, Lkotlin/ExceptionsKt;->addSuppressed(Ljava/lang/Throwable;Ljava/lang/Throwable;)V .line 220 sget-object v1, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; invoke-static {p1}, Lkotlin/ResultKt;->createFailure(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object p1 invoke-static {p1}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 invoke-interface {v0, p1}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V goto :goto_0 .line 141 :cond_0 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable; move-result-object p1 .line 220 sget-object v1, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; invoke-static {p1}, Lkotlin/ResultKt;->createFailure(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object p1 invoke-static {p1}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 invoke-interface {v0, p1}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V .line 323 :goto_0 invoke-virtual {v0}, Lkotlinx/coroutines/CancellableContinuationImpl;->getResult()Ljava/lang/Object; move-result-object p1 .line 314 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v0 if-ne p1, v0, :cond_1 invoke-static {p2}, Lkotlin/coroutines/jvm/internal/DebugProbesKt;->probeCoroutineSuspended(Lkotlin/coroutines/Continuation;)V :cond_1 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object p2 if-ne p1, p2, :cond_2 return-object p1 .line 324 :cond_2 sget-object p1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; return-object p1 .end method .method public final onClosedSendOnNoWaiterSuspend(Ljava/lang/Object;Lkotlinx/coroutines/CancellableContinuation;)V .locals 2 iget-object v0, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-eqz v0, :cond_0 .line 182 invoke-interface {p2}, Lkotlin/coroutines/Continuation;->getContext()Lkotlin/coroutines/CoroutineContext; move-result-object v1 invoke-static {v0, p1, v1}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->callUndeliveredElement(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlin/coroutines/CoroutineContext;)V .line 183 :cond_0 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable; move-result-object p1 sget-object v0, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; invoke-static {p1}, Lkotlin/ResultKt;->createFailure(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object p1 invoke-static {p1}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 invoke-interface {p2, p1}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V return-void .end method .method public onReceiveDequeued()V .locals 0 return-void .end method .method public onReceiveEnqueued()V .locals 0 return-void .end method .method public final prepareReceiverForSuspension(Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V .locals 0 .line 716 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->onReceiveEnqueued()V .line 717 invoke-interface {p1, p2, p3}, Lkotlinx/coroutines/Waiter;->invokeOnCancellation(Lkotlinx/coroutines/internal/Segment;I)V return-void .end method .method public final prepareSenderForSuspension(Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V .locals 1 .line 178 sget v0, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I add-int/2addr p3, v0 invoke-interface {p1, p2, p3}, Lkotlinx/coroutines/Waiter;->invokeOnCancellation(Lkotlinx/coroutines/internal/Segment;I)V return-void .end method .method public receive(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 0 invoke-static {p0, p1}, Lkotlinx/coroutines/channels/BufferedChannel;->receive$suspendImpl(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object p1 return-object p1 .end method .method public receiveCatching-JP2dKIU(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 0 invoke-static {p0, p1}, Lkotlinx/coroutines/channels/BufferedChannel;->receiveCatching-JP2dKIU$suspendImpl(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object p1 return-object p1 .end method .method public final receiveCatchingOnNoWaiterSuspend-GKJJFZk(Lkotlinx/coroutines/channels/ChannelSegment;IJLkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 10 instance-of v0, p5, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1; if-eqz v0, :cond_0 move-object v0, p5 check-cast v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1; iget v1, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->label:I const/high16 v2, -0x80000000 and-int v3, v1, v2 if-eqz v3, :cond_0 sub-int/2addr v1, v2 iput v1, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->label:I goto :goto_0 :cond_0 new-instance v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1; invoke-direct {v0, p0, p5}, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlin/coroutines/Continuation;)V :goto_0 iget-object p5, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->result:Ljava/lang/Object; invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v1 .line 742 iget v2, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->label:I const/4 v3, 0x1 if-eqz v2, :cond_2 if-ne v2, v3, :cond_1 iget-object p1, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->L$1:Ljava/lang/Object; check-cast p1, Lkotlinx/coroutines/channels/ChannelSegment; iget-object p1, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->L$0:Ljava/lang/Object; check-cast p1, Lkotlinx/coroutines/channels/BufferedChannel; invoke-static {p5}, Lkotlin/ResultKt;->throwOnFailure(Ljava/lang/Object;)V goto/16 :goto_4 :cond_1 new-instance p1, Ljava/lang/IllegalStateException; const-string p2, "call to \'resume\' before \'invoke\' with coroutine" invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p1 :cond_2 invoke-static {p5}, Lkotlin/ResultKt;->throwOnFailure(Ljava/lang/Object;)V .line 332 iput-object p0, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->L$0:Ljava/lang/Object; iput-object p1, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->L$1:Ljava/lang/Object; iput p2, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->I$0:I iput-wide p3, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->J$0:J iput v3, v0, Lkotlinx/coroutines/channels/BufferedChannel$receiveCatchingOnNoWaiterSuspend$1;->label:I .line 333 invoke-static {v0}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->intercepted(Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation; move-result-object p5 invoke-static {p5}, Lkotlinx/coroutines/CancellableContinuationKt;->getOrCreateCancellableContinuation(Lkotlin/coroutines/Continuation;)Lkotlinx/coroutines/CancellableContinuationImpl; move-result-object p5 .line 747 :try_start_0 new-instance v8, Lkotlinx/coroutines/channels/ReceiveCatching; const-string v2, "null cannot be cast to non-null type kotlinx.coroutines.CancellableContinuationImpl>" invoke-static {p5, v2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-direct {v8, p5}, Lkotlinx/coroutines/channels/ReceiveCatching;->(Lkotlinx/coroutines/CancellableContinuationImpl;)V move-object v2, p0 move-object v3, p1 move v4, p2 move-wide v5, p3 move-object v7, v8 .line 964 invoke-static/range {v2 .. v7}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellReceive(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object v2 .line 966 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v3 if-ne v2, v3, :cond_3 .line 967 invoke-static {p0, v8, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->access$prepareReceiverForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V goto/16 :goto_3 :catchall_0 move-exception p1 goto/16 :goto_5 .line 969 :cond_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p2 const/4 v9, 0x0 if-ne v2, p2, :cond_d .line 970 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v2 cmp-long p2, p3, v2 if-gez p2, :cond_4 invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 858 :cond_4 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceiveSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object p1 .line 886 invoke-virtual {p1, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 check-cast p1, Lkotlinx/coroutines/channels/ChannelSegment; .line 890 :cond_5 :goto_1 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForReceive()Z move-result p2 if-eqz p2, :cond_6 .line 754 invoke-static {p0, p5}, Lkotlinx/coroutines/channels/BufferedChannel;->access$onClosedReceiveCatchingOnNoWaiterSuspend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/CancellableContinuation;)V goto/16 :goto_3 .line 890 :cond_6 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceivers$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object p2 .line 893 invoke-virtual {p2, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J move-result-wide p2 .line 895 sget p4, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v2, p4 div-long v2, p2, v2 int-to-long v4, p4 .line 896 rem-long v4, p2, v4 long-to-int p4, v4 .line 899 iget-wide v4, p1, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v4, v4, v2 if-eqz v4, :cond_8 .line 901 invoke-static {p0, v2, v3, p1}, Lkotlinx/coroutines/channels/BufferedChannel;->access$findSegmentReceive(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v2 if-nez v2, :cond_7 goto :goto_1 :cond_7 move-object p1, v2 :cond_8 move-object v2, p0 move-object v3, p1 move v4, p4 move-wide v5, p2 move-object v7, v8 .line 908 invoke-static/range {v2 .. v7}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellReceive(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object v2 .line 910 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v3 if-ne v2, v3, :cond_9 .line 913 invoke-static {p0, v8, p1, p4}, Lkotlinx/coroutines/channels/BufferedChannel;->access$prepareReceiverForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V goto :goto_3 .line 916 :cond_9 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p4 if-ne v2, p4, :cond_a .line 923 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v2 cmp-long p2, p2, v2 if-gez p2, :cond_5 invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_1 .line 926 :cond_a invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND_NO_WAITER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p2 if-eq v2, p2, :cond_c .line 935 invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 752 sget-object p1, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p1, v2}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 invoke-static {p1}, Lkotlinx/coroutines/channels/ChannelResult;->box-impl(Ljava/lang/Object;)Lkotlinx/coroutines/channels/ChannelResult; move-result-object p1 iget-object p2, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-eqz p2, :cond_b invoke-virtual {p5}, Lkotlinx/coroutines/CancellableContinuationImpl;->getContext()Lkotlin/coroutines/CoroutineContext; move-result-object p3 invoke-static {p2, v2, p3}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->bindCancellationFun(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlin/coroutines/CoroutineContext;)Lkotlin/jvm/functions/Function1; move-result-object v9 :cond_b :goto_2 invoke-virtual {p5, p1, v9}, Lkotlinx/coroutines/CancellableContinuationImpl;->resume(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V goto :goto_3 .line 929 :cond_c new-instance p1, Ljava/lang/IllegalStateException; const-string p2, "unexpected" .line 882 invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p2 invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p1 .line 979 :cond_d invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 752 sget-object p1, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p1, v2}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 invoke-static {p1}, Lkotlinx/coroutines/channels/ChannelResult;->box-impl(Ljava/lang/Object;)Lkotlinx/coroutines/channels/ChannelResult; move-result-object p1 iget-object p2, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-eqz p2, :cond_b invoke-virtual {p5}, Lkotlinx/coroutines/CancellableContinuationImpl;->getContext()Lkotlin/coroutines/CoroutineContext; move-result-object p3 invoke-static {p2, v2, p3}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->bindCancellationFun(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlin/coroutines/CoroutineContext;)Lkotlin/jvm/functions/Function1; move-result-object v9 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 goto :goto_2 .line 342 :goto_3 invoke-virtual {p5}, Lkotlinx/coroutines/CancellableContinuationImpl;->getResult()Ljava/lang/Object; move-result-object p5 .line 332 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object p1 if-ne p5, p1, :cond_e invoke-static {v0}, Lkotlin/coroutines/jvm/internal/DebugProbesKt;->probeCoroutineSuspended(Lkotlin/coroutines/Continuation;)V :cond_e if-ne p5, v1, :cond_f return-object v1 .line 343 :cond_f :goto_4 check-cast p5, Lkotlinx/coroutines/channels/ChannelResult; invoke-virtual {p5}, Lkotlinx/coroutines/channels/ChannelResult;->unbox-impl()Ljava/lang/Object; move-result-object p1 return-object p1 .line 339 :goto_5 invoke-virtual {p5}, Lkotlinx/coroutines/CancellableContinuationImpl;->releaseClaimedReusableContinuation$kotlinx_coroutines_core()V .line 340 throw p1 .end method .method public final receiveOnNoWaiterSuspend(Lkotlinx/coroutines/channels/ChannelSegment;IJLkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 8 .line 333 invoke-static {p5}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->intercepted(Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation; move-result-object v0 invoke-static {v0}, Lkotlinx/coroutines/CancellableContinuationKt;->getOrCreateCancellableContinuation(Lkotlin/coroutines/Continuation;)Lkotlinx/coroutines/CancellableContinuationImpl; move-result-object v0 move-object v1, p0 move-object v2, p1 move v3, p2 move-wide v4, p3 move-object v6, v0 .line 964 :try_start_0 invoke-static/range {v1 .. v6}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellReceive(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object v1 .line 966 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 if-ne v1, v2, :cond_0 .line 967 invoke-static {p0, v0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->access$prepareReceiverForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V goto/16 :goto_2 :catchall_0 move-exception p1 goto/16 :goto_3 .line 969 :cond_0 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p2 const/4 v7, 0x0 if-ne v1, p2, :cond_b .line 970 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v1 cmp-long p2, p3, v1 if-gez p2, :cond_1 invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 858 :cond_1 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceiveSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object p1 .line 886 invoke-virtual {p1, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 check-cast p1, Lkotlinx/coroutines/channels/ChannelSegment; .line 890 :cond_2 :goto_0 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForReceive()Z move-result p2 if-eqz p2, :cond_3 .line 711 invoke-static {p0, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->access$onClosedReceiveOnNoWaiterSuspend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/CancellableContinuation;)V goto/16 :goto_2 .line 890 :cond_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceivers$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object p2 .line 893 invoke-virtual {p2, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J move-result-wide p2 .line 895 sget p4, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v1, p4 div-long v1, p2, v1 int-to-long v3, p4 .line 896 rem-long v3, p2, v3 long-to-int p4, v3 .line 899 iget-wide v3, p1, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v3, v3, v1 if-eqz v3, :cond_5 .line 901 invoke-static {p0, v1, v2, p1}, Lkotlinx/coroutines/channels/BufferedChannel;->access$findSegmentReceive(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v1 if-nez v1, :cond_4 goto :goto_0 :cond_4 move-object p1, v1 :cond_5 move-object v1, p0 move-object v2, p1 move v3, p4 move-wide v4, p2 move-object v6, v0 .line 908 invoke-static/range {v1 .. v6}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellReceive(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object v1 .line 910 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 if-ne v1, v2, :cond_7 .line 913 instance-of p2, v0, Lkotlinx/coroutines/Waiter; if-eqz p2, :cond_6 move-object v7, v0 :cond_6 if-eqz v7, :cond_c invoke-static {p0, v7, p1, p4}, Lkotlinx/coroutines/channels/BufferedChannel;->access$prepareReceiverForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V goto :goto_2 .line 916 :cond_7 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p4 if-ne v1, p4, :cond_8 .line 923 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v1 cmp-long p2, p2, v1 if-gez p2, :cond_2 invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_0 .line 926 :cond_8 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND_NO_WAITER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p2 if-eq v1, p2, :cond_a .line 935 invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V iget-object p1, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-eqz p1, :cond_9 .line 708 invoke-virtual {v0}, Lkotlinx/coroutines/CancellableContinuationImpl;->getContext()Lkotlin/coroutines/CoroutineContext; move-result-object p2 invoke-static {p1, v1, p2}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->bindCancellationFun(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlin/coroutines/CoroutineContext;)Lkotlin/jvm/functions/Function1; move-result-object v7 .line 709 :cond_9 :goto_1 invoke-virtual {v0, v1, v7}, Lkotlinx/coroutines/CancellableContinuationImpl;->resume(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V goto :goto_2 .line 929 :cond_a new-instance p1, Ljava/lang/IllegalStateException; const-string p2, "unexpected" .line 882 invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p2 invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p1 .line 979 :cond_b invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V iget-object p1, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-eqz p1, :cond_9 .line 708 invoke-virtual {v0}, Lkotlinx/coroutines/CancellableContinuationImpl;->getContext()Lkotlin/coroutines/CoroutineContext; move-result-object p2 invoke-static {p1, v1, p2}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->bindCancellationFun(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlin/coroutines/CoroutineContext;)Lkotlin/jvm/functions/Function1; move-result-object v7 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 goto :goto_1 .line 342 :cond_c :goto_2 invoke-virtual {v0}, Lkotlinx/coroutines/CancellableContinuationImpl;->getResult()Ljava/lang/Object; move-result-object p1 .line 332 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object p2 if-ne p1, p2, :cond_d invoke-static {p5}, Lkotlin/coroutines/jvm/internal/DebugProbesKt;->probeCoroutineSuspended(Lkotlin/coroutines/Continuation;)V :cond_d return-object p1 .line 339 :goto_3 invoke-virtual {v0}, Lkotlinx/coroutines/CancellableContinuationImpl;->releaseClaimedReusableContinuation$kotlinx_coroutines_core()V .line 340 throw p1 .end method .method public final removeUnprocessedElements(Lkotlinx/coroutines/channels/ChannelSegment;)V .locals 11 iget-object v0, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; const/4 v1, 0x0 const/4 v2, 0x1 .line 2021 invoke-static {v1, v2, v1}, Lkotlinx/coroutines/internal/InlineList;->constructor-impl$default(Ljava/lang/Object;ILkotlin/jvm/internal/DefaultConstructorMarker;)Ljava/lang/Object; move-result-object v3 .line 2024 :cond_0 sget v4, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I sub-int/2addr v4, v2 :goto_0 const/4 v5, -0x1 if-ge v5, v4, :cond_b .line 2026 iget-wide v6, p1, Lkotlinx/coroutines/internal/Segment;->id:J sget v8, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v8, v8 mul-long/2addr v6, v8 int-to-long v8, v4 add-long/2addr v6, v8 .line 2030 :cond_1 invoke-virtual {p1, v4}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v8 .line 2033 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getDONE_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v9 if-eq v8, v9, :cond_c .line 2035 sget-object v9, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; if-ne v8, v9, :cond_3 .line 2037 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v9 cmp-long v9, v6, v9 if-ltz v9, :cond_c .line 2039 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v9 invoke-virtual {p1, v4, v8, v9}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v8 if-eqz v8, :cond_1 if-eqz v0, :cond_2 .line 2042 invoke-virtual {p1, v4}, Lkotlinx/coroutines/channels/ChannelSegment;->getElement$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v5 .line 2043 invoke-static {v0, v5, v1}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->callUndeliveredElementCatchingException(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlinx/coroutines/internal/UndeliveredElementException;)Lkotlinx/coroutines/internal/UndeliveredElementException; move-result-object v1 .line 2047 :cond_2 invoke-virtual {p1, v4}, Lkotlinx/coroutines/channels/ChannelSegment;->cleanElement$kotlinx_coroutines_core(I)V .line 2048 invoke-virtual {p1}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V goto/16 :goto_4 .line 2053 :cond_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getIN_BUFFER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v9 if-eq v8, v9, :cond_a if-nez v8, :cond_4 goto :goto_3 .line 2062 :cond_4 instance-of v9, v8, Lkotlinx/coroutines/Waiter; if-nez v9, :cond_7 instance-of v9, v8, Lkotlinx/coroutines/channels/WaiterEB; if-eqz v9, :cond_5 goto :goto_1 .line 2086 :cond_5 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_EB$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v9 if-eq v8, v9, :cond_c invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v9 if-ne v8, v9, :cond_6 goto :goto_5 .line 2089 :cond_6 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_EB$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v9 if-eq v8, v9, :cond_1 goto :goto_4 .line 2064 :cond_7 :goto_1 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v9 cmp-long v9, v6, v9 if-ltz v9, :cond_c .line 2066 instance-of v9, v8, Lkotlinx/coroutines/channels/WaiterEB; if-eqz v9, :cond_8 move-object v9, v8 check-cast v9, Lkotlinx/coroutines/channels/WaiterEB; iget-object v9, v9, Lkotlinx/coroutines/channels/WaiterEB;->waiter:Lkotlinx/coroutines/Waiter; goto :goto_2 .line 2067 :cond_8 move-object v9, v8 check-cast v9, Lkotlinx/coroutines/Waiter; .line 2069 :goto_2 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v10 invoke-virtual {p1, v4, v8, v10}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v8 if-eqz v8, :cond_1 if-eqz v0, :cond_9 .line 2072 invoke-virtual {p1, v4}, Lkotlinx/coroutines/channels/ChannelSegment;->getElement$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v5 .line 2073 invoke-static {v0, v5, v1}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->callUndeliveredElementCatchingException(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlinx/coroutines/internal/UndeliveredElementException;)Lkotlinx/coroutines/internal/UndeliveredElementException; move-result-object v1 .line 2076 :cond_9 invoke-static {v3, v9}, Lkotlinx/coroutines/internal/InlineList;->plus-FjFbRPM(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; move-result-object v3 .line 2079 invoke-virtual {p1, v4}, Lkotlinx/coroutines/channels/ChannelSegment;->cleanElement$kotlinx_coroutines_core(I)V .line 2080 invoke-virtual {p1}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V goto :goto_4 .line 2055 :cond_a :goto_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v9 invoke-virtual {p1, v4, v8, v9}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v8 if-eqz v8, :cond_1 .line 2057 invoke-virtual {p1}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V :goto_4 add-int/lit8 v4, v4, -0x1 goto/16 :goto_0 .line 2095 :cond_b invoke-virtual {p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->getPrev()Lkotlinx/coroutines/internal/ConcurrentLinkedListNode; move-result-object p1 check-cast p1, Lkotlinx/coroutines/channels/ChannelSegment; if-nez p1, :cond_0 :cond_c :goto_5 if-eqz v3, :cond_e .line 39 instance-of p1, v3, Ljava/util/ArrayList; if-nez p1, :cond_d check-cast v3, Lkotlinx/coroutines/Waiter; .line 2098 invoke-virtual {p0, v3}, Lkotlinx/coroutines/channels/BufferedChannel;->resumeSenderOnCancelledChannel(Lkotlinx/coroutines/Waiter;)V goto :goto_7 :cond_d const-string p1, "null cannot be cast to non-null type java.util.ArrayList{ kotlin.collections.TypeAliasesKt.ArrayList }" .line 41 invoke-static {v3, p1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V check-cast v3, Ljava/util/ArrayList; .line 42 invoke-virtual {v3}, Ljava/util/ArrayList;->size()I move-result p1 sub-int/2addr p1, v2 :goto_6 if-ge v5, p1, :cond_e .line 43 invoke-virtual {v3, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object; move-result-object v0 check-cast v0, Lkotlinx/coroutines/Waiter; .line 2098 invoke-virtual {p0, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->resumeSenderOnCancelledChannel(Lkotlinx/coroutines/Waiter;)V add-int/lit8 p1, p1, -0x1 goto :goto_6 :cond_e :goto_7 if-nez v1, :cond_f return-void .line 2100 :cond_f throw v1 .end method .method public final resumeReceiverOnClosedChannel(Lkotlinx/coroutines/Waiter;)V .locals 1 const/4 v0, 0x1 .line 2160 invoke-virtual {p0, p1, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->resumeWaiterOnClosedChannel(Lkotlinx/coroutines/Waiter;Z)V return-void .end method .method public final resumeSenderOnCancelledChannel(Lkotlinx/coroutines/Waiter;)V .locals 1 const/4 v0, 0x0 .line 2166 invoke-virtual {p0, p1, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->resumeWaiterOnClosedChannel(Lkotlinx/coroutines/Waiter;Z)V return-void .end method .method public final resumeWaiterOnClosedChannel(Lkotlinx/coroutines/Waiter;Z)V .locals 2 .line 2171 instance-of v0, p1, Lkotlinx/coroutines/CancellableContinuation; if-eqz v0, :cond_1 check-cast p1, Lkotlin/coroutines/Continuation; sget-object v0, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; if-eqz p2, :cond_0 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiveException()Ljava/lang/Throwable; move-result-object p2 goto :goto_0 :cond_0 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable; move-result-object p2 :goto_0 invoke-static {p2}, Lkotlin/ResultKt;->createFailure(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object p2 invoke-static {p2}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p2 invoke-interface {p1, p2}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V goto :goto_1 .line 2172 :cond_1 instance-of p2, p1, Lkotlinx/coroutines/channels/ReceiveCatching; if-eqz p2, :cond_2 check-cast p1, Lkotlinx/coroutines/channels/ReceiveCatching; iget-object p1, p1, Lkotlinx/coroutines/channels/ReceiveCatching;->cont:Lkotlinx/coroutines/CancellableContinuationImpl; sget-object p2, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; sget-object p2, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getCloseCause()Ljava/lang/Throwable; move-result-object v0 invoke-virtual {p2, v0}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->closed-JP2dKIU(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object p2 invoke-static {p2}, Lkotlinx/coroutines/channels/ChannelResult;->box-impl(Ljava/lang/Object;)Lkotlinx/coroutines/channels/ChannelResult; move-result-object p2 invoke-static {p2}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p2 invoke-interface {p1, p2}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V goto :goto_1 .line 2173 :cond_2 instance-of p2, p1, Lkotlinx/coroutines/channels/BufferedChannel$BufferedChannelIterator; if-eqz p2, :cond_3 check-cast p1, Lkotlinx/coroutines/channels/BufferedChannel$BufferedChannelIterator; invoke-virtual {p1}, Lkotlinx/coroutines/channels/BufferedChannel$BufferedChannelIterator;->tryResumeHasNextOnClosedChannel()V :goto_1 return-void .line 2174 :cond_3 new-instance p2, Ljava/lang/IllegalStateException; .line 2175 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v1, "Unexpected waiter: " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p2, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p2 .end method .method public send(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 0 invoke-static {p0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->send$suspendImpl(Lkotlinx/coroutines/channels/BufferedChannel;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object p1 return-object p1 .end method .method public final sendOnNoWaiterSuspend(Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 20 move-object/from16 v9, p0 move-object/from16 v0, p3 .line 333 invoke-static/range {p6 .. p6}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->intercepted(Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation; move-result-object v1 invoke-static {v1}, Lkotlinx/coroutines/CancellableContinuationKt;->getOrCreateCancellableContinuation(Lkotlin/coroutines/Continuation;)Lkotlinx/coroutines/CancellableContinuationImpl; move-result-object v10 const/4 v8, 0x0 move-object/from16 v1, p0 move-object/from16 v2, p1 move/from16 v3, p2 move-object/from16 v4, p3 move-wide/from16 v5, p4 move-object v7, v10 .line 374 :try_start_0 invoke-static/range {v1 .. v8}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellSend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I move-result v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-eqz v1, :cond_10 const/4 v11, 0x1 if-eq v1, v11, :cond_f const/4 v12, 0x2 if-eq v1, v12, :cond_e const/4 v13, 0x4 if-eq v1, v13, :cond_d const-string v14, "unexpected" const/4 v15, 0x5 if-ne v1, v15, :cond_c .line 390 :try_start_1 invoke-virtual/range {p1 .. p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 244 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getSendSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v1 .line 273 invoke-virtual {v1, v9}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 check-cast v1, Lkotlinx/coroutines/channels/ChannelSegment; .line 274 :cond_0 :goto_0 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getSendersAndCloseStatus$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v2 .line 277 invoke-virtual {v2, v9}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J move-result-wide v2 const-wide v4, 0xfffffffffffffffL and-long v16, v2, v4 .line 280 invoke-static {v9, v2, v3}, Lkotlinx/coroutines/channels/BufferedChannel;->access$isClosedForSend0(Lkotlinx/coroutines/channels/BufferedChannel;J)Z move-result v18 .line 282 sget v2, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v3, v2 div-long v3, v16, v3 int-to-long v5, v2 .line 283 rem-long v5, v16, v5 long-to-int v8, v5 .line 286 iget-wide v5, v1, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v2, v5, v3 if-eqz v2, :cond_3 .line 288 invoke-static {v9, v3, v4, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->access$findSegmentSend(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v2 if-nez v2, :cond_2 if-eqz v18, :cond_0 .line 165 :cond_1 :goto_1 invoke-static {v9, v0, v10}, Lkotlinx/coroutines/channels/BufferedChannel;->access$onClosedSendOnNoWaiterSuspend(Lkotlinx/coroutines/channels/BufferedChannel;Ljava/lang/Object;Lkotlinx/coroutines/CancellableContinuation;)V goto/16 :goto_6 :catchall_0 move-exception v0 goto/16 :goto_7 :cond_2 move-object v7, v2 goto :goto_2 :cond_3 move-object v7, v1 :goto_2 move-object/from16 v1, p0 move-object v2, v7 move v3, v8 move-object/from16 v4, p3 move-wide/from16 v5, v16 move-object/from16 p1, v7 move-object v7, v10 move/from16 v19, v8 move/from16 v8, v18 .line 304 invoke-static/range {v1 .. v8}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellSend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I move-result v1 if-eqz v1, :cond_b if-eq v1, v11, :cond_a if-eq v1, v12, :cond_7 const/4 v2, 0x3 if-eq v1, v2, :cond_6 if-eq v1, v13, :cond_5 if-eq v1, v15, :cond_4 goto :goto_3 .line 341 :cond_4 invoke-virtual/range {p1 .. p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V :goto_3 move-object/from16 v1, p1 goto :goto_0 .line 334 :cond_5 invoke-virtual/range {p0 .. p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v1 cmp-long v1, v16, v1 if-gez v1, :cond_1 invoke-virtual/range {p1 .. p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_1 .line 347 :cond_6 new-instance v0, Ljava/lang/IllegalStateException; .line 269 invoke-virtual {v14}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v1 invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw v0 :cond_7 if-eqz v18, :cond_8 .line 323 invoke-virtual/range {p1 .. p1}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V goto :goto_1 .line 326 :cond_8 instance-of v0, v10, Lkotlinx/coroutines/Waiter; if-eqz v0, :cond_9 move-object v0, v10 goto :goto_4 :cond_9 const/4 v0, 0x0 :goto_4 if-eqz v0, :cond_11 move-object/from16 v2, p1 move/from16 v1, v19 invoke-static {v9, v0, v2, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->access$prepareSenderForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V goto :goto_6 .line 162 :cond_a sget-object v0, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; sget-object v0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; invoke-static {v0}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 :goto_5 invoke-interface {v10, v0}, Lkotlin/coroutines/Continuation;->resumeWith(Ljava/lang/Object;)V goto :goto_6 :cond_b move-object/from16 v2, p1 .line 310 invoke-virtual {v2}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 162 sget-object v0, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; sget-object v0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; invoke-static {v0}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 goto :goto_5 .line 269 :cond_c new-instance v0, Ljava/lang/IllegalStateException; .line 399 invoke-virtual {v14}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v1 invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw v0 .line 386 :cond_d invoke-virtual/range {p0 .. p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v1 cmp-long v1, p4, v1 if-gez v1, :cond_1 invoke-virtual/range {p1 .. p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto/16 :goto_1 :cond_e move-object/from16 v0, p1 move/from16 v1, p2 .line 383 invoke-static {v9, v10, v0, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->access$prepareSenderForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V goto :goto_6 .line 162 :cond_f sget-object v0, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; sget-object v0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; invoke-static {v0}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 goto :goto_5 :cond_10 move-object/from16 v0, p1 .line 376 invoke-virtual/range {p1 .. p1}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 162 sget-object v0, Lkotlin/Result;->Companion:Lkotlin/Result$Companion; sget-object v0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; invoke-static {v0}, Lkotlin/Result;->constructor-impl(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 goto :goto_5 .line 342 :cond_11 :goto_6 invoke-virtual {v10}, Lkotlinx/coroutines/CancellableContinuationImpl;->getResult()Ljava/lang/Object; move-result-object v0 .line 332 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v1 if-ne v0, v1, :cond_12 invoke-static/range {p6 .. p6}, Lkotlin/coroutines/jvm/internal/DebugProbesKt;->probeCoroutineSuspended(Lkotlin/coroutines/Continuation;)V :cond_12 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v1 if-ne v0, v1, :cond_13 return-object v0 .line 343 :cond_13 sget-object v0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; return-object v0 .line 339 :goto_7 invoke-virtual {v10}, Lkotlinx/coroutines/CancellableContinuationImpl;->releaseClaimedReusableContinuation$kotlinx_coroutines_core()V .line 340 throw v0 .end method .method public final shouldSendSuspend(J)Z .locals 2 .line 604 invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForSend0(J)Z move-result v0 if-eqz v0, :cond_0 const/4 p1, 0x0 return p1 :cond_0 const-wide v0, 0xfffffffffffffffL and-long/2addr p1, v0 .line 606 invoke-virtual {p0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->bufferOrRendezvousSend(J)Z move-result p1 xor-int/lit8 p1, p1, 0x1 return p1 .end method .method public toString()Ljava/lang/String; .locals 16 move-object/from16 v0, p0 .line 2564 new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1}, Ljava/lang/StringBuilder;->()V sget-object v2, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 2566 invoke-virtual {v2, v0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v2 const/16 v4, 0x3c shr-long/2addr v2, v4 long-to-int v2, v2 const/4 v3, 0x3 const/4 v4, 0x2 if-eq v2, v4, :cond_1 if-eq v2, v3, :cond_0 goto :goto_0 :cond_0 const-string v2, "cancelled," .line 2568 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; goto :goto_0 :cond_1 const-string v2, "closed," .line 2567 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; .line 2571 :goto_0 new-instance v2, Ljava/lang/StringBuilder; invoke-direct {v2}, Ljava/lang/StringBuilder;->()V const-string v5, "capacity=" invoke-virtual {v2, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; iget v5, v0, Lkotlinx/coroutines/channels/BufferedChannel;->capacity:I invoke-virtual {v2, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; const/16 v5, 0x2c invoke-virtual {v2, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v2 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v2, "data=[" .line 2573 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; new-array v2, v3, [Lkotlinx/coroutines/channels/ChannelSegment; sget-object v3, Lkotlinx/coroutines/channels/BufferedChannel;->receiveSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .line 2574 invoke-virtual {v3, v0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v3 const/4 v6, 0x0 aput-object v3, v2, v6 sget-object v3, Lkotlinx/coroutines/channels/BufferedChannel;->sendSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; invoke-virtual {v3, v0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v3 const/4 v7, 0x1 aput-object v3, v2, v7 sget-object v3, Lkotlinx/coroutines/channels/BufferedChannel;->bufferEndSegment$FU:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; invoke-virtual {v3, v0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v3 aput-object v3, v2, v4 invoke-static {v2}, Lkotlin/collections/CollectionsKt;->listOf([Ljava/lang/Object;)Ljava/util/List; move-result-object v2 check-cast v2, Ljava/lang/Iterable; .line 766 new-instance v3, Ljava/util/ArrayList; invoke-direct {v3}, Ljava/util/ArrayList;->()V .line 857 invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object v2 :cond_2 :goto_1 invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z move-result v4 if-eqz v4, :cond_3 invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v4 move-object v8, v4 check-cast v8, Lkotlinx/coroutines/channels/ChannelSegment; .line 2575 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getNULL_SEGMENT$p()Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v9 if-eq v8, v9, :cond_2 .line 857 invoke-interface {v3, v4}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z goto :goto_1 .line 2310 :cond_3 invoke-interface {v3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object v2 .line 2311 invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z move-result v3 if-eqz v3, :cond_1b .line 2312 invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v3 .line 2313 invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z move-result v4 if-nez v4, :cond_4 goto :goto_2 .line 2314 :cond_4 move-object v4, v3 check-cast v4, Lkotlinx/coroutines/channels/ChannelSegment; .line 2576 iget-wide v8, v4, Lkotlinx/coroutines/internal/Segment;->id:J .line 2316 :cond_5 invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v4 .line 2317 move-object v10, v4 check-cast v10, Lkotlinx/coroutines/channels/ChannelSegment; .line 2576 iget-wide v10, v10, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v12, v8, v10 if-lez v12, :cond_6 move-object v3, v4 move-wide v8, v10 .line 2322 :cond_6 invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z move-result v4 if-nez v4, :cond_5 .line 2576 :goto_2 check-cast v3, Lkotlinx/coroutines/channels/ChannelSegment; .line 2577 invoke-virtual/range {p0 .. p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v10 .line 2578 invoke-virtual/range {p0 .. p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v12 .line 2581 :goto_3 sget v2, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I move v4, v6 :goto_4 if-ge v4, v2, :cond_17 .line 2582 iget-wide v8, v3, Lkotlinx/coroutines/internal/Segment;->id:J sget v14, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v14, v14 mul-long/2addr v8, v14 int-to-long v14, v4 add-long/2addr v8, v14 cmp-long v14, v8, v12 if-ltz v14, :cond_7 cmp-long v15, v8, v10 if-gez v15, :cond_18 .line 2584 :cond_7 invoke-virtual {v3, v4}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v15 .line 2585 invoke-virtual {v3, v4}, Lkotlinx/coroutines/channels/ChannelSegment;->getElement$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v6 .line 2587 instance-of v7, v15, Lkotlinx/coroutines/CancellableContinuation; if-eqz v7, :cond_a cmp-long v7, v8, v10 if-gez v7, :cond_8 if-ltz v14, :cond_8 const-string v7, "receive" goto/16 :goto_6 :cond_8 if-gez v14, :cond_9 if-ltz v7, :cond_9 const-string v7, "send" goto/16 :goto_6 :cond_9 const-string v7, "cont" goto/16 :goto_6 .line 2601 :cond_a instance-of v7, v15, Lkotlinx/coroutines/channels/ReceiveCatching; if-eqz v7, :cond_b const-string v7, "receiveCatching" goto/16 :goto_6 .line 2603 :cond_b instance-of v7, v15, Lkotlinx/coroutines/channels/WaiterEB; if-eqz v7, :cond_c new-instance v7, Ljava/lang/StringBuilder; invoke-direct {v7}, Ljava/lang/StringBuilder;->()V const-string v8, "EB(" invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v7, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; const/16 v8, 0x29 invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v7 goto :goto_6 .line 2604 :cond_c invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 invoke-static {v15, v7}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_d goto :goto_5 :cond_d invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_EB$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 invoke-static {v15, v7}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_e :goto_5 const-string v7, "resuming_sender" goto :goto_6 :cond_e if-nez v15, :cond_f goto/16 :goto_7 .line 2605 :cond_f invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getIN_BUFFER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 invoke-static {v15, v7}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_10 goto/16 :goto_7 :cond_10 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getDONE_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 invoke-static {v15, v7}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_11 goto :goto_7 :cond_11 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getPOISONED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 invoke-static {v15, v7}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_12 goto :goto_7 :cond_12 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 invoke-static {v15, v7}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_13 goto :goto_7 :cond_13 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_SEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 invoke-static {v15, v7}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_14 goto :goto_7 :cond_14 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v7 invoke-static {v15, v7}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v7 if-nez v7, :cond_16 .line 2606 invoke-virtual {v15}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v7 :goto_6 if-eqz v6, :cond_15 .line 2609 new-instance v8, Ljava/lang/StringBuilder; invoke-direct {v8}, Ljava/lang/StringBuilder;->()V const/16 v9, 0x28 invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; invoke-virtual {v8, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v8, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; invoke-virtual {v8, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; const-string v6, ")," invoke-virtual {v8, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v6 invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; goto :goto_7 .line 2611 :cond_15 new-instance v6, Ljava/lang/StringBuilder; invoke-direct {v6}, Ljava/lang/StringBuilder;->()V invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v6, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v6 invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; :cond_16 :goto_7 add-int/lit8 v4, v4, 0x1 const/4 v6, 0x0 const/4 v7, 0x1 goto/16 :goto_4 .line 2615 :cond_17 invoke-virtual {v3}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->getNext()Lkotlinx/coroutines/internal/ConcurrentLinkedListNode; move-result-object v2 move-object v3, v2 check-cast v3, Lkotlinx/coroutines/channels/ChannelSegment; if-nez v3, :cond_1a .line 2617 :cond_18 invoke-static {v1}, Lkotlin/text/StringsKt;->last(Ljava/lang/CharSequence;)C move-result v2 if-ne v2, v5, :cond_19 invoke-virtual {v1}, Ljava/lang/StringBuilder;->length()I move-result v2 const/4 v4, 0x1 sub-int/2addr v2, v4 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->deleteCharAt(I)Ljava/lang/StringBuilder; move-result-object v2 const-string v3, "this.deleteCharAt(index)" invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V :cond_19 const-string v2, "]" .line 2618 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; .line 2620 invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 return-object v1 :cond_1a const/4 v6, 0x0 const/4 v7, 0x1 goto/16 :goto_3 .line 2311 :cond_1b new-instance v1, Ljava/util/NoSuchElementException; invoke-direct {v1}, Ljava/util/NoSuchElementException;->()V throw v1 .end method .method public tryReceive-PtdJZtk()Ljava/lang/Object; .locals 11 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 764 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v0 sget-object v2, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 765 invoke-virtual {v2, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v2 .line 767 invoke-virtual {p0, v2, v3}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForReceive0(J)Z move-result v4 if-eqz v4, :cond_0 .line 768 sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getCloseCause()Ljava/lang/Throwable; move-result-object v1 invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->closed-JP2dKIU(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object v0 return-object v0 :cond_0 const-wide v4, 0xfffffffffffffffL and-long/2addr v2, v4 cmp-long v0, v0, v2 if-ltz v0, :cond_1 .line 772 sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {v0}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->failure-PtdJZtk()Ljava/lang/Object; move-result-object v0 return-object v0 .line 783 :cond_1 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v0 .line 858 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceiveSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v1 .line 886 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 check-cast v1, Lkotlinx/coroutines/channels/ChannelSegment; .line 890 :goto_0 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isClosedForReceive()Z move-result v2 if-eqz v2, :cond_2 .line 796 sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getCloseCause()Ljava/lang/Throwable; move-result-object v1 invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->closed-JP2dKIU(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object v0 goto/16 :goto_3 .line 890 :cond_2 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getReceivers$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v2 .line 893 invoke-virtual {v2, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J move-result-wide v7 .line 895 sget v2, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v3, v2 div-long v3, v7, v3 int-to-long v5, v2 .line 896 rem-long v5, v7, v5 long-to-int v9, v5 .line 899 iget-wide v5, v1, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v2, v5, v3 if-eqz v2, :cond_4 .line 901 invoke-static {p0, v3, v4, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->access$findSegmentReceive(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v2 if-nez v2, :cond_3 goto :goto_0 :cond_3 move-object v10, v2 goto :goto_1 :cond_4 move-object v10, v1 :goto_1 move-object v1, p0 move-object v2, v10 move v3, v9 move-wide v4, v7 move-object v6, v0 .line 908 invoke-static/range {v1 .. v6}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellReceive(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object v1 .line 910 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 if-ne v1, v2, :cond_7 .line 913 instance-of v1, v0, Lkotlinx/coroutines/Waiter; if-eqz v1, :cond_5 check-cast v0, Lkotlinx/coroutines/Waiter; goto :goto_2 :cond_5 const/4 v0, 0x0 :goto_2 if-eqz v0, :cond_6 invoke-static {p0, v0, v10, v9}, Lkotlinx/coroutines/channels/BufferedChannel;->access$prepareReceiverForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V .line 791 :cond_6 invoke-virtual {p0, v7, v8}, Lkotlinx/coroutines/channels/BufferedChannel;->waitExpandBufferCompletion$kotlinx_coroutines_core(J)V .line 792 invoke-virtual {v10}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V .line 793 sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {v0}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->failure-PtdJZtk()Ljava/lang/Object; move-result-object v0 goto :goto_3 .line 916 :cond_7 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v2 if-ne v1, v2, :cond_9 .line 923 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendersCounter$kotlinx_coroutines_core()J move-result-wide v1 cmp-long v1, v7, v1 if-gez v1, :cond_8 invoke-virtual {v10}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V :cond_8 move-object v1, v10 goto :goto_0 .line 926 :cond_9 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND_NO_WAITER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v0 if-eq v1, v0, :cond_a .line 935 invoke-virtual {v10}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V .line 785 sget-object v0, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {v0, v1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 :goto_3 return-object v0 .line 929 :cond_a new-instance v0, Ljava/lang/IllegalStateException; const-string v1, "unexpected" .line 882 invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v1 invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw v0 .end method .method public final tryResumeReceiver(Ljava/lang/Object;Ljava/lang/Object;)Z .locals 4 .line 636 instance-of v0, p1, Lkotlinx/coroutines/channels/ReceiveCatching; const/4 v1, 0x0 if-eqz v0, :cond_1 const-string v0, "null cannot be cast to non-null type kotlinx.coroutines.channels.ReceiveCatching" .line 637 invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V check-cast p1, Lkotlinx/coroutines/channels/ReceiveCatching; .line 638 iget-object v0, p1, Lkotlinx/coroutines/channels/ReceiveCatching;->cont:Lkotlinx/coroutines/CancellableContinuationImpl; sget-object v2, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {v2, p2}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v2 invoke-static {v2}, Lkotlinx/coroutines/channels/ChannelResult;->box-impl(Ljava/lang/Object;)Lkotlinx/coroutines/channels/ChannelResult; move-result-object v2 iget-object v3, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-eqz v3, :cond_0 iget-object p1, p1, Lkotlinx/coroutines/channels/ReceiveCatching;->cont:Lkotlinx/coroutines/CancellableContinuationImpl; invoke-virtual {p1}, Lkotlinx/coroutines/CancellableContinuationImpl;->getContext()Lkotlin/coroutines/CoroutineContext; move-result-object p1 invoke-static {v3, p2, p1}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->bindCancellationFun(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlin/coroutines/CoroutineContext;)Lkotlin/jvm/functions/Function1; move-result-object v1 :cond_0 invoke-static {v0, v2, v1}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$tryResume0(Lkotlinx/coroutines/CancellableContinuation;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Z move-result p1 goto :goto_0 .line 640 :cond_1 instance-of v0, p1, Lkotlinx/coroutines/channels/BufferedChannel$BufferedChannelIterator; if-eqz v0, :cond_2 const-string v0, "null cannot be cast to non-null type kotlinx.coroutines.channels.BufferedChannel.BufferedChannelIterator" .line 641 invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V check-cast p1, Lkotlinx/coroutines/channels/BufferedChannel$BufferedChannelIterator; .line 642 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel$BufferedChannelIterator;->tryResumeHasNext(Ljava/lang/Object;)Z move-result p1 goto :goto_0 .line 644 :cond_2 instance-of v0, p1, Lkotlinx/coroutines/CancellableContinuation; if-eqz v0, :cond_4 const-string v0, "null cannot be cast to non-null type kotlinx.coroutines.CancellableContinuation" .line 645 invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V check-cast p1, Lkotlinx/coroutines/CancellableContinuation; iget-object v0, p0, Lkotlinx/coroutines/channels/BufferedChannel;->onUndeliveredElement:Lkotlin/jvm/functions/Function1; if-eqz v0, :cond_3 .line 646 invoke-interface {p1}, Lkotlin/coroutines/Continuation;->getContext()Lkotlin/coroutines/CoroutineContext; move-result-object v1 invoke-static {v0, p2, v1}, Lkotlinx/coroutines/internal/OnUndeliveredElementKt;->bindCancellationFun(Lkotlin/jvm/functions/Function1;Ljava/lang/Object;Lkotlin/coroutines/CoroutineContext;)Lkotlin/jvm/functions/Function1; move-result-object v1 :cond_3 invoke-static {p1, p2, v1}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$tryResume0(Lkotlinx/coroutines/CancellableContinuation;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Z move-result p1 :goto_0 return p1 :cond_4 new-instance p2, Ljava/lang/IllegalStateException; .line 648 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v1, "Unexpected receiver type: " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p2, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p2 .end method .method public final tryResumeSender(Ljava/lang/Object;Lkotlinx/coroutines/channels/ChannelSegment;I)Z .locals 1 .line 1148 instance-of p2, p1, Lkotlinx/coroutines/CancellableContinuation; if-eqz p2, :cond_0 const-string p2, "null cannot be cast to non-null type kotlinx.coroutines.CancellableContinuation" .line 1150 invoke-static {p1, p2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V check-cast p1, Lkotlinx/coroutines/CancellableContinuation; .line 1151 sget-object p2, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; const/4 p3, 0x2 const/4 v0, 0x0 invoke-static {p1, p2, v0, p3, v0}, Lkotlinx/coroutines/channels/BufferedChannelKt;->tryResume0$default(Lkotlinx/coroutines/CancellableContinuation;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Z move-result p1 return p1 .line 1162 :cond_0 new-instance p2, Ljava/lang/IllegalStateException; .line 1163 new-instance p3, Ljava/lang/StringBuilder; invoke-direct {p3}, Ljava/lang/StringBuilder;->()V const-string v0, "Unexpected waiter: " invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p2, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p2 .end method .method public trySend-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object; .locals 14 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 188 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v0 invoke-virtual {p0, v0, v1}, Lkotlinx/coroutines/channels/BufferedChannel;->shouldSendSuspend(J)Z move-result v0 if-eqz v0, :cond_0 sget-object p1, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->failure-PtdJZtk()Ljava/lang/Object; move-result-object p1 return-object p1 .line 197 :cond_0 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_SEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v8 .line 244 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getSendSegment$FU$p()Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v0 .line 273 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Lkotlinx/coroutines/channels/ChannelSegment; .line 274 :cond_1 :goto_0 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannel;->access$getSendersAndCloseStatus$FU$p()Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-result-object v1 .line 277 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->getAndIncrement(Ljava/lang/Object;)J move-result-wide v1 const-wide v3, 0xfffffffffffffffL and-long v9, v1, v3 .line 280 invoke-static {p0, v1, v2}, Lkotlinx/coroutines/channels/BufferedChannel;->access$isClosedForSend0(Lkotlinx/coroutines/channels/BufferedChannel;J)Z move-result v11 .line 282 sget v1, Lkotlinx/coroutines/channels/BufferedChannelKt;->SEGMENT_SIZE:I int-to-long v2, v1 div-long v2, v9, v2 int-to-long v4, v1 .line 283 rem-long v4, v9, v4 long-to-int v12, v4 .line 286 iget-wide v4, v0, Lkotlinx/coroutines/internal/Segment;->id:J cmp-long v1, v4, v2 if-eqz v1, :cond_4 .line 288 invoke-static {p0, v2, v3, v0}, Lkotlinx/coroutines/channels/BufferedChannel;->access$findSegmentSend(Lkotlinx/coroutines/channels/BufferedChannel;JLkotlinx/coroutines/channels/ChannelSegment;)Lkotlinx/coroutines/channels/ChannelSegment; move-result-object v1 if-nez v1, :cond_3 if-eqz v11, :cond_1 .line 209 :cond_2 :goto_1 sget-object p1, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getSendException()Ljava/lang/Throwable; move-result-object v0 invoke-virtual {p1, v0}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->closed-JP2dKIU(Ljava/lang/Throwable;)Ljava/lang/Object; move-result-object p1 goto/16 :goto_6 :cond_3 move-object v13, v1 goto :goto_2 :cond_4 move-object v13, v0 :goto_2 move-object v0, p0 move-object v1, v13 move v2, v12 move-object v3, p1 move-wide v4, v9 move-object v6, v8 move v7, v11 .line 304 invoke-static/range {v0 .. v7}, Lkotlinx/coroutines/channels/BufferedChannel;->access$updateCellSend(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I move-result v0 if-eqz v0, :cond_d const/4 v1, 0x1 if-eq v0, v1, :cond_c const/4 v1, 0x2 if-eq v0, v1, :cond_8 const/4 v1, 0x3 if-eq v0, v1, :cond_7 const/4 v1, 0x4 if-eq v0, v1, :cond_6 const/4 v1, 0x5 if-eq v0, v1, :cond_5 goto :goto_3 .line 341 :cond_5 invoke-virtual {v13}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V :goto_3 move-object v0, v13 goto :goto_0 .line 334 :cond_6 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getReceiversCounter$kotlinx_coroutines_core()J move-result-wide v0 cmp-long p1, v9, v0 if-gez p1, :cond_2 invoke-virtual {v13}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_1 .line 347 :cond_7 new-instance p1, Ljava/lang/IllegalStateException; const-string v0, "unexpected" .line 269 invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p1 :cond_8 if-eqz v11, :cond_9 .line 323 invoke-virtual {v13}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V goto :goto_1 .line 326 :cond_9 instance-of p1, v8, Lkotlinx/coroutines/Waiter; if-eqz p1, :cond_a check-cast v8, Lkotlinx/coroutines/Waiter; goto :goto_4 :cond_a const/4 v8, 0x0 :goto_4 if-eqz v8, :cond_b invoke-static {p0, v8, v13, v12}, Lkotlinx/coroutines/channels/BufferedChannel;->access$prepareSenderForSuspension(Lkotlinx/coroutines/channels/BufferedChannel;Lkotlinx/coroutines/Waiter;Lkotlinx/coroutines/channels/ChannelSegment;I)V .line 205 :cond_b invoke-virtual {v13}, Lkotlinx/coroutines/internal/Segment;->onSlotCleaned()V .line 206 sget-object p1, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; invoke-virtual {p1}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->failure-PtdJZtk()Ljava/lang/Object; move-result-object p1 goto :goto_6 .line 200 :cond_c :goto_5 sget-object p1, Lkotlinx/coroutines/channels/ChannelResult;->Companion:Lkotlinx/coroutines/channels/ChannelResult$Companion; sget-object v0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; invoke-virtual {p1, v0}, Lkotlinx/coroutines/channels/ChannelResult$Companion;->success-JP2dKIU(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 goto :goto_6 .line 310 :cond_d invoke-virtual {v13}, Lkotlinx/coroutines/internal/ConcurrentLinkedListNode;->cleanPrev()V goto :goto_5 :goto_6 return-object p1 .end method .method public final updateCellExpandBuffer(Lkotlinx/coroutines/channels/ChannelSegment;IJ)Z .locals 3 .line 1245 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v0 .line 1246 instance-of v1, v0, Lkotlinx/coroutines/Waiter; if-eqz v1, :cond_1 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1254 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v1 cmp-long v1, p3, v1 if-ltz v1, :cond_1 .line 1260 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_EB$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 invoke-virtual {p1, p2, v0, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_1 .line 1261 invoke-virtual {p0, v0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->tryResumeSender(Ljava/lang/Object;Lkotlinx/coroutines/channels/ChannelSegment;I)Z move-result p3 if-eqz p3, :cond_0 .line 1264 sget-object p3, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->setState$kotlinx_coroutines_core(ILjava/lang/Object;)V const/4 p1, 0x1 goto :goto_0 .line 1268 :cond_0 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_SEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p3 invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->setState$kotlinx_coroutines_core(ILjava/lang/Object;)V const/4 p3, 0x0 .line 1269 invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->onCancelledRequest(IZ)V move p1, p3 :goto_0 return p1 .line 1275 :cond_1 invoke-virtual {p0, p1, p2, p3, p4}, Lkotlinx/coroutines/channels/BufferedChannel;->updateCellExpandBufferSlow(Lkotlinx/coroutines/channels/ChannelSegment;IJ)Z move-result p1 return p1 .end method .method public final updateCellExpandBufferSlow(Lkotlinx/coroutines/channels/ChannelSegment;IJ)Z .locals 6 .line 1291 :cond_0 :goto_0 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v0 .line 1294 instance-of v1, v0, Lkotlinx/coroutines/Waiter; const/4 v2, 0x0 const/4 v3, 0x1 if-eqz v1, :cond_3 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1302 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v4 cmp-long v1, p3, v4 if-gez v1, :cond_1 .line 1313 new-instance v1, Lkotlinx/coroutines/channels/WaiterEB; move-object v2, v0 check-cast v2, Lkotlinx/coroutines/Waiter; invoke-direct {v1, v2}, Lkotlinx/coroutines/channels/WaiterEB;->(Lkotlinx/coroutines/Waiter;)V invoke-virtual {p1, p2, v0, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 return v3 .line 1321 :cond_1 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_EB$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 invoke-virtual {p1, p2, v0, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_0 .line 1322 invoke-virtual {p0, v0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->tryResumeSender(Ljava/lang/Object;Lkotlinx/coroutines/channels/ChannelSegment;I)Z move-result p3 if-eqz p3, :cond_2 .line 1325 sget-object p3, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->setState$kotlinx_coroutines_core(ILjava/lang/Object;)V move v2, v3 goto :goto_1 .line 1329 :cond_2 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_SEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p3 invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->setState$kotlinx_coroutines_core(ILjava/lang/Object;)V .line 1330 invoke-virtual {p1, p2, v2}, Lkotlinx/coroutines/channels/ChannelSegment;->onCancelledRequest(IZ)V :goto_1 return v2 .line 1337 :cond_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_SEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_4 return v2 :cond_4 if-nez v0, :cond_5 .line 1343 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getIN_BUFFER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 invoke-virtual {p1, p2, v0, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 return v3 .line 1346 :cond_5 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; if-ne v0, v1, :cond_6 return v3 .line 1348 :cond_6 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getPOISONED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-eq v0, v1, :cond_a invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getDONE_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-eq v0, v1, :cond_a invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_7 goto :goto_2 .line 1351 :cond_7 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_8 return v3 .line 1355 :cond_8 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_9 goto :goto_0 :cond_9 new-instance p1, Ljava/lang/IllegalStateException; .line 1356 new-instance p2, Ljava/lang/StringBuilder; invoke-direct {p2}, Ljava/lang/StringBuilder;->()V const-string p3, "Unexpected cell state: " invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p2 invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p2 invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p1 :cond_a :goto_2 return v3 .end method .method public final updateCellReceive(Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; .locals 5 .line 999 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v0 if-nez v0, :cond_1 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1007 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v1 const-wide v3, 0xfffffffffffffffL and-long/2addr v1, v3 cmp-long v1, p3, v1 if-ltz v1, :cond_2 if-nez p5, :cond_0 .line 1013 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND_NO_WAITER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 return-object p1 .line 1016 :cond_0 invoke-virtual {p1, p2, v0, p5}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_2 .line 1019 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->expandBuffer()V .line 1020 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 return-object p1 .line 1025 :cond_1 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; if-ne v0, v1, :cond_2 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getDONE_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 invoke-virtual {p1, p2, v0, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_2 .line 1027 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->expandBuffer()V .line 1028 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->retrieveElement$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object p1 return-object p1 .line 1031 :cond_2 invoke-virtual/range {p0 .. p5}, Lkotlinx/coroutines/channels/BufferedChannel;->updateCellReceiveSlow(Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; move-result-object p1 return-object p1 .end method .method public final updateCellReceiveSlow(Lkotlinx/coroutines/channels/ChannelSegment;IJLjava/lang/Object;)Ljava/lang/Object; .locals 5 .line 1048 :cond_0 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v0 if-eqz v0, :cond_9 .line 1051 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getIN_BUFFER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_1 goto/16 :goto_1 .line 1085 :cond_1 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; if-ne v0, v1, :cond_2 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getDONE_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 invoke-virtual {p1, p2, v0, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 .line 1087 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->expandBuffer()V .line 1088 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->retrieveElement$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object p1 return-object p1 .line 1091 :cond_2 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_SEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 return-object p1 .line 1094 :cond_3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getPOISONED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_4 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 return-object p1 .line 1096 :cond_4 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-ne v0, v1, :cond_5 .line 1100 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->expandBuffer()V .line 1101 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 return-object p1 .line 1108 :cond_5 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_EB$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-eq v0, v1, :cond_0 .line 1115 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getRESUMING_BY_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 invoke-virtual {p1, p2, v0, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_0 .line 1117 instance-of p3, v0, Lkotlinx/coroutines/channels/WaiterEB; if-eqz p3, :cond_6 .line 1119 check-cast v0, Lkotlinx/coroutines/channels/WaiterEB; iget-object v0, v0, Lkotlinx/coroutines/channels/WaiterEB;->waiter:Lkotlinx/coroutines/Waiter; .line 1120 :cond_6 invoke-virtual {p0, v0, p1, p2}, Lkotlinx/coroutines/channels/BufferedChannel;->tryResumeSender(Ljava/lang/Object;Lkotlinx/coroutines/channels/ChannelSegment;I)Z move-result p4 if-eqz p4, :cond_7 .line 1128 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getDONE_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p3 invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->setState$kotlinx_coroutines_core(ILjava/lang/Object;)V .line 1129 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->expandBuffer()V .line 1130 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->retrieveElement$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object p1 goto :goto_0 .line 1136 :cond_7 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_SEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p4 invoke-virtual {p1, p2, p4}, Lkotlinx/coroutines/channels/ChannelSegment;->setState$kotlinx_coroutines_core(ILjava/lang/Object;)V const/4 p4, 0x0 .line 1137 invoke-virtual {p1, p2, p4}, Lkotlinx/coroutines/channels/ChannelSegment;->onCancelledRequest(IZ)V if-eqz p3, :cond_8 .line 1138 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->expandBuffer()V .line 1139 :cond_8 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 :goto_0 return-object p1 :cond_9 :goto_1 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1056 invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v1 const-wide v3, 0xfffffffffffffffL and-long/2addr v1, v3 cmp-long v1, p3, v1 if-gez v1, :cond_a .line 1061 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getPOISONED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 invoke-virtual {p1, p2, v0, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 .line 1065 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->expandBuffer()V .line 1066 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getFAILED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 return-object p1 :cond_a if-nez p5, :cond_b .line 1073 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND_NO_WAITER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 return-object p1 .line 1076 :cond_b invoke-virtual {p1, p2, v0, p5}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 .line 1079 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->expandBuffer()V .line 1080 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getSUSPEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p1 return-object p1 .end method .method public final updateCellSend(Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I .locals 3 .line 422 invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->storeElement$kotlinx_coroutines_core(ILjava/lang/Object;)V if-eqz p7, :cond_0 .line 423 invoke-virtual/range {p0 .. p7}, Lkotlinx/coroutines/channels/BufferedChannel;->updateCellSendSlow(Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I move-result p1 return p1 .line 425 :cond_0 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v0 const/4 v1, 0x1 if-nez v0, :cond_3 .line 432 invoke-virtual {p0, p4, p5}, Lkotlinx/coroutines/channels/BufferedChannel;->bufferOrRendezvousSend(J)Z move-result v0 const/4 v2, 0x0 if-eqz v0, :cond_1 .line 434 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; invoke-virtual {p1, p2, v2, v0}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_6 return v1 :cond_1 if-nez p6, :cond_2 const/4 p1, 0x3 return p1 .line 448 :cond_2 invoke-virtual {p1, p2, v2, p6}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_6 const/4 p1, 0x2 return p1 .line 453 :cond_3 instance-of v2, v0, Lkotlinx/coroutines/Waiter; if-eqz v2, :cond_6 .line 456 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->cleanElement$kotlinx_coroutines_core(I)V .line 458 invoke-virtual {p0, v0, p3}, Lkotlinx/coroutines/channels/BufferedChannel;->tryResumeReceiver(Ljava/lang/Object;Ljava/lang/Object;)Z move-result p3 if-eqz p3, :cond_4 .line 460 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getDONE_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p3 invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->setState$kotlinx_coroutines_core(ILjava/lang/Object;)V .line 461 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->onReceiveDequeued()V const/4 p1, 0x0 goto :goto_0 .line 468 :cond_4 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p3 invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->getAndSetState$kotlinx_coroutines_core(ILjava/lang/Object;)Ljava/lang/Object; move-result-object p3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p4 if-eq p3, p4, :cond_5 .line 469 invoke-virtual {p1, p2, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->onCancelledRequest(IZ)V :cond_5 const/4 p1, 0x5 :goto_0 return p1 .line 475 :cond_6 invoke-virtual/range {p0 .. p7}, Lkotlinx/coroutines/channels/BufferedChannel;->updateCellSendSlow(Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I move-result p1 return p1 .end method .method public final updateCellSendSlow(Lkotlinx/coroutines/channels/ChannelSegment;ILjava/lang/Object;JLjava/lang/Object;Z)I .locals 5 .line 499 :cond_0 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->getState$kotlinx_coroutines_core(I)Ljava/lang/Object; move-result-object v0 const/4 v1, 0x4 const/4 v2, 0x0 const/4 v3, 0x1 if-nez v0, :cond_4 .line 506 invoke-virtual {p0, p4, p5}, Lkotlinx/coroutines/channels/BufferedChannel;->bufferOrRendezvousSend(J)Z move-result v0 const/4 v4, 0x0 if-eqz v0, :cond_1 if-nez p7, :cond_1 .line 508 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; invoke-virtual {p1, p2, v4, v0}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 return v3 :cond_1 if-eqz p7, :cond_2 .line 519 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_SEND$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v0 invoke-virtual {p1, p2, v4, v0}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 .line 520 invoke-virtual {p1, p2, v2}, Lkotlinx/coroutines/channels/ChannelSegment;->onCancelledRequest(IZ)V return v1 :cond_2 if-nez p6, :cond_3 const/4 p1, 0x3 return p1 .line 526 :cond_3 invoke-virtual {p1, p2, v4, p6}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 const/4 p1, 0x2 return p1 .line 531 :cond_4 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getIN_BUFFER$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v4 if-ne v0, v4, :cond_5 .line 533 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannelKt;->BUFFERED:Lkotlinx/coroutines/internal/Symbol; invoke-virtual {p1, p2, v0, v1}, Lkotlinx/coroutines/channels/ChannelSegment;->casState$kotlinx_coroutines_core(ILjava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 return v3 .line 539 :cond_5 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p4 const/4 p5, 0x5 if-ne v0, p4, :cond_6 .line 541 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->cleanElement$kotlinx_coroutines_core(I)V return p5 .line 545 :cond_6 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getPOISONED$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p4 if-ne v0, p4, :cond_7 .line 547 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->cleanElement$kotlinx_coroutines_core(I)V return p5 .line 551 :cond_7 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->getCHANNEL_CLOSED()Lkotlinx/coroutines/internal/Symbol; move-result-object p4 if-ne v0, p4, :cond_8 .line 555 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->cleanElement$kotlinx_coroutines_core(I)V .line 556 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->completeCloseOrCancel()V return v1 .line 564 :cond_8 invoke-virtual {p1, p2}, Lkotlinx/coroutines/channels/ChannelSegment;->cleanElement$kotlinx_coroutines_core(I)V .line 568 instance-of p4, v0, Lkotlinx/coroutines/channels/WaiterEB; if-eqz p4, :cond_9 check-cast v0, Lkotlinx/coroutines/channels/WaiterEB; iget-object v0, v0, Lkotlinx/coroutines/channels/WaiterEB;->waiter:Lkotlinx/coroutines/Waiter; .line 570 :cond_9 invoke-virtual {p0, v0, p3}, Lkotlinx/coroutines/channels/BufferedChannel;->tryResumeReceiver(Ljava/lang/Object;Ljava/lang/Object;)Z move-result p3 if-eqz p3, :cond_a .line 572 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getDONE_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p3 invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->setState$kotlinx_coroutines_core(ILjava/lang/Object;)V .line 573 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->onReceiveDequeued()V goto :goto_0 .line 580 :cond_a invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p3 invoke-virtual {p1, p2, p3}, Lkotlinx/coroutines/channels/ChannelSegment;->getAndSetState$kotlinx_coroutines_core(ILjava/lang/Object;)Ljava/lang/Object; move-result-object p3 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getINTERRUPTED_RCV$p()Lkotlinx/coroutines/internal/Symbol; move-result-object p4 if-eq p3, p4, :cond_b .line 581 invoke-virtual {p1, p2, v3}, Lkotlinx/coroutines/channels/ChannelSegment;->onCancelledRequest(IZ)V :cond_b move v2, p5 :goto_0 return v2 .end method .method public final updateReceiversCounterIfLower(J)V .locals 7 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; :cond_0 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v3 cmp-long v1, v3, p1 if-ltz v1, :cond_1 return-void :cond_1 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->receivers$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-object v2, p0 move-wide v5, p1 .line 2555 invoke-virtual/range {v1 .. v6}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result v1 if-eqz v1, :cond_0 return-void .end method .method public final updateSendersCounterIfLower(J)V .locals 7 sget-object v0, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; :cond_0 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v3 const-wide v1, 0xfffffffffffffffL and-long/2addr v1, v3 cmp-long v5, v1, p1 if-ltz v5, :cond_1 return-void :cond_1 const/16 v5, 0x3c shr-long v5, v3, v5 long-to-int v5, v5 .line 2541 invoke-static {v1, v2, v5}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$constructSendersAndCloseStatus(JI)J move-result-wide v5 sget-object v1, Lkotlinx/coroutines/channels/BufferedChannel;->sendersAndCloseStatus$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; move-object v2, p0 .line 2542 invoke-virtual/range {v1 .. v6}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result v1 if-eqz v1, :cond_0 return-void .end method .method public final waitExpandBufferCompletion$kotlinx_coroutines_core(J)V .locals 13 .line 1393 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->isRendezvousOrUnlimited()Z move-result v0 if-eqz v0, :cond_0 return-void .line 1397 :cond_0 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide v0 cmp-long v0, v0, p1 if-lez v0, :cond_0 .line 1402 invoke-static {}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$getEXPAND_BUFFER_COMPLETION_WAIT_ITERATIONS$p()I move-result p1 const/4 v0, 0x0 move p2, v0 :goto_0 const-wide v1, 0x3fffffffffffffffL # 1.9999999999999998 if-ge p2, p1, :cond_2 .line 1404 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide v3 sget-object v5, Lkotlinx/coroutines/channels/BufferedChannel;->completedExpandBuffersAndPauseFlag$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1406 invoke-virtual {v5, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v5 and-long/2addr v1, v5 cmp-long v1, v3, v1 if-nez v1, :cond_1 .line 1412 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide v1 cmp-long v1, v3, v1 if-nez v1, :cond_1 return-void :cond_1 add-int/lit8 p2, p2, 0x1 goto :goto_0 :cond_2 sget-object v9, Lkotlinx/coroutines/channels/BufferedChannel;->completedExpandBuffersAndPauseFlag$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1402 :cond_3 invoke-virtual {v9, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v5 and-long p1, v5, v1 const/4 v10, 0x1 .line 1416 invoke-static {p1, p2, v10}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$constructEBCompletedAndPauseFlag(JZ)J move-result-wide v7 move-object v3, v9 move-object v4, p0 invoke-virtual/range {v3 .. v8}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result p1 if-eqz p1, :cond_3 .line 1421 :cond_4 :goto_1 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide p1 sget-object v9, Lkotlinx/coroutines/channels/BufferedChannel;->completedExpandBuffersAndPauseFlag$FU:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; .line 1424 invoke-virtual {v9, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v5 and-long v3, v5, v1 const-wide/high16 v7, 0x4000000000000000L # 2.0 and-long/2addr v7, v5 const-wide/16 v11, 0x0 cmp-long v7, v7, v11 if-eqz v7, :cond_5 move v7, v10 goto :goto_2 :cond_5 move v7, v0 :goto_2 cmp-long v8, p1, v3 if-nez v8, :cond_7 .line 1430 invoke-virtual {p0}, Lkotlinx/coroutines/channels/BufferedChannel;->getBufferEndCounter()J move-result-wide v11 cmp-long p1, p1, v11 if-nez p1, :cond_7 :cond_6 invoke-virtual {v9, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->get(Ljava/lang/Object;)J move-result-wide v5 and-long p1, v5, v1 .line 1433 invoke-static {p1, p2, v0}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$constructEBCompletedAndPauseFlag(JZ)J move-result-wide v7 move-object v3, v9 move-object v4, p0 invoke-virtual/range {v3 .. v8}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result p1 if-eqz p1, :cond_6 return-void :cond_7 if-nez v7, :cond_4 .line 1443 invoke-static {v3, v4, v10}, Lkotlinx/coroutines/channels/BufferedChannelKt;->access$constructEBCompletedAndPauseFlag(JZ)J move-result-wide v7 move-object v3, v9 move-object v4, p0 invoke-virtual/range {v3 .. v8}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z goto :goto_1 .end method