SinglePostCompleteSubscriber.smali 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. .class public abstract Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;
  2. .super Ljava/util/concurrent/atomic/AtomicLong;
  3. .source "SinglePostCompleteSubscriber.java"
  4. # interfaces
  5. .implements Lorg/reactivestreams/Subscriber;
  6. .implements Lorg/reactivestreams/Subscription;
  7. # annotations
  8. .annotation system Ldalvik/annotation/Signature;
  9. value = {
  10. "<T:",
  11. "Ljava/lang/Object;",
  12. "R:",
  13. "Ljava/lang/Object;",
  14. ">",
  15. "Ljava/util/concurrent/atomic/AtomicLong;",
  16. "Lorg/reactivestreams/Subscriber<",
  17. "TT;>;",
  18. "Lorg/reactivestreams/Subscription;"
  19. }
  20. .end annotation
  21. # static fields
  22. .field static final COMPLETE_MASK:J = -0x8000000000000000L
  23. .field static final REQUEST_MASK:J = 0x7fffffffffffffffL
  24. .field private static final serialVersionUID:J = 0x6de1ba4ffe60ebe0L
  25. # instance fields
  26. .field protected final actual:Lorg/reactivestreams/Subscriber;
  27. .annotation system Ldalvik/annotation/Signature;
  28. value = {
  29. "Lorg/reactivestreams/Subscriber<",
  30. "-TR;>;"
  31. }
  32. .end annotation
  33. .end field
  34. .field protected produced:J
  35. .field protected s:Lorg/reactivestreams/Subscription;
  36. .field protected value:Ljava/lang/Object;
  37. .annotation system Ldalvik/annotation/Signature;
  38. value = {
  39. "TR;"
  40. }
  41. .end annotation
  42. .end field
  43. # direct methods
  44. .method public constructor <init>(Lorg/reactivestreams/Subscriber;)V
  45. .locals 0
  46. .annotation system Ldalvik/annotation/Signature;
  47. value = {
  48. "(",
  49. "Lorg/reactivestreams/Subscriber<",
  50. "-TR;>;)V"
  51. }
  52. .end annotation
  53. .line 50
  54. invoke-direct {p0}, Ljava/util/concurrent/atomic/AtomicLong;-><init>()V
  55. .line 51
  56. iput-object p1, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->actual:Lorg/reactivestreams/Subscriber;
  57. return-void
  58. .end method
  59. # virtual methods
  60. .method public cancel()V
  61. .locals 1
  62. .line 123
  63. iget-object v0, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->s:Lorg/reactivestreams/Subscription;
  64. invoke-interface {v0}, Lorg/reactivestreams/Subscription;->cancel()V
  65. return-void
  66. .end method
  67. .method protected final complete(Ljava/lang/Object;)V
  68. .locals 9
  69. .annotation system Ldalvik/annotation/Signature;
  70. value = {
  71. "(TR;)V"
  72. }
  73. .end annotation
  74. .line 67
  75. iget-wide v0, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->produced:J
  76. const-wide/16 v2, 0x0
  77. cmp-long v4, v0, v2
  78. if-eqz v4, :cond_0
  79. .line 69
  80. invoke-static {p0, v0, v1}, Lio/reactivex/internal/util/BackpressureHelper;->produced(Ljava/util/concurrent/atomic/AtomicLong;J)J
  81. .line 73
  82. :cond_0
  83. :goto_0
  84. invoke-virtual {p0}, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->get()J
  85. move-result-wide v0
  86. const-wide/high16 v4, -0x8000000000000000L
  87. and-long v6, v0, v4
  88. cmp-long v8, v6, v2
  89. if-eqz v8, :cond_1
  90. .line 75
  91. invoke-virtual {p0, p1}, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->onDrop(Ljava/lang/Object;)V
  92. return-void
  93. :cond_1
  94. const-wide v6, 0x7fffffffffffffffL
  95. and-long/2addr v0, v6
  96. cmp-long v6, v0, v2
  97. if-eqz v6, :cond_2
  98. const-wide v0, -0x7fffffffffffffffL # -4.9E-324
  99. .line 79
  100. invoke-virtual {p0, v0, v1}, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->lazySet(J)V
  101. .line 80
  102. iget-object v0, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->actual:Lorg/reactivestreams/Subscriber;
  103. invoke-interface {v0, p1}, Lorg/reactivestreams/Subscriber;->onNext(Ljava/lang/Object;)V
  104. .line 81
  105. iget-object p1, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->actual:Lorg/reactivestreams/Subscriber;
  106. invoke-interface {p1}, Lorg/reactivestreams/Subscriber;->onComplete()V
  107. return-void
  108. .line 84
  109. :cond_2
  110. iput-object p1, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->value:Ljava/lang/Object;
  111. .line 85
  112. invoke-virtual {p0, v2, v3, v4, v5}, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->compareAndSet(JJ)Z
  113. move-result v0
  114. if-eqz v0, :cond_3
  115. return-void
  116. :cond_3
  117. const/4 v0, 0x0
  118. .line 88
  119. iput-object v0, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->value:Ljava/lang/Object;
  120. goto :goto_0
  121. .end method
  122. .method protected onDrop(Ljava/lang/Object;)V
  123. .locals 0
  124. .annotation system Ldalvik/annotation/Signature;
  125. value = {
  126. "(TR;)V"
  127. }
  128. .end annotation
  129. return-void
  130. .end method
  131. .method public onSubscribe(Lorg/reactivestreams/Subscription;)V
  132. .locals 1
  133. .line 56
  134. iget-object v0, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->s:Lorg/reactivestreams/Subscription;
  135. invoke-static {v0, p1}, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->validate(Lorg/reactivestreams/Subscription;Lorg/reactivestreams/Subscription;)Z
  136. move-result v0
  137. if-eqz v0, :cond_0
  138. .line 57
  139. iput-object p1, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->s:Lorg/reactivestreams/Subscription;
  140. .line 58
  141. iget-object p1, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->actual:Lorg/reactivestreams/Subscriber;
  142. invoke-interface {p1, p0}, Lorg/reactivestreams/Subscriber;->onSubscribe(Lorg/reactivestreams/Subscription;)V
  143. :cond_0
  144. return-void
  145. .end method
  146. .method public final request(J)V
  147. .locals 9
  148. .line 102
  149. invoke-static {p1, p2}, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->validate(J)Z
  150. move-result v0
  151. if-eqz v0, :cond_2
  152. .line 104
  153. :cond_0
  154. invoke-virtual {p0}, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->get()J
  155. move-result-wide v0
  156. const-wide/high16 v2, -0x8000000000000000L
  157. and-long v4, v0, v2
  158. const-wide/16 v6, 0x0
  159. cmp-long v8, v4, v6
  160. if-eqz v8, :cond_1
  161. const-wide p1, -0x7fffffffffffffffL # -4.9E-324
  162. .line 106
  163. invoke-virtual {p0, v2, v3, p1, p2}, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->compareAndSet(JJ)Z
  164. move-result p1
  165. if-eqz p1, :cond_2
  166. .line 107
  167. iget-object p1, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->actual:Lorg/reactivestreams/Subscriber;
  168. iget-object p2, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->value:Ljava/lang/Object;
  169. invoke-interface {p1, p2}, Lorg/reactivestreams/Subscriber;->onNext(Ljava/lang/Object;)V
  170. .line 108
  171. iget-object p1, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->actual:Lorg/reactivestreams/Subscriber;
  172. invoke-interface {p1}, Lorg/reactivestreams/Subscriber;->onComplete()V
  173. goto :goto_0
  174. .line 112
  175. :cond_1
  176. invoke-static {v0, v1, p1, p2}, Lio/reactivex/internal/util/BackpressureHelper;->addCap(JJ)J
  177. move-result-wide v2
  178. .line 113
  179. invoke-virtual {p0, v0, v1, v2, v3}, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->compareAndSet(JJ)Z
  180. move-result v0
  181. if-eqz v0, :cond_0
  182. .line 114
  183. iget-object v0, p0, Lio/reactivex/internal/subscribers/SinglePostCompleteSubscriber;->s:Lorg/reactivestreams/Subscription;
  184. invoke-interface {v0, p1, p2}, Lorg/reactivestreams/Subscription;->request(J)V
  185. :cond_2
  186. :goto_0
  187. return-void
  188. .end method