Rabbit-R1/switch port/smali/smali_classes3/okio/Timeout.smali
2024-05-21 17:08:36 -04:00

734 lines
17 KiB
Smali

.class public Lokio/Timeout;
.super Ljava/lang/Object;
.source "Timeout.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokio/Timeout$Companion;
}
.end annotation
.annotation system Ldalvik/annotation/SourceDebugExtension;
value = "SMAP\nTimeout.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Timeout.kt\nokio/Timeout\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,234:1\n1#2:235\n*E\n"
.end annotation
.annotation runtime Lkotlin/Metadata;
bv = {
0x1,
0x0,
0x3
}
d1 = {
"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0008\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0002\u0008\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0006\u0008\u0016\u0018\u0000 \u00172\u00020\u0001:\u0001\u0017B\u0005\u00a2\u0006\u0002\u0010\u0002J\u0008\u0010\u0008\u001a\u00020\u0000H\u0016J\u0008\u0010\t\u001a\u00020\u0000H\u0016J\u0016\u0010\n\u001a\u00020\u00002\u0006\u0010\u000b\u001a\u00020\u00042\u0006\u0010\u000c\u001a\u00020\rJ\u0008\u0010\u0003\u001a\u00020\u0004H\u0016J\u0010\u0010\u0003\u001a\u00020\u00002\u0006\u0010\u0003\u001a\u00020\u0004H\u0016J\u0008\u0010\u0005\u001a\u00020\u0006H\u0016J\"\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u00002\u000c\u0010\u0011\u001a\u0008\u0012\u0004\u0012\u00020\u000f0\u0012H\u0086\u0008\u00f8\u0001\u0000J\u0008\u0010\u0013\u001a\u00020\u000fH\u0016J\u0018\u0010\u0014\u001a\u00020\u00002\u0006\u0010\u0014\u001a\u00020\u00042\u0006\u0010\u000c\u001a\u00020\rH\u0016J\u0008\u0010\u0007\u001a\u00020\u0004H\u0016J\u000e\u0010\u0015\u001a\u00020\u000f2\u0006\u0010\u0016\u001a\u00020\u0001R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0004X\u0082\u000e\u00a2\u0006\u0002\n\u0000\u0082\u0002\u0007\n\u0005\u0008\u009920\u0001\u00a8\u0006\u0018"
}
d2 = {
"Lokio/Timeout;",
"",
"()V",
"deadlineNanoTime",
"",
"hasDeadline",
"",
"timeoutNanos",
"clearDeadline",
"clearTimeout",
"deadline",
"duration",
"unit",
"Ljava/util/concurrent/TimeUnit;",
"intersectWith",
"",
"other",
"block",
"Lkotlin/Function0;",
"throwIfReached",
"timeout",
"waitUntilNotified",
"monitor",
"Companion",
"okio"
}
k = 0x1
mv = {
0x1,
0x4,
0x0
}
.end annotation
# static fields
.field public static final Companion:Lokio/Timeout$Companion;
.field public static final NONE:Lokio/Timeout;
# instance fields
.field private deadlineNanoTime:J
.field private hasDeadline:Z
.field private timeoutNanos:J
# direct methods
.method static constructor <clinit>()V
.locals 2
new-instance v0, Lokio/Timeout$Companion;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lokio/Timeout$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lokio/Timeout;->Companion:Lokio/Timeout$Companion;
.line 218
new-instance v0, Lokio/Timeout$Companion$NONE$1;
invoke-direct {v0}, Lokio/Timeout$Companion$NONE$1;-><init>()V
check-cast v0, Lokio/Timeout;
sput-object v0, Lokio/Timeout;->NONE:Lokio/Timeout;
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 22
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public clearDeadline()Lokio/Timeout;
.locals 1
const/4 v0, 0x0
iput-boolean v0, p0, Lokio/Timeout;->hasDeadline:Z
return-object p0
.end method
.method public clearTimeout()Lokio/Timeout;
.locals 2
const-wide/16 v0, 0x0
iput-wide v0, p0, Lokio/Timeout;->timeoutNanos:J
return-object p0
.end method
.method public final deadline(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.locals 2
const-string v0, "unit"
invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-wide/16 v0, 0x0
cmp-long v0, p1, v0
if-lez v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
if-eqz v0, :cond_1
.line 74
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v0
invoke-virtual {p3, p1, p2}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide p1
add-long/2addr v0, p1
invoke-virtual {p0, v0, v1}, Lokio/Timeout;->deadlineNanoTime(J)Lokio/Timeout;
move-result-object p0
return-object p0
.line 73
:cond_1
new-instance p0, Ljava/lang/StringBuilder;
const-string p3, "duration <= 0: "
invoke-direct {p0, p3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
check-cast p1, Ljava/lang/Throwable;
throw p1
.end method
.method public deadlineNanoTime()J
.locals 2
iget-boolean v0, p0, Lokio/Timeout;->hasDeadline:Z
if-eqz v0, :cond_0
iget-wide v0, p0, Lokio/Timeout;->deadlineNanoTime:J
return-wide v0
.line 56
:cond_0
new-instance p0, Ljava/lang/IllegalStateException;
const-string v0, "No deadline"
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
.end method
.method public deadlineNanoTime(J)Lokio/Timeout;
.locals 1
const/4 v0, 0x1
iput-boolean v0, p0, Lokio/Timeout;->hasDeadline:Z
iput-wide p1, p0, Lokio/Timeout;->deadlineNanoTime:J
return-object p0
.end method
.method public hasDeadline()Z
.locals 0
iget-boolean p0, p0, Lokio/Timeout;->hasDeadline:Z
return p0
.end method
.method public final intersectWith(Lokio/Timeout;Lkotlin/jvm/functions/Function0;)V
.locals 10
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lokio/Timeout;",
"Lkotlin/jvm/functions/Function0<",
"Lkotlin/Unit;",
">;)V"
}
.end annotation
const-string v0, "other"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "block"
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 186
invoke-virtual {p0}, Lokio/Timeout;->timeoutNanos()J
move-result-wide v0
sget-object v2, Lokio/Timeout;->Companion:Lokio/Timeout$Companion;
.line 187
invoke-virtual {p1}, Lokio/Timeout;->timeoutNanos()J
move-result-wide v3
invoke-virtual {p0}, Lokio/Timeout;->timeoutNanos()J
move-result-wide v5
invoke-virtual {v2, v3, v4, v5, v6}, Lokio/Timeout$Companion;->minTimeout(JJ)J
move-result-wide v2
sget-object v4, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p0, v2, v3, v4}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.line 189
invoke-virtual {p0}, Lokio/Timeout;->hasDeadline()Z
move-result v2
const/4 v3, 0x1
if-eqz v2, :cond_3
.line 190
invoke-virtual {p0}, Lokio/Timeout;->deadlineNanoTime()J
move-result-wide v4
.line 191
invoke-virtual {p1}, Lokio/Timeout;->hasDeadline()Z
move-result v2
if-eqz v2, :cond_0
.line 192
invoke-virtual {p0}, Lokio/Timeout;->deadlineNanoTime()J
move-result-wide v6
invoke-virtual {p1}, Lokio/Timeout;->deadlineNanoTime()J
move-result-wide v8
invoke-static {v6, v7, v8, v9}, Ljava/lang/Math;->min(JJ)J
move-result-wide v6
invoke-virtual {p0, v6, v7}, Lokio/Timeout;->deadlineNanoTime(J)Lokio/Timeout;
.line 195
:cond_0
:try_start_0
invoke-interface {p2}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->finallyStart(I)V
.line 197
sget-object p2, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p0, v0, v1, p2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.line 198
invoke-virtual {p1}, Lokio/Timeout;->hasDeadline()Z
move-result p1
if-eqz p1, :cond_1
.line 199
invoke-virtual {p0, v4, v5}, Lokio/Timeout;->deadlineNanoTime(J)Lokio/Timeout;
:cond_1
invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->finallyEnd(I)V
goto :goto_0
:catchall_0
move-exception p2
.line 201
invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->finallyStart(I)V
.line 197
sget-object v2, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p0, v0, v1, v2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.line 198
invoke-virtual {p1}, Lokio/Timeout;->hasDeadline()Z
move-result p1
if-eqz p1, :cond_2
.line 199
invoke-virtual {p0, v4, v5}, Lokio/Timeout;->deadlineNanoTime(J)Lokio/Timeout;
:cond_2
invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->finallyEnd(I)V
throw p2
.line 203
:cond_3
invoke-virtual {p1}, Lokio/Timeout;->hasDeadline()Z
move-result v2
if-eqz v2, :cond_4
.line 204
invoke-virtual {p1}, Lokio/Timeout;->deadlineNanoTime()J
move-result-wide v4
invoke-virtual {p0, v4, v5}, Lokio/Timeout;->deadlineNanoTime(J)Lokio/Timeout;
.line 207
:cond_4
:try_start_1
invoke-interface {p2}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->finallyStart(I)V
.line 209
sget-object p2, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p0, v0, v1, p2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.line 210
invoke-virtual {p1}, Lokio/Timeout;->hasDeadline()Z
move-result p1
if-eqz p1, :cond_5
.line 211
invoke-virtual {p0}, Lokio/Timeout;->clearDeadline()Lokio/Timeout;
:cond_5
invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->finallyEnd(I)V
:goto_0
return-void
:catchall_1
move-exception p2
.line 213
invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->finallyStart(I)V
.line 209
sget-object v2, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p0, v0, v1, v2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.line 210
invoke-virtual {p1}, Lokio/Timeout;->hasDeadline()Z
move-result p1
if-eqz p1, :cond_6
.line 211
invoke-virtual {p0}, Lokio/Timeout;->clearDeadline()Lokio/Timeout;
:cond_6
invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->finallyEnd(I)V
throw p2
.end method
.method public throwIfReached()V
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 96
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v0
if-nez v0, :cond_2
iget-boolean v0, p0, Lokio/Timeout;->hasDeadline:Z
if-eqz v0, :cond_1
iget-wide v0, p0, Lokio/Timeout;->deadlineNanoTime:J
.line 101
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v2
sub-long/2addr v0, v2
const-wide/16 v2, 0x0
cmp-long p0, v0, v2
if-lez p0, :cond_0
goto :goto_0
.line 102
:cond_0
new-instance p0, Ljava/io/InterruptedIOException;
const-string v0, "deadline reached"
invoke-direct {p0, v0}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
:cond_1
:goto_0
return-void
.line 97
:cond_2
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/Thread;->interrupt()V
.line 98
new-instance p0, Ljava/io/InterruptedIOException;
const-string v0, "interrupted"
invoke-direct {p0, v0}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
.end method
.method public timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.locals 2
const-string v0, "unit"
invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-wide/16 v0, 0x0
cmp-long v0, p1, v0
if-ltz v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
if-eqz v0, :cond_1
.line 40
invoke-virtual {p3, p1, p2}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide p1
iput-wide p1, p0, Lokio/Timeout;->timeoutNanos:J
return-object p0
.line 39
:cond_1
new-instance p0, Ljava/lang/StringBuilder;
const-string p3, "timeout < 0: "
invoke-direct {p0, p3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
check-cast p1, Ljava/lang/Throwable;
throw p1
.end method
.method public timeoutNanos()J
.locals 2
iget-wide v0, p0, Lokio/Timeout;->timeoutNanos:J
return-wide v0
.end method
.method public final waitUntilNotified(Ljava/lang/Object;)V
.locals 9
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/InterruptedIOException;
}
.end annotation
const-string v0, "monitor"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 144
:try_start_0
invoke-virtual {p0}, Lokio/Timeout;->hasDeadline()Z
move-result v0
.line 145
invoke-virtual {p0}, Lokio/Timeout;->timeoutNanos()J
move-result-wide v1
const-wide/16 v3, 0x0
if-nez v0, :cond_0
cmp-long v5, v1, v3
if-nez v5, :cond_0
.line 148
invoke-virtual {p1}, Ljava/lang/Object;->wait()V
return-void
.line 153
:cond_0
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v5
if-eqz v0, :cond_1
cmp-long v7, v1, v3
if-eqz v7, :cond_1
.line 155
invoke-virtual {p0}, Lokio/Timeout;->deadlineNanoTime()J
move-result-wide v7
sub-long/2addr v7, v5
.line 156
invoke-static {v1, v2, v7, v8}, Ljava/lang/Math;->min(JJ)J
move-result-wide v1
goto :goto_0
:cond_1
if-eqz v0, :cond_2
.line 158
invoke-virtual {p0}, Lokio/Timeout;->deadlineNanoTime()J
move-result-wide v0
sub-long v1, v0, v5
:cond_2
:goto_0
cmp-long p0, v1, v3
if-lez p0, :cond_3
const-wide/32 v3, 0xf4240
.line 166
div-long v7, v1, v3
mul-long/2addr v3, v7
sub-long v3, v1, v3
long-to-int p0, v3
.line 167
invoke-virtual {p1, v7, v8, p0}, Ljava/lang/Object;->wait(JI)V
.line 168
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide p0
sub-long v3, p0, v5
:cond_3
cmp-long p0, v3, v1
if-gez p0, :cond_4
return-void
.line 173
:cond_4
new-instance p0, Ljava/io/InterruptedIOException;
const-string p1, "timeout"
invoke-direct {p0, p1}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
:try_end_0
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
.line 176
:catch_0
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/Thread;->interrupt()V
.line 177
new-instance p0, Ljava/io/InterruptedIOException;
const-string p1, "interrupted"
invoke-direct {p0, p1}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
.end method