123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- .class public final Lio/reactivex/internal/util/BackpressureHelper;
- .super Ljava/lang/Object;
- .source "BackpressureHelper.java"
- # direct methods
- .method private constructor <init>()V
- .locals 2
- .line 24
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- .line 25
- 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 add(Ljava/util/concurrent/atomic/AtomicLong;J)J
- .locals 5
- .line 67
- :cond_0
- invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
- move-result-wide v0
- const-wide v2, 0x7fffffffffffffffL
- cmp-long v4, v0, v2
- if-nez v4, :cond_1
- return-wide v2
- .line 71
- :cond_1
- invoke-static {v0, v1, p1, p2}, Lio/reactivex/internal/util/BackpressureHelper;->addCap(JJ)J
- move-result-wide v2
- .line 72
- invoke-virtual {p0, v0, v1, v2, v3}, Ljava/util/concurrent/atomic/AtomicLong;->compareAndSet(JJ)Z
- move-result v2
- if-eqz v2, :cond_0
- return-wide v0
- .end method
- .method public static addCancel(Ljava/util/concurrent/atomic/AtomicLong;J)J
- .locals 5
- .line 88
- :cond_0
- invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
- move-result-wide v0
- const-wide/high16 v2, -0x8000000000000000L
- cmp-long v4, v0, v2
- if-nez v4, :cond_1
- return-wide v2
- :cond_1
- const-wide v2, 0x7fffffffffffffffL
- cmp-long v4, v0, v2
- if-nez v4, :cond_2
- return-wide v2
- .line 95
- :cond_2
- invoke-static {v0, v1, p1, p2}, Lio/reactivex/internal/util/BackpressureHelper;->addCap(JJ)J
- move-result-wide v2
- .line 96
- invoke-virtual {p0, v0, v1, v2, v3}, Ljava/util/concurrent/atomic/AtomicLong;->compareAndSet(JJ)Z
- move-result v2
- if-eqz v2, :cond_0
- return-wide v0
- .end method
- .method public static addCap(JJ)J
- .locals 1
- add-long/2addr p0, p2
- const-wide/16 p2, 0x0
- cmp-long v0, p0, p2
- if-gez v0, :cond_0
- const-wide p0, 0x7fffffffffffffffL
- :cond_0
- return-wide p0
- .end method
- .method public static multiplyCap(JJ)J
- .locals 7
- mul-long v0, p0, p2
- or-long v2, p0, p2
- const/16 v4, 0x1f
- ushr-long/2addr v2, v4
- const-wide/16 v4, 0x0
- cmp-long v6, v2, v4
- if-eqz v6, :cond_0
- .line 51
- div-long p0, v0, p0
- cmp-long v2, p0, p2
- if-eqz v2, :cond_0
- const-wide p0, 0x7fffffffffffffffL
- return-wide p0
- :cond_0
- return-wide v0
- .end method
- .method public static produced(Ljava/util/concurrent/atomic/AtomicLong;J)J
- .locals 9
- .line 110
- :cond_0
- invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
- move-result-wide v0
- const-wide v2, 0x7fffffffffffffffL
- cmp-long v4, v0, v2
- if-nez v4, :cond_1
- return-wide v2
- :cond_1
- sub-long v2, v0, p1
- const-wide/16 v4, 0x0
- cmp-long v6, v2, v4
- if-gez v6, :cond_2
- .line 116
- new-instance v6, Ljava/lang/IllegalStateException;
- new-instance v7, Ljava/lang/StringBuilder;
- invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
- const-string v8, "More produced than requested: "
- invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v7, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
- invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v2
- invoke-direct {v6, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- invoke-static {v6}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V
- move-wide v2, v4
- .line 119
- :cond_2
- invoke-virtual {p0, v0, v1, v2, v3}, Ljava/util/concurrent/atomic/AtomicLong;->compareAndSet(JJ)Z
- move-result v0
- if-eqz v0, :cond_0
- return-wide v2
- .end method
- .method public static producedCancel(Ljava/util/concurrent/atomic/AtomicLong;J)J
- .locals 9
- .line 134
- :cond_0
- invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
- move-result-wide v0
- const-wide/high16 v2, -0x8000000000000000L
- cmp-long v4, v0, v2
- if-nez v4, :cond_1
- return-wide v2
- :cond_1
- const-wide v2, 0x7fffffffffffffffL
- cmp-long v4, v0, v2
- if-nez v4, :cond_2
- return-wide v2
- :cond_2
- sub-long v2, v0, p1
- const-wide/16 v4, 0x0
- cmp-long v6, v2, v4
- if-gez v6, :cond_3
- .line 143
- new-instance v6, Ljava/lang/IllegalStateException;
- new-instance v7, Ljava/lang/StringBuilder;
- invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
- const-string v8, "More produced than requested: "
- invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v7, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
- invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v2
- invoke-direct {v6, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- invoke-static {v6}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V
- move-wide v2, v4
- .line 146
- :cond_3
- invoke-virtual {p0, v0, v1, v2, v3}, Ljava/util/concurrent/atomic/AtomicLong;->compareAndSet(JJ)Z
- move-result v0
- if-eqz v0, :cond_0
- return-wide v2
- .end method
|