BackpressureHelper.smali
5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
.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 0
add-long/2addr p0, p2
const-wide/16 p2, 0x0
cmp-long p2, p0, p2
if-gez p2, :cond_0
const-wide p0, 0x7fffffffffffffffL
:cond_0
return-wide p0
.end method
.method public static multiplyCap(JJ)J
.locals 6
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 v2, v2, v4
if-eqz v2, :cond_0
.line 51
div-long p0, v0, p0
cmp-long p0, p0, p2
if-eqz p0, :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