141 lines
2.6 KiB
Smali
141 lines
2.6 KiB
Smali
.class public final Lrx/internal/a/a;
|
|
.super Ljava/lang/Object;
|
|
.source "BackpressureUtils.java"
|
|
|
|
|
|
# direct methods
|
|
.method public static a(Ljava/util/concurrent/atomic/AtomicLong;J)J
|
|
.locals 4
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-static {v0, v1, p1, p2}, Lrx/internal/a/a;->h(JJ)J
|
|
|
|
move-result-wide v2
|
|
|
|
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 b(Ljava/util/concurrent/atomic/AtomicLong;J)J
|
|
.locals 7
|
|
|
|
: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-ltz v6, :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
|
|
|
|
:cond_2
|
|
new-instance p0, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "More produced than requested: "
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
goto :goto_1
|
|
|
|
:goto_0
|
|
throw p0
|
|
|
|
:goto_1
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public static h(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 validate(J)Z
|
|
.locals 3
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
cmp-long v2, p0, v0
|
|
|
|
if-ltz v2, :cond_1
|
|
|
|
cmp-long v2, p0, v0
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
|
|
:cond_1
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-static {p0, p1}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "n >= 0 required but it was "
|
|
|
|
invoke-virtual {p1, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|