496 lines
14 KiB
Smali
496 lines
14 KiB
Smali
.class final Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;
|
|
.super Ljava/util/concurrent/atomic/AtomicLong;
|
|
.source "FlowableBuffer.java"
|
|
|
|
# interfaces
|
|
.implements Lkh/o;
|
|
.implements Lok/e;
|
|
.implements Lph/e;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lio/reactivex/internal/operators/flowable/FlowableBuffer;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "PublisherBufferOverlappingSubscriber"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
"C::",
|
|
"Ljava/util/Collection<",
|
|
"-TT;>;>",
|
|
"Ljava/util/concurrent/atomic/AtomicLong;",
|
|
"Lkh/o<",
|
|
"TT;>;",
|
|
"Lok/e;",
|
|
"Lph/e;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final serialVersionUID:J = -0x66485ec0ba03436dL
|
|
|
|
|
|
# instance fields
|
|
.field public final bufferSupplier:Ljava/util/concurrent/Callable;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/Callable<",
|
|
"TC;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final buffers:Ljava/util/ArrayDeque;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayDeque<",
|
|
"TC;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public volatile cancelled:Z
|
|
|
|
.field public done:Z
|
|
|
|
.field public final downstream:Lok/d;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lok/d<",
|
|
"-TC;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public index:I
|
|
|
|
.field public final once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
.field public produced:J
|
|
|
|
.field public final size:I
|
|
|
|
.field public final skip:I
|
|
|
|
.field public upstream:Lok/e;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lok/d;IILjava/util/concurrent/Callable;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lok/d<",
|
|
"-TC;>;II",
|
|
"Ljava/util/concurrent/Callable<",
|
|
"TC;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/util/concurrent/atomic/AtomicLong;-><init>()V
|
|
|
|
.line 2
|
|
iput-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->downstream:Lok/d;
|
|
|
|
.line 3
|
|
iput p2, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->size:I
|
|
|
|
.line 4
|
|
iput p3, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->skip:I
|
|
|
|
.line 5
|
|
iput-object p4, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->bufferSupplier:Ljava/util/concurrent/Callable;
|
|
|
|
.line 6
|
|
new-instance p1, Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
invoke-direct {p1}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>()V
|
|
|
|
iput-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
.line 7
|
|
new-instance p1, Ljava/util/ArrayDeque;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayDeque;-><init>()V
|
|
|
|
iput-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->buffers:Ljava/util/ArrayDeque;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public cancel()V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 1
|
|
iput-boolean v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->cancelled:Z
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->upstream:Lok/e;
|
|
|
|
invoke-interface {v0}, Lok/e;->cancel()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public getAsBoolean()Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-boolean v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->cancelled:Z
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public onComplete()V
|
|
.locals 4
|
|
|
|
.line 1
|
|
iget-boolean v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->done:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
.line 2
|
|
iput-boolean v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->done:Z
|
|
|
|
.line 3
|
|
iget-wide v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->produced:J
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v2, v0, v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 4
|
|
invoke-static {p0, v0, v1}, Lio/reactivex/internal/util/b;->e(Ljava/util/concurrent/atomic/AtomicLong;J)J
|
|
|
|
.line 5
|
|
:cond_1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->downstream:Lok/d;
|
|
|
|
iget-object v1, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->buffers:Ljava/util/ArrayDeque;
|
|
|
|
invoke-static {v0, v1, p0, p0}, Lio/reactivex/internal/util/n;->g(Lok/d;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lph/e;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onError(Ljava/lang/Throwable;)V
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-boolean v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->done:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-static {p1}, Lwh/a;->Y(Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
.line 3
|
|
iput-boolean v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->done:Z
|
|
|
|
.line 4
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->buffers:Ljava/util/ArrayDeque;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->clear()V
|
|
|
|
.line 5
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->downstream:Lok/d;
|
|
|
|
invoke-interface {v0, p1}, Lok/d;->onError(Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onNext(Ljava/lang/Object;)V
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-boolean v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->done:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->buffers:Ljava/util/ArrayDeque;
|
|
|
|
.line 3
|
|
iget v1, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->index:I
|
|
|
|
add-int/lit8 v2, v1, 0x1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
.line 4
|
|
:try_start_0
|
|
iget-object v1, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->bufferSupplier:Ljava/util/concurrent/Callable;
|
|
|
|
invoke-interface {v1}, Ljava/util/concurrent/Callable;->call()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v3, "The bufferSupplier returned a null buffer"
|
|
|
|
invoke-static {v1, v3}, Lio/reactivex/internal/functions/a;->g(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Collection;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 5
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayDeque;->offer(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
.line 6
|
|
invoke-static {p1}, Lio/reactivex/exceptions/a;->b(Ljava/lang/Throwable;)V
|
|
|
|
.line 7
|
|
invoke-virtual {p0}, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->cancel()V
|
|
|
|
.line 8
|
|
invoke-virtual {p0, p1}, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->onError(Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
|
|
.line 9
|
|
:cond_1
|
|
:goto_0
|
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->peek()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Collection;
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 10
|
|
invoke-interface {v1}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v3
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
iget v4, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->size:I
|
|
|
|
if-ne v3, v4, :cond_2
|
|
|
|
.line 11
|
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->poll()Ljava/lang/Object;
|
|
|
|
.line 12
|
|
invoke-interface {v1, p1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
.line 13
|
|
iget-wide v3, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->produced:J
|
|
|
|
const-wide/16 v5, 0x1
|
|
|
|
add-long/2addr v3, v5
|
|
|
|
iput-wide v3, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->produced:J
|
|
|
|
.line 14
|
|
iget-object v3, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->downstream:Lok/d;
|
|
|
|
invoke-interface {v3, v1}, Lok/d;->onNext(Ljava/lang/Object;)V
|
|
|
|
.line 15
|
|
:cond_2
|
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_1
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Collection;
|
|
|
|
.line 16
|
|
invoke-interface {v1, p1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
.line 17
|
|
:cond_3
|
|
iget p1, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->skip:I
|
|
|
|
if-ne v2, p1, :cond_4
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 18
|
|
:cond_4
|
|
iput v2, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->index:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onSubscribe(Lok/e;)V
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->upstream:Lok/e;
|
|
|
|
invoke-static {v0, p1}, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->validate(Lok/e;Lok/e;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
iput-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->upstream:Lok/e;
|
|
|
|
.line 3
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->downstream:Lok/d;
|
|
|
|
invoke-interface {p1, p0}, Lok/d;->onSubscribe(Lok/e;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public request(J)V
|
|
.locals 7
|
|
|
|
.line 1
|
|
invoke-static {p1, p2}, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->validate(J)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 2
|
|
iget-object v3, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->downstream:Lok/d;
|
|
|
|
iget-object v4, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->buffers:Ljava/util/ArrayDeque;
|
|
|
|
move-wide v1, p1
|
|
|
|
move-object v5, p0
|
|
|
|
move-object v6, p0
|
|
|
|
invoke-static/range {v1 .. v6}, Lio/reactivex/internal/util/n;->i(JLok/d;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lph/e;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_0
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 4
|
|
iget v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->skip:I
|
|
|
|
int-to-long v0, v0
|
|
|
|
const-wide/16 v2, 0x1
|
|
|
|
sub-long/2addr p1, v2
|
|
|
|
invoke-static {v0, v1, p1, p2}, Lio/reactivex/internal/util/b;->d(JJ)J
|
|
|
|
move-result-wide p1
|
|
|
|
.line 5
|
|
iget v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->size:I
|
|
|
|
int-to-long v0, v0
|
|
|
|
invoke-static {v0, v1, p1, p2}, Lio/reactivex/internal/util/b;->c(JJ)J
|
|
|
|
move-result-wide p1
|
|
|
|
.line 6
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->upstream:Lok/e;
|
|
|
|
invoke-interface {v0, p1, p2}, Lok/e;->request(J)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 7
|
|
:cond_1
|
|
iget v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->skip:I
|
|
|
|
int-to-long v0, v0
|
|
|
|
invoke-static {v0, v1, p1, p2}, Lio/reactivex/internal/util/b;->d(JJ)J
|
|
|
|
move-result-wide p1
|
|
|
|
.line 8
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableBuffer$PublisherBufferOverlappingSubscriber;->upstream:Lok/e;
|
|
|
|
invoke-interface {v0, p1, p2}, Lok/e;->request(J)V
|
|
|
|
:cond_2
|
|
:goto_0
|
|
return-void
|
|
.end method
|