QueueDrainHelper.smali 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  1. .class public final Lio/reactivex/internal/util/QueueDrainHelper;
  2. .super Ljava/lang/Object;
  3. .source "QueueDrainHelper.java"
  4. # static fields
  5. .field static final COMPLETED_MASK:J = -0x8000000000000000L
  6. .field static final REQUESTED_MASK:J = 0x7fffffffffffffffL
  7. # direct methods
  8. .method private constructor <init>()V
  9. .locals 2
  10. .line 32
  11. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  12. .line 33
  13. new-instance v0, Ljava/lang/IllegalStateException;
  14. const-string v1, "No instances!"
  15. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  16. throw v0
  17. .end method
  18. .method public static checkTerminated(ZZLio/reactivex/Observer;ZLio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/disposables/Disposable;Lio/reactivex/internal/util/ObservableQueueDrain;)Z
  19. .locals 2
  20. .annotation system Ldalvik/annotation/Signature;
  21. value = {
  22. "<T:",
  23. "Ljava/lang/Object;",
  24. "U:",
  25. "Ljava/lang/Object;",
  26. ">(ZZ",
  27. "Lio/reactivex/Observer<",
  28. "*>;Z",
  29. "Lio/reactivex/internal/fuseable/SimpleQueue<",
  30. "*>;",
  31. "Lio/reactivex/disposables/Disposable;",
  32. "Lio/reactivex/internal/util/ObservableQueueDrain<",
  33. "TT;TU;>;)Z"
  34. }
  35. .end annotation
  36. .line 229
  37. invoke-interface {p6}, Lio/reactivex/internal/util/ObservableQueueDrain;->cancelled()Z
  38. move-result v0
  39. const/4 v1, 0x1
  40. if-eqz v0, :cond_0
  41. .line 230
  42. invoke-interface {p4}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
  43. .line 231
  44. invoke-interface {p5}, Lio/reactivex/disposables/Disposable;->dispose()V
  45. return v1
  46. :cond_0
  47. if-eqz p0, :cond_4
  48. if-eqz p3, :cond_2
  49. if-eqz p1, :cond_4
  50. .line 238
  51. invoke-interface {p5}, Lio/reactivex/disposables/Disposable;->dispose()V
  52. .line 239
  53. invoke-interface {p6}, Lio/reactivex/internal/util/ObservableQueueDrain;->error()Ljava/lang/Throwable;
  54. move-result-object p0
  55. if-eqz p0, :cond_1
  56. .line 241
  57. invoke-interface {p2, p0}, Lio/reactivex/Observer;->onError(Ljava/lang/Throwable;)V
  58. goto :goto_0
  59. .line 243
  60. :cond_1
  61. invoke-interface {p2}, Lio/reactivex/Observer;->onComplete()V
  62. :goto_0
  63. return v1
  64. .line 248
  65. :cond_2
  66. invoke-interface {p6}, Lio/reactivex/internal/util/ObservableQueueDrain;->error()Ljava/lang/Throwable;
  67. move-result-object p0
  68. if-eqz p0, :cond_3
  69. .line 250
  70. invoke-interface {p4}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
  71. .line 251
  72. invoke-interface {p5}, Lio/reactivex/disposables/Disposable;->dispose()V
  73. .line 252
  74. invoke-interface {p2, p0}, Lio/reactivex/Observer;->onError(Ljava/lang/Throwable;)V
  75. return v1
  76. :cond_3
  77. if-eqz p1, :cond_4
  78. .line 256
  79. invoke-interface {p5}, Lio/reactivex/disposables/Disposable;->dispose()V
  80. .line 257
  81. invoke-interface {p2}, Lio/reactivex/Observer;->onComplete()V
  82. return v1
  83. :cond_4
  84. const/4 p0, 0x0
  85. return p0
  86. .end method
  87. .method public static checkTerminated(ZZLorg/reactivestreams/Subscriber;ZLio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/internal/util/QueueDrain;)Z
  88. .locals 2
  89. .annotation system Ldalvik/annotation/Signature;
  90. value = {
  91. "<T:",
  92. "Ljava/lang/Object;",
  93. "U:",
  94. "Ljava/lang/Object;",
  95. ">(ZZ",
  96. "Lorg/reactivestreams/Subscriber<",
  97. "*>;Z",
  98. "Lio/reactivex/internal/fuseable/SimpleQueue<",
  99. "*>;",
  100. "Lio/reactivex/internal/util/QueueDrain<",
  101. "TT;TU;>;)Z"
  102. }
  103. .end annotation
  104. .line 153
  105. invoke-interface {p5}, Lio/reactivex/internal/util/QueueDrain;->cancelled()Z
  106. move-result v0
  107. const/4 v1, 0x1
  108. if-eqz v0, :cond_0
  109. .line 154
  110. invoke-interface {p4}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
  111. return v1
  112. :cond_0
  113. if-eqz p0, :cond_4
  114. if-eqz p3, :cond_2
  115. if-eqz p1, :cond_4
  116. .line 161
  117. invoke-interface {p5}, Lio/reactivex/internal/util/QueueDrain;->error()Ljava/lang/Throwable;
  118. move-result-object p0
  119. if-eqz p0, :cond_1
  120. .line 163
  121. invoke-interface {p2, p0}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
  122. goto :goto_0
  123. .line 165
  124. :cond_1
  125. invoke-interface {p2}, Lorg/reactivestreams/Subscriber;->onComplete()V
  126. :goto_0
  127. return v1
  128. .line 170
  129. :cond_2
  130. invoke-interface {p5}, Lio/reactivex/internal/util/QueueDrain;->error()Ljava/lang/Throwable;
  131. move-result-object p0
  132. if-eqz p0, :cond_3
  133. .line 172
  134. invoke-interface {p4}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
  135. .line 173
  136. invoke-interface {p2, p0}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
  137. return v1
  138. :cond_3
  139. if-eqz p1, :cond_4
  140. .line 177
  141. invoke-interface {p2}, Lorg/reactivestreams/Subscriber;->onComplete()V
  142. return v1
  143. :cond_4
  144. const/4 p0, 0x0
  145. return p0
  146. .end method
  147. .method public static createQueue(I)Lio/reactivex/internal/fuseable/SimpleQueue;
  148. .locals 1
  149. .annotation system Ldalvik/annotation/Signature;
  150. value = {
  151. "<T:",
  152. "Ljava/lang/Object;",
  153. ">(I)",
  154. "Lio/reactivex/internal/fuseable/SimpleQueue<",
  155. "TT;>;"
  156. }
  157. .end annotation
  158. if-gez p0, :cond_0
  159. .line 276
  160. new-instance v0, Lio/reactivex/internal/queue/SpscLinkedArrayQueue;
  161. neg-int p0, p0
  162. invoke-direct {v0, p0}, Lio/reactivex/internal/queue/SpscLinkedArrayQueue;-><init>(I)V
  163. return-object v0
  164. .line 278
  165. :cond_0
  166. new-instance v0, Lio/reactivex/internal/queue/SpscArrayQueue;
  167. invoke-direct {v0, p0}, Lio/reactivex/internal/queue/SpscArrayQueue;-><init>(I)V
  168. return-object v0
  169. .end method
  170. .method public static drainLoop(Lio/reactivex/internal/fuseable/SimpleQueue;Lio/reactivex/Observer;ZLio/reactivex/disposables/Disposable;Lio/reactivex/internal/util/ObservableQueueDrain;)V
  171. .locals 11
  172. .annotation system Ldalvik/annotation/Signature;
  173. value = {
  174. "<T:",
  175. "Ljava/lang/Object;",
  176. "U:",
  177. "Ljava/lang/Object;",
  178. ">(",
  179. "Lio/reactivex/internal/fuseable/SimpleQueue<",
  180. "TT;>;",
  181. "Lio/reactivex/Observer<",
  182. "-TU;>;Z",
  183. "Lio/reactivex/disposables/Disposable;",
  184. "Lio/reactivex/internal/util/ObservableQueueDrain<",
  185. "TT;TU;>;)V"
  186. }
  187. .end annotation
  188. const/4 v0, 0x1
  189. const/4 v1, 0x1
  190. .line 191
  191. :cond_0
  192. invoke-interface {p4}, Lio/reactivex/internal/util/ObservableQueueDrain;->done()Z
  193. move-result v2
  194. invoke-interface {p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->isEmpty()Z
  195. move-result v3
  196. move-object v4, p1
  197. move v5, p2
  198. move-object v6, p0
  199. move-object v7, p3
  200. move-object v8, p4
  201. 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
  202. move-result v2
  203. if-eqz v2, :cond_1
  204. return-void
  205. .line 196
  206. :cond_1
  207. :goto_0
  208. invoke-interface {p4}, Lio/reactivex/internal/util/ObservableQueueDrain;->done()Z
  209. move-result v3
  210. .line 200
  211. :try_start_0
  212. invoke-interface {p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->poll()Ljava/lang/Object;
  213. move-result-object v2
  214. :try_end_0
  215. .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
  216. if-nez v2, :cond_2
  217. const/4 v10, 0x1
  218. goto :goto_1
  219. :cond_2
  220. const/4 v4, 0x0
  221. const/4 v10, 0x0
  222. :goto_1
  223. move v4, v10
  224. move-object v5, p1
  225. move v6, p2
  226. move-object v7, p0
  227. move-object v8, p3
  228. move-object v9, p4
  229. .line 209
  230. 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
  231. move-result v3
  232. if-eqz v3, :cond_3
  233. return-void
  234. :cond_3
  235. if-eqz v10, :cond_4
  236. neg-int v1, v1
  237. .line 220
  238. invoke-interface {p4, v1}, Lio/reactivex/internal/util/ObservableQueueDrain;->leave(I)I
  239. move-result v1
  240. if-nez v1, :cond_0
  241. return-void
  242. .line 217
  243. :cond_4
  244. invoke-interface {p4, p1, v2}, Lio/reactivex/internal/util/ObservableQueueDrain;->accept(Lio/reactivex/Observer;Ljava/lang/Object;)V
  245. goto :goto_0
  246. :catch_0
  247. move-exception p0
  248. .line 202
  249. invoke-static {p0}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
  250. .line 203
  251. invoke-interface {p1, p0}, Lio/reactivex/Observer;->onError(Ljava/lang/Throwable;)V
  252. return-void
  253. .end method
  254. .method public static drainLoop(Lio/reactivex/internal/fuseable/SimpleQueue;Lorg/reactivestreams/Subscriber;ZLio/reactivex/internal/util/QueueDrain;)V
  255. .locals 17
  256. .annotation system Ldalvik/annotation/Signature;
  257. value = {
  258. "<T:",
  259. "Ljava/lang/Object;",
  260. "U:",
  261. "Ljava/lang/Object;",
  262. ">(",
  263. "Lio/reactivex/internal/fuseable/SimpleQueue<",
  264. "TT;>;",
  265. "Lorg/reactivestreams/Subscriber<",
  266. "-TU;>;Z",
  267. "Lio/reactivex/internal/util/QueueDrain<",
  268. "TT;TU;>;)V"
  269. }
  270. .end annotation
  271. move-object/from16 v7, p1
  272. move-object/from16 v0, p3
  273. const/4 v9, 0x1
  274. .line 41
  275. :cond_0
  276. invoke-interface/range {p3 .. p3}, Lio/reactivex/internal/util/QueueDrain;->done()Z
  277. move-result v1
  278. invoke-interface/range {p0 .. p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->isEmpty()Z
  279. move-result v2
  280. move-object/from16 v3, p1
  281. move/from16 v4, p2
  282. move-object/from16 v5, p0
  283. move-object/from16 v6, p3
  284. 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
  285. move-result v1
  286. if-eqz v1, :cond_1
  287. return-void
  288. .line 45
  289. :cond_1
  290. invoke-interface/range {p3 .. p3}, Lio/reactivex/internal/util/QueueDrain;->requested()J
  291. move-result-wide v10
  292. const-wide/16 v12, 0x0
  293. move-wide v14, v12
  294. :cond_2
  295. :goto_0
  296. cmp-long v1, v14, v10
  297. if-eqz v1, :cond_6
  298. .line 49
  299. invoke-interface/range {p3 .. p3}, Lio/reactivex/internal/util/QueueDrain;->done()Z
  300. move-result v1
  301. .line 53
  302. :try_start_0
  303. invoke-interface/range {p0 .. p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->poll()Ljava/lang/Object;
  304. move-result-object v6
  305. :try_end_0
  306. .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
  307. if-nez v6, :cond_3
  308. const/16 v16, 0x1
  309. goto :goto_1
  310. :cond_3
  311. const/4 v2, 0x0
  312. const/16 v16, 0x0
  313. :goto_1
  314. move/from16 v2, v16
  315. move-object/from16 v3, p1
  316. move/from16 v4, p2
  317. move-object/from16 v5, p0
  318. move-object v8, v6
  319. move-object/from16 v6, p3
  320. .line 62
  321. 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
  322. move-result v1
  323. if-eqz v1, :cond_4
  324. return-void
  325. :cond_4
  326. if-eqz v16, :cond_5
  327. goto :goto_2
  328. .line 70
  329. :cond_5
  330. invoke-interface {v0, v7, v8}, Lio/reactivex/internal/util/QueueDrain;->accept(Lorg/reactivestreams/Subscriber;Ljava/lang/Object;)Z
  331. move-result v1
  332. if-eqz v1, :cond_2
  333. const-wide/16 v1, 0x1
  334. add-long/2addr v14, v1
  335. goto :goto_0
  336. :catch_0
  337. move-exception v0
  338. move-object v1, v0
  339. .line 55
  340. invoke-static {v1}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
  341. .line 56
  342. invoke-interface {v7, v1}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
  343. return-void
  344. :cond_6
  345. :goto_2
  346. cmp-long v1, v14, v12
  347. if-eqz v1, :cond_7
  348. const-wide v1, 0x7fffffffffffffffL
  349. cmp-long v3, v10, v1
  350. if-eqz v3, :cond_7
  351. .line 76
  352. invoke-interface {v0, v14, v15}, Lio/reactivex/internal/util/QueueDrain;->produced(J)J
  353. :cond_7
  354. neg-int v1, v9
  355. .line 79
  356. invoke-interface {v0, v1}, Lio/reactivex/internal/util/QueueDrain;->leave(I)I
  357. move-result v9
  358. if-nez v9, :cond_0
  359. return-void
  360. .end method
  361. .method public static drainMaxLoop(Lio/reactivex/internal/fuseable/SimpleQueue;Lorg/reactivestreams/Subscriber;ZLio/reactivex/disposables/Disposable;Lio/reactivex/internal/util/QueueDrain;)V
  362. .locals 10
  363. .annotation system Ldalvik/annotation/Signature;
  364. value = {
  365. "<T:",
  366. "Ljava/lang/Object;",
  367. "U:",
  368. "Ljava/lang/Object;",
  369. ">(",
  370. "Lio/reactivex/internal/fuseable/SimpleQueue<",
  371. "TT;>;",
  372. "Lorg/reactivestreams/Subscriber<",
  373. "-TU;>;Z",
  374. "Lio/reactivex/disposables/Disposable;",
  375. "Lio/reactivex/internal/util/QueueDrain<",
  376. "TT;TU;>;)V"
  377. }
  378. .end annotation
  379. const/4 v0, 0x1
  380. const/4 v1, 0x1
  381. .line 102
  382. :cond_0
  383. :goto_0
  384. invoke-interface {p4}, Lio/reactivex/internal/util/QueueDrain;->done()Z
  385. move-result v2
  386. .line 107
  387. :try_start_0
  388. invoke-interface {p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->poll()Ljava/lang/Object;
  389. move-result-object v8
  390. :try_end_0
  391. .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
  392. if-nez v8, :cond_1
  393. const/4 v9, 0x1
  394. goto :goto_1
  395. :cond_1
  396. const/4 v3, 0x0
  397. const/4 v9, 0x0
  398. :goto_1
  399. move v3, v9
  400. move-object v4, p1
  401. move v5, p2
  402. move-object v6, p0
  403. move-object v7, p4
  404. .line 116
  405. 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
  406. move-result v2
  407. if-eqz v2, :cond_3
  408. if-eqz p3, :cond_2
  409. .line 118
  410. invoke-interface {p3}, Lio/reactivex/disposables/Disposable;->dispose()V
  411. :cond_2
  412. return-void
  413. :cond_3
  414. if-eqz v9, :cond_4
  415. neg-int v1, v1
  416. .line 144
  417. invoke-interface {p4, v1}, Lio/reactivex/internal/util/QueueDrain;->leave(I)I
  418. move-result v1
  419. if-nez v1, :cond_0
  420. return-void
  421. .line 127
  422. :cond_4
  423. invoke-interface {p4}, Lio/reactivex/internal/util/QueueDrain;->requested()J
  424. move-result-wide v2
  425. const-wide/16 v4, 0x0
  426. cmp-long v6, v2, v4
  427. if-eqz v6, :cond_5
  428. .line 129
  429. invoke-interface {p4, p1, v8}, Lio/reactivex/internal/util/QueueDrain;->accept(Lorg/reactivestreams/Subscriber;Ljava/lang/Object;)Z
  430. move-result v4
  431. if-eqz v4, :cond_0
  432. const-wide v4, 0x7fffffffffffffffL
  433. cmp-long v6, v2, v4
  434. if-eqz v6, :cond_0
  435. const-wide/16 v2, 0x1
  436. .line 131
  437. invoke-interface {p4, v2, v3}, Lio/reactivex/internal/util/QueueDrain;->produced(J)J
  438. goto :goto_0
  439. .line 135
  440. :cond_5
  441. invoke-interface {p0}, Lio/reactivex/internal/fuseable/SimpleQueue;->clear()V
  442. if-eqz p3, :cond_6
  443. .line 137
  444. invoke-interface {p3}, Lio/reactivex/disposables/Disposable;->dispose()V
  445. .line 139
  446. :cond_6
  447. new-instance p0, Lio/reactivex/exceptions/MissingBackpressureException;
  448. const-string p2, "Could not emit value due to lack of requests."
  449. invoke-direct {p0, p2}, Lio/reactivex/exceptions/MissingBackpressureException;-><init>(Ljava/lang/String;)V
  450. invoke-interface {p1, p0}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
  451. return-void
  452. :catch_0
  453. move-exception p0
  454. .line 109
  455. invoke-static {p0}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
  456. .line 110
  457. invoke-interface {p1, p0}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V
  458. return-void
  459. .end method
  460. .method static isCancelled(Lio/reactivex/functions/BooleanSupplier;)Z
  461. .locals 0
  462. .line 344
  463. :try_start_0
  464. invoke-interface {p0}, Lio/reactivex/functions/BooleanSupplier;->getAsBoolean()Z
  465. move-result p0
  466. :try_end_0
  467. .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
  468. return p0
  469. :catch_0
  470. move-exception p0
  471. .line 346
  472. invoke-static {p0}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
  473. const/4 p0, 0x1
  474. return p0
  475. .end method
  476. .method public static postComplete(Lorg/reactivestreams/Subscriber;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lio/reactivex/functions/BooleanSupplier;)V
  477. .locals 15
  478. .annotation system Ldalvik/annotation/Signature;
  479. value = {
  480. "<T:",
  481. "Ljava/lang/Object;",
  482. ">(",
  483. "Lorg/reactivestreams/Subscriber<",
  484. "-TT;>;",
  485. "Ljava/util/Queue<",
  486. "TT;>;",
  487. "Ljava/util/concurrent/atomic/AtomicLong;",
  488. "Lio/reactivex/functions/BooleanSupplier;",
  489. ")V"
  490. }
  491. .end annotation
  492. .line 461
  493. invoke-interface/range {p1 .. p1}, Ljava/util/Queue;->isEmpty()Z
  494. move-result v0
  495. if-eqz v0, :cond_0
  496. .line 462
  497. invoke-interface {p0}, Lorg/reactivestreams/Subscriber;->onComplete()V
  498. return-void
  499. .line 466
  500. :cond_0
  501. invoke-virtual/range {p2 .. p2}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
  502. move-result-wide v1
  503. move-object v3, p0
  504. move-object/from16 v4, p1
  505. move-object/from16 v5, p2
  506. move-object/from16 v6, p3
  507. 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
  508. move-result v0
  509. if-eqz v0, :cond_1
  510. return-void
  511. .line 471
  512. :cond_1
  513. invoke-virtual/range {p2 .. p2}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
  514. move-result-wide v0
  515. const-wide/high16 v2, -0x8000000000000000L
  516. and-long v4, v0, v2
  517. const-wide/16 v6, 0x0
  518. cmp-long v8, v4, v6
  519. if-eqz v8, :cond_2
  520. return-void
  521. :cond_2
  522. or-long v9, v0, v2
  523. move-object/from16 v2, p2
  524. .line 479
  525. invoke-virtual {v2, v0, v1, v9, v10}, Ljava/util/concurrent/atomic/AtomicLong;->compareAndSet(JJ)Z
  526. move-result v3
  527. if-eqz v3, :cond_1
  528. cmp-long v3, v0, v6
  529. if-eqz v3, :cond_3
  530. move-object v11, p0
  531. move-object/from16 v12, p1
  532. move-object/from16 v13, p2
  533. move-object/from16 v14, p3
  534. .line 482
  535. 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
  536. :cond_3
  537. return-void
  538. .end method
  539. .method static postCompleteDrain(JLorg/reactivestreams/Subscriber;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lio/reactivex/functions/BooleanSupplier;)Z
  540. .locals 9
  541. .annotation system Ldalvik/annotation/Signature;
  542. value = {
  543. "<T:",
  544. "Ljava/lang/Object;",
  545. ">(J",
  546. "Lorg/reactivestreams/Subscriber<",
  547. "-TT;>;",
  548. "Ljava/util/Queue<",
  549. "TT;>;",
  550. "Ljava/util/concurrent/atomic/AtomicLong;",
  551. "Lio/reactivex/functions/BooleanSupplier;",
  552. ")Z"
  553. }
  554. .end annotation
  555. const-wide/high16 v0, -0x8000000000000000L
  556. and-long v2, p0, v0
  557. :cond_0
  558. :goto_0
  559. const/4 v4, 0x1
  560. cmp-long v5, v2, p0
  561. if-eqz v5, :cond_3
  562. .line 392
  563. invoke-static {p5}, Lio/reactivex/internal/util/QueueDrainHelper;->isCancelled(Lio/reactivex/functions/BooleanSupplier;)Z
  564. move-result v5
  565. if-eqz v5, :cond_1
  566. return v4
  567. .line 396
  568. :cond_1
  569. invoke-interface {p3}, Ljava/util/Queue;->poll()Ljava/lang/Object;
  570. move-result-object v5
  571. if-nez v5, :cond_2
  572. .line 399
  573. invoke-interface {p2}, Lorg/reactivestreams/Subscriber;->onComplete()V
  574. return v4
  575. .line 403
  576. :cond_2
  577. invoke-interface {p2, v5}, Lorg/reactivestreams/Subscriber;->onNext(Ljava/lang/Object;)V
  578. const-wide/16 v4, 0x1
  579. add-long/2addr v2, v4
  580. goto :goto_0
  581. .line 407
  582. :cond_3
  583. invoke-static {p5}, Lio/reactivex/internal/util/QueueDrainHelper;->isCancelled(Lio/reactivex/functions/BooleanSupplier;)Z
  584. move-result p0
  585. if-eqz p0, :cond_4
  586. return v4
  587. .line 411
  588. :cond_4
  589. invoke-interface {p3}, Ljava/util/Queue;->isEmpty()Z
  590. move-result p0
  591. if-eqz p0, :cond_5
  592. .line 412
  593. invoke-interface {p2}, Lorg/reactivestreams/Subscriber;->onComplete()V
  594. return v4
  595. .line 416
  596. :cond_5
  597. invoke-virtual {p4}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
  598. move-result-wide p0
  599. cmp-long v4, p0, v2
  600. if-nez v4, :cond_0
  601. const-wide p0, 0x7fffffffffffffffL
  602. and-long/2addr v2, p0
  603. neg-long v2, v2
  604. .line 420
  605. invoke-virtual {p4, v2, v3}, Ljava/util/concurrent/atomic/AtomicLong;->addAndGet(J)J
  606. move-result-wide v2
  607. and-long/2addr p0, v2
  608. const-wide/16 v4, 0x0
  609. cmp-long v6, p0, v4
  610. if-nez v6, :cond_6
  611. const/4 p0, 0x0
  612. return p0
  613. :cond_6
  614. and-long p0, v2, v0
  615. move-wide v7, p0
  616. move-wide p0, v2
  617. move-wide v2, v7
  618. goto :goto_0
  619. .end method
  620. .method public static postCompleteRequest(JLorg/reactivestreams/Subscriber;Ljava/util/Queue;Ljava/util/concurrent/atomic/AtomicLong;Lio/reactivex/functions/BooleanSupplier;)Z
  621. .locals 14
  622. .annotation system Ldalvik/annotation/Signature;
  623. value = {
  624. "<T:",
  625. "Ljava/lang/Object;",
  626. ">(J",
  627. "Lorg/reactivestreams/Subscriber<",
  628. "-TT;>;",
  629. "Ljava/util/Queue<",
  630. "TT;>;",
  631. "Ljava/util/concurrent/atomic/AtomicLong;",
  632. "Lio/reactivex/functions/BooleanSupplier;",
  633. ")Z"
  634. }
  635. .end annotation
  636. move-wide v0, p0
  637. .line 319
  638. :cond_0
  639. invoke-virtual/range {p4 .. p4}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
  640. move-result-wide v2
  641. const-wide v4, 0x7fffffffffffffffL
  642. and-long/2addr v4, v2
  643. const-wide/high16 v6, -0x8000000000000000L
  644. and-long v8, v2, v6
  645. .line 325
  646. invoke-static {v4, v5, p0, p1}, Lio/reactivex/internal/util/BackpressureHelper;->addCap(JJ)J
  647. move-result-wide v4
  648. or-long/2addr v4, v8
  649. move-object/from16 v12, p4
  650. .line 327
  651. invoke-virtual {v12, v2, v3, v4, v5}, Ljava/util/concurrent/atomic/AtomicLong;->compareAndSet(JJ)Z
  652. move-result v4
  653. if-eqz v4, :cond_0
  654. cmp-long v4, v2, v6
  655. if-nez v4, :cond_1
  656. or-long v8, v0, v6
  657. move-object/from16 v10, p2
  658. move-object/from16 v11, p3
  659. move-object/from16 v12, p4
  660. move-object/from16 v13, p5
  661. .line 331
  662. 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
  663. const/4 v0, 0x1
  664. return v0
  665. :cond_1
  666. const/4 v0, 0x0
  667. return v0
  668. .end method
  669. .method public static request(Lorg/reactivestreams/Subscription;I)V
  670. .locals 2
  671. if-gez p1, :cond_0
  672. const-wide v0, 0x7fffffffffffffffL
  673. goto :goto_0
  674. :cond_0
  675. int-to-long v0, p1
  676. .line 288
  677. :goto_0
  678. invoke-interface {p0, v0, v1}, Lorg/reactivestreams/Subscription;->request(J)V
  679. return-void
  680. .end method