123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053 |
- .class public final Lio/reactivex/internal/util/QueueDrainHelper;
- .super Ljava/lang/Object;
- .source "QueueDrainHelper.java"
- # static fields
- .field static final COMPLETED_MASK:J = -0x8000000000000000L
- .field static final REQUESTED_MASK:J = 0x7fffffffffffffffL
- # direct methods
- .method private constructor <init>()V
- .locals 2
- .line 32
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- .line 33
- new-instance v0, Ljava/lang/IllegalStateException;
- const-string v1, "No instances!"
- invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw v0
- .end method
- .method public static checkTerminated(ZZLio/reactivex/Observer;ZLio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/disposables/Disposable;Lio/reactivex/internal/util/ObservableQueueDrain;)Z
- .locals 2
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- "U:",
- "Ljava/lang/Object;",
- ">(ZZ",
- "Lio/reactivex/Observer<",
- "*>;Z",
- "Lio/reactivex/internal/fuseable/SimpleQueue<",
- "*>;",
- "Lio/reactivex/disposables/Disposable;",
- "Lio/reactivex/internal/util/ObservableQueueDrain<",
- "TT;TU;>;)Z"
- }
- .end annotation
- .line 229
- invoke-interface {p6}, Lio/reactivex/internal/util/ObservableQueueDrain;->cancelled()Z
- move-result v0
- const/4 v1, 0x1
- if-eqz v0, :cond_0
- .line 230
- invoke-interface {p4}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
- .line 231
- invoke-interface {p5}, Lio/reactivex/disposables/Disposable;->dispose()V
- return v1
- :cond_0
- if-eqz p0, :cond_4
- if-eqz p3, :cond_2
- if-eqz p1, :cond_4
- .line 238
- invoke-interface {p5}, Lio/reactivex/disposables/Disposable;->dispose()V
- .line 239
- invoke-interface {p6}, Lio/reactivex/internal/util/ObservableQueueDrain;->error()Ljava/lang/Throwable;
- move-result-object p0
- if-eqz p0, :cond_1
- .line 241
- invoke-interface {p2, p0}, Lio/reactivex/Observer;->onError(Ljava/lang/Throwable;)V
- goto :goto_0
- .line 243
- :cond_1
- invoke-interface {p2}, Lio/reactivex/Observer;->onComplete()V
- :goto_0
- return v1
- .line 248
- :cond_2
- invoke-interface {p6}, Lio/reactivex/internal/util/ObservableQueueDrain;->error()Ljava/lang/Throwable;
- move-result-object p0
- if-eqz p0, :cond_3
- .line 250
- invoke-interface {p4}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
- .line 251
- invoke-interface {p5}, Lio/reactivex/disposables/Disposable;->dispose()V
- .line 252
- invoke-interface {p2, p0}, Lio/reactivex/Observer;->onError(Ljava/lang/Throwable;)V
- return v1
- :cond_3
- if-eqz p1, :cond_4
- .line 256
- invoke-interface {p5}, Lio/reactivex/disposables/Disposable;->dispose()V
- .line 257
- invoke-interface {p2}, Lio/reactivex/Observer;->onComplete()V
- return v1
- :cond_4
- const/4 p0, 0x0
- return p0
- .end method
- .method public static checkTerminated(ZZLorg/reactivestreams/Subscriber;ZLio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/internal/util/QueueDrain;)Z
- .locals 2
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- "U:",
- "Ljava/lang/Object;",
- ">(ZZ",
- "Lorg/reactivestreams/Subscriber<",
- "*>;Z",
- "Lio/reactivex/internal/fuseable/SimpleQueue<",
- "*>;",
- "Lio/reactivex/internal/util/QueueDrain<",
- "TT;TU;>;)Z"
- }
- .end annotation
- .line 153
- invoke-interface {p5}, Lio/reactivex/internal/util/QueueDrain;->cancelled()Z
- move-result v0
- const/4 v1, 0x1
- if-eqz v0, :cond_0
- .line 154
- invoke-interface {p4}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
- return v1
- :cond_0
- if-eqz p0, :cond_4
- if-eqz p3, :cond_2
- if-eqz p1, :cond_4
- .line 161
- invoke-interface {p5}, Lio/reactivex/internal/util/QueueDrain;->error()Ljava/lang/Throwable;
- move-result-object p0
- if-eqz p0, :cond_1
- .line 163
- invoke-interface {p2, p0}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
- goto :goto_0
- .line 165
- :cond_1
- invoke-interface {p2}, Lorg/reactivestreams/Subscriber;->onComplete()V
- :goto_0
- return v1
- .line 170
- :cond_2
- invoke-interface {p5}, Lio/reactivex/internal/util/QueueDrain;->error()Ljava/lang/Throwable;
- move-result-object p0
- if-eqz p0, :cond_3
- .line 172
- invoke-interface {p4}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
- .line 173
- invoke-interface {p2, p0}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
- return v1
- :cond_3
- if-eqz p1, :cond_4
- .line 177
- invoke-interface {p2}, Lorg/reactivestreams/Subscriber;->onComplete()V
- return v1
- :cond_4
- const/4 p0, 0x0
- return p0
- .end method
- .method public static createQueue(I)Lio/reactivex/internal/fuseable/SimpleQueue;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">(I)",
- "Lio/reactivex/internal/fuseable/SimpleQueue<",
- "TT;>;"
- }
- .end annotation
- if-gez p0, :cond_0
- .line 276
- new-instance v0, Lio/reactivex/internal/queue/SpscLinkedArrayQueue;
- neg-int p0, p0
- invoke-direct {v0, p0}, Lio/reactivex/internal/queue/SpscLinkedArrayQueue;-><init>(I)V
- return-object v0
- .line 278
- :cond_0
- new-instance v0, Lio/reactivex/internal/queue/SpscArrayQueue;
- invoke-direct {v0, p0}, Lio/reactivex/internal/queue/SpscArrayQueue;-><init>(I)V
- return-object v0
- .end method
- .method public static drainLoop(Lio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/Observer;ZLio/reactivex/disposables/Disposable;Lio/reactivex/internal/util/ObservableQueueDrain;)V
- .locals 11
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- "U:",
- "Ljava/lang/Object;",
- ">(",
- "Lio/reactivex/internal/fuseable/SimpleQueue<",
- "TT;>;",
- "Lio/reactivex/Observer<",
- "-TU;>;Z",
- "Lio/reactivex/disposables/Disposable;",
- "Lio/reactivex/internal/util/ObservableQueueDrain<",
- "TT;TU;>;)V"
- }
- .end annotation
- const/4 v0, 0x1
- const/4 v1, 0x1
- .line 191
- :cond_0
- invoke-interface {p4}, Lio/reactivex/internal/util/ObservableQueueDrain;->done()Z
- move-result v2
- invoke-interface {p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->isEmpty()Z
- move-result v3
- move-object v4, p1
- move v5, p2
- move-object v6, p0
- move-object v7, p3
- move-object v8, p4
- invoke-static/range {v2 .. v8}, Lio/reactivex/internal/util/QueueDrainHelper;->checkTerminated(ZZLio/reactivex/Observer;ZLio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/disposables/Disposable;Lio/reactivex/internal/util/ObservableQueueDrain;)Z
- move-result v2
- if-eqz v2, :cond_1
- return-void
- .line 196
- :cond_1
- :goto_0
- invoke-interface {p4}, Lio/reactivex/internal/util/ObservableQueueDrain;->done()Z
- move-result v3
- .line 200
- :try_start_0
- invoke-interface {p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->poll()Ljava/lang/Object;
- move-result-object v2
- :try_end_0
- .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
- if-nez v2, :cond_2
- const/4 v10, 0x1
- goto :goto_1
- :cond_2
- const/4 v4, 0x0
- const/4 v10, 0x0
- :goto_1
- move v4, v10
- move-object v5, p1
- move v6, p2
- move-object v7, p0
- move-object v8, p3
- move-object v9, p4
- .line 209
- invoke-static/range {v3 .. v9}, Lio/reactivex/internal/util/QueueDrainHelper;->checkTerminated(ZZLio/reactivex/Observer;ZLio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/disposables/Disposable;Lio/reactivex/internal/util/ObservableQueueDrain;)Z
- move-result v3
- if-eqz v3, :cond_3
- return-void
- :cond_3
- if-eqz v10, :cond_4
- neg-int v1, v1
- .line 220
- invoke-interface {p4, v1}, Lio/reactivex/internal/util/ObservableQueueDrain;->leave(I)I
- move-result v1
- if-nez v1, :cond_0
- return-void
- .line 217
- :cond_4
- invoke-interface {p4, p1, v2}, Lio/reactivex/internal/util/ObservableQueueDrain;->accept(Lio/reactivex/Observer;Ljava/lang/Object;)V
- goto :goto_0
- :catch_0
- move-exception p0
- .line 202
- invoke-static {p0}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
- .line 203
- invoke-interface {p1, p0}, Lio/reactivex/Observer;->onError(Ljava/lang/Throwable;)V
- return-void
- .end method
- .method public static drainLoop(Lio/reactivex/internal/fuseable/SimpleQueue;Lorg/reactivestreams/Subscriber;ZLio/reactivex/internal/util/QueueDrain;)V
- .locals 17
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- "U:",
- "Ljava/lang/Object;",
- ">(",
- "Lio/reactivex/internal/fuseable/SimpleQueue<",
- "TT;>;",
- "Lorg/reactivestreams/Subscriber<",
- "-TU;>;Z",
- "Lio/reactivex/internal/util/QueueDrain<",
- "TT;TU;>;)V"
- }
- .end annotation
- move-object/from16 v7, p1
- move-object/from16 v0, p3
- const/4 v9, 0x1
- .line 41
- :cond_0
- invoke-interface/range {p3 .. p3}, Lio/reactivex/internal/util/QueueDrain;->done()Z
- move-result v1
- invoke-interface/range {p0 .. p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->isEmpty()Z
- move-result v2
- move-object/from16 v3, p1
- move/from16 v4, p2
- move-object/from16 v5, p0
- move-object/from16 v6, p3
- invoke-static/range {v1 .. v6}, Lio/reactivex/internal/util/QueueDrainHelper;->checkTerminated(ZZLorg/reactivestreams/Subscriber;ZLio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/internal/util/QueueDrain;)Z
- move-result v1
- if-eqz v1, :cond_1
- return-void
- .line 45
- :cond_1
- invoke-interface/range {p3 .. p3}, Lio/reactivex/internal/util/QueueDrain;->requested()J
- move-result-wide v10
- const-wide/16 v12, 0x0
- move-wide v14, v12
- :cond_2
- :goto_0
- cmp-long v1, v14, v10
- if-eqz v1, :cond_6
- .line 49
- invoke-interface/range {p3 .. p3}, Lio/reactivex/internal/util/QueueDrain;->done()Z
- move-result v1
- .line 53
- :try_start_0
- invoke-interface/range {p0 .. p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->poll()Ljava/lang/Object;
- move-result-object v6
- :try_end_0
- .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
- if-nez v6, :cond_3
- const/16 v16, 0x1
- goto :goto_1
- :cond_3
- const/4 v2, 0x0
- const/16 v16, 0x0
- :goto_1
- move/from16 v2, v16
- move-object/from16 v3, p1
- move/from16 v4, p2
- move-object/from16 v5, p0
- move-object v8, v6
- move-object/from16 v6, p3
- .line 62
- invoke-static/range {v1 .. v6}, Lio/reactivex/internal/util/QueueDrainHelper;->checkTerminated(ZZLorg/reactivestreams/Subscriber;ZLio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/internal/util/QueueDrain;)Z
- move-result v1
- if-eqz v1, :cond_4
- return-void
- :cond_4
- if-eqz v16, :cond_5
- goto :goto_2
- .line 70
- :cond_5
- invoke-interface {v0, v7, v8}, Lio/reactivex/internal/util/QueueDrain;->accept(Lorg/reactivestreams/Subscriber;Ljava/lang/Object;)Z
- move-result v1
- if-eqz v1, :cond_2
- const-wide/16 v1, 0x1
- add-long/2addr v14, v1
- goto :goto_0
- :catch_0
- move-exception v0
- move-object v1, v0
- .line 55
- invoke-static {v1}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
- .line 56
- invoke-interface {v7, v1}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
- return-void
- :cond_6
- :goto_2
- cmp-long v1, v14, v12
- if-eqz v1, :cond_7
- const-wide v1, 0x7fffffffffffffffL
- cmp-long v3, v10, v1
- if-eqz v3, :cond_7
- .line 76
- invoke-interface {v0, v14, v15}, Lio/reactivex/internal/util/QueueDrain;->produced(J)J
- :cond_7
- neg-int v1, v9
- .line 79
- invoke-interface {v0, v1}, Lio/reactivex/internal/util/QueueDrain;->leave(I)I
- move-result v9
- if-nez v9, :cond_0
- return-void
- .end method
- .method public static drainMaxLoop(Lio/reactivex/internal/fuseable/SimpleQueue;Lorg/reactivestreams/Subscriber;ZLio/reactivex/disposables/Disposable;Lio/reactivex/internal/util/QueueDrain;)V
- .locals 10
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- "U:",
- "Ljava/lang/Object;",
- ">(",
- "Lio/reactivex/internal/fuseable/SimpleQueue<",
- "TT;>;",
- "Lorg/reactivestreams/Subscriber<",
- "-TU;>;Z",
- "Lio/reactivex/disposables/Disposable;",
- "Lio/reactivex/internal/util/QueueDrain<",
- "TT;TU;>;)V"
- }
- .end annotation
- const/4 v0, 0x1
- const/4 v1, 0x1
- .line 102
- :cond_0
- :goto_0
- invoke-interface {p4}, Lio/reactivex/internal/util/QueueDrain;->done()Z
- move-result v2
- .line 107
- :try_start_0
- invoke-interface {p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->poll()Ljava/lang/Object;
- move-result-object v8
- :try_end_0
- .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
- if-nez v8, :cond_1
- const/4 v9, 0x1
- goto :goto_1
- :cond_1
- const/4 v3, 0x0
- const/4 v9, 0x0
- :goto_1
- move v3, v9
- move-object v4, p1
- move v5, p2
- move-object v6, p0
- move-object v7, p4
- .line 116
- invoke-static/range {v2 .. v7}, Lio/reactivex/internal/util/QueueDrainHelper;->checkTerminated(ZZLorg/reactivestreams/Subscriber;ZLio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/internal/util/QueueDrain;)Z
- move-result v2
- if-eqz v2, :cond_3
- if-eqz p3, :cond_2
- .line 118
- invoke-interface {p3}, Lio/reactivex/disposables/Disposable;->dispose()V
- :cond_2
- return-void
- :cond_3
- if-eqz v9, :cond_4
- neg-int v1, v1
- .line 144
- invoke-interface {p4, v1}, Lio/reactivex/internal/util/QueueDrain;->leave(I)I
- move-result v1
- if-nez v1, :cond_0
- return-void
- .line 127
- :cond_4
- invoke-interface {p4}, Lio/reactivex/internal/util/QueueDrain;->requested()J
- move-result-wide v2
- const-wide/16 v4, 0x0
- cmp-long v6, v2, v4
- if-eqz v6, :cond_5
- .line 129
- invoke-interface {p4, p1, v8}, Lio/reactivex/internal/util/QueueDrain;->accept(Lorg/reactivestreams/Subscriber;Ljava/lang/Object;)Z
- move-result v4
- if-eqz v4, :cond_0
- const-wide v4, 0x7fffffffffffffffL
- cmp-long v6, v2, v4
- if-eqz v6, :cond_0
- const-wide/16 v2, 0x1
- .line 131
- invoke-interface {p4, v2, v3}, Lio/reactivex/internal/util/QueueDrain;->produced(J)J
- goto :goto_0
- .line 135
- :cond_5
- invoke-interface {p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
- if-eqz p3, :cond_6
- .line 137
- invoke-interface {p3}, Lio/reactivex/disposables/Disposable;->dispose()V
- .line 139
- :cond_6
- new-instance p0, Lio/reactivex/exceptions/MissingBackpressureException;
- const-string p2, "Could not emit value due to lack of requests."
- invoke-direct {p0, p2}, Lio/reactivex/exceptions/MissingBackpressureException;-><init>(Ljava/lang/String;)V
- invoke-interface {p1, p0}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
- return-void
- :catch_0
- move-exception p0
- .line 109
- invoke-static {p0}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
- .line 110
- invoke-interface {p1, p0}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
- return-void
- .end method
- .method static isCancelled(Lio/reactivex/functions/BooleanSupplier;)Z
- .locals 0
- .line 344
- :try_start_0
- invoke-interface {p0}, Lio/reactivex/functions/BooleanSupplier;->getAsBoolean()Z
- move-result p0
- :try_end_0
- .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
- return p0
- :catch_0
- move-exception p0
- .line 346
- invoke-static {p0}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
- const/4 p0, 0x1
- return p0
- .end method
- .method public static postComplete(Lorg/reactivestreams/Subscriber;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lio/reactivex/functions/BooleanSupplier;)V
- .locals 15
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">(",
- "Lorg/reactivestreams/Subscriber<",
- "-TT;>;",
- "Ljava/util/Queue<",
- "TT;>;",
- "Ljava/util/concurrent/atomic/AtomicLong;",
- "Lio/reactivex/functions/BooleanSupplier;",
- ")V"
- }
- .end annotation
- .line 461
- invoke-interface/range {p1 .. p1}, Ljava/util/Queue;->isEmpty()Z
- move-result v0
- if-eqz v0, :cond_0
- .line 462
- invoke-interface {p0}, Lorg/reactivestreams/Subscriber;->onComplete()V
- return-void
- .line 466
- :cond_0
- invoke-virtual/range {p2 .. p2}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
- move-result-wide v1
- move-object v3, p0
- move-object/from16 v4, p1
- move-object/from16 v5, p2
- move-object/from16 v6, p3
- invoke-static/range {v1 .. v6}, Lio/reactivex/internal/util/QueueDrainHelper;->postCompleteDrain(JLorg/reactivestreams/Subscriber;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lio/reactivex/functions/BooleanSupplier;)Z
- move-result v0
- if-eqz v0, :cond_1
- return-void
- .line 471
- :cond_1
- invoke-virtual/range {p2 .. p2}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
- move-result-wide v0
- const-wide/high16 v2, -0x8000000000000000L
- and-long v4, v0, v2
- const-wide/16 v6, 0x0
- cmp-long v8, v4, v6
- if-eqz v8, :cond_2
- return-void
- :cond_2
- or-long v9, v0, v2
- move-object/from16 v2, p2
- .line 479
- invoke-virtual {v2, v0, v1, v9, v10}, Ljava/util/concurrent/atomic/AtomicLong;->compareAndSet(JJ)Z
- move-result v3
- if-eqz v3, :cond_1
- cmp-long v3, v0, v6
- if-eqz v3, :cond_3
- move-object v11, p0
- move-object/from16 v12, p1
- move-object/from16 v13, p2
- move-object/from16 v14, p3
- .line 482
- invoke-static/range {v9 .. v14}, Lio/reactivex/internal/util/QueueDrainHelper;->postCompleteDrain(JLorg/reactivestreams/Subscriber;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lio/reactivex/functions/BooleanSupplier;)Z
- :cond_3
- return-void
- .end method
- .method static postCompleteDrain(JLorg/reactivestreams/Subscriber;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lio/reactivex/functions/BooleanSupplier;)Z
- .locals 9
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">(J",
- "Lorg/reactivestreams/Subscriber<",
- "-TT;>;",
- "Ljava/util/Queue<",
- "TT;>;",
- "Ljava/util/concurrent/atomic/AtomicLong;",
- "Lio/reactivex/functions/BooleanSupplier;",
- ")Z"
- }
- .end annotation
- const-wide/high16 v0, -0x8000000000000000L
- and-long v2, p0, v0
- :cond_0
- :goto_0
- const/4 v4, 0x1
- cmp-long v5, v2, p0
- if-eqz v5, :cond_3
- .line 392
- invoke-static {p5}, Lio/reactivex/internal/util/QueueDrainHelper;->isCancelled(Lio/reactivex/functions/BooleanSupplier;)Z
- move-result v5
- if-eqz v5, :cond_1
- return v4
- .line 396
- :cond_1
- invoke-interface {p3}, Ljava/util/Queue;->poll()Ljava/lang/Object;
- move-result-object v5
- if-nez v5, :cond_2
- .line 399
- invoke-interface {p2}, Lorg/reactivestreams/Subscriber;->onComplete()V
- return v4
- .line 403
- :cond_2
- invoke-interface {p2, v5}, Lorg/reactivestreams/Subscriber;->onNext(Ljava/lang/Object;)V
- const-wide/16 v4, 0x1
- add-long/2addr v2, v4
- goto :goto_0
- .line 407
- :cond_3
- invoke-static {p5}, Lio/reactivex/internal/util/QueueDrainHelper;->isCancelled(Lio/reactivex/functions/BooleanSupplier;)Z
- move-result p0
- if-eqz p0, :cond_4
- return v4
- .line 411
- :cond_4
- invoke-interface {p3}, Ljava/util/Queue;->isEmpty()Z
- move-result p0
- if-eqz p0, :cond_5
- .line 412
- invoke-interface {p2}, Lorg/reactivestreams/Subscriber;->onComplete()V
- return v4
- .line 416
- :cond_5
- invoke-virtual {p4}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
- move-result-wide p0
- cmp-long v4, p0, v2
- if-nez v4, :cond_0
- const-wide p0, 0x7fffffffffffffffL
- and-long/2addr v2, p0
- neg-long v2, v2
- .line 420
- invoke-virtual {p4, v2, v3}, Ljava/util/concurrent/atomic/AtomicLong;->addAndGet(J)J
- move-result-wide v2
- and-long/2addr p0, v2
- const-wide/16 v4, 0x0
- cmp-long v6, p0, v4
- if-nez v6, :cond_6
- const/4 p0, 0x0
- return p0
- :cond_6
- and-long p0, v2, v0
- move-wide v7, p0
- move-wide p0, v2
- move-wide v2, v7
- goto :goto_0
- .end method
- .method public static postCompleteRequest(JLorg/reactivestreams/Subscriber;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lio/reactivex/functions/BooleanSupplier;)Z
- .locals 14
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">(J",
- "Lorg/reactivestreams/Subscriber<",
- "-TT;>;",
- "Ljava/util/Queue<",
- "TT;>;",
- "Ljava/util/concurrent/atomic/AtomicLong;",
- "Lio/reactivex/functions/BooleanSupplier;",
- ")Z"
- }
- .end annotation
- move-wide v0, p0
- .line 319
- :cond_0
- invoke-virtual/range {p4 .. p4}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
- move-result-wide v2
- const-wide v4, 0x7fffffffffffffffL
- and-long/2addr v4, v2
- const-wide/high16 v6, -0x8000000000000000L
- and-long v8, v2, v6
- .line 325
- invoke-static {v4, v5, p0, p1}, Lio/reactivex/internal/util/BackpressureHelper;->addCap(JJ)J
- move-result-wide v4
- or-long/2addr v4, v8
- move-object/from16 v12, p4
- .line 327
- invoke-virtual {v12, v2, v3, v4, v5}, Ljava/util/concurrent/atomic/AtomicLong;->compareAndSet(JJ)Z
- move-result v4
- if-eqz v4, :cond_0
- cmp-long v4, v2, v6
- if-nez v4, :cond_1
- or-long v8, v0, v6
- move-object/from16 v10, p2
- move-object/from16 v11, p3
- move-object/from16 v12, p4
- move-object/from16 v13, p5
- .line 331
- invoke-static/range {v8 .. v13}, Lio/reactivex/internal/util/QueueDrainHelper;->postCompleteDrain(JLorg/reactivestreams/Subscriber;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lio/reactivex/functions/BooleanSupplier;)Z
- const/4 v0, 0x1
- return v0
- :cond_1
- const/4 v0, 0x0
- return v0
- .end method
- .method public static request(Lorg/reactivestreams/Subscription;I)V
- .locals 2
- if-gez p1, :cond_0
- const-wide v0, 0x7fffffffffffffffL
- goto :goto_0
- :cond_0
- int-to-long v0, p1
- .line 288
- :goto_0
- invoke-interface {p0, v0, v1}, Lorg/reactivestreams/Subscription;->request(J)V
- return-void
- .end method
|