2051 lines
41 KiB
Smali
2051 lines
41 KiB
Smali
.class public final Lx/a/b2/b;
|
|
.super Ljava/lang/Object;
|
|
.source "CoroutineScheduler.kt"
|
|
|
|
# interfaces
|
|
.implements Ljava/util/concurrent/Executor;
|
|
.implements Ljava/io/Closeable;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lx/a/b2/b$a;,
|
|
Lx/a/b2/b$b;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final l:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
.field public static final m:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
.field public static final n:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;
|
|
|
|
.field public static final o:I
|
|
|
|
.field public static final p:I
|
|
|
|
.field public static final q:I
|
|
|
|
.field public static final r:I
|
|
|
|
.field public static final s:Lx/a/a2/v;
|
|
|
|
|
|
# instance fields
|
|
.field public volatile _isTerminated:I
|
|
|
|
.field public volatile controlState:J
|
|
|
|
.field public final d:Lx/a/b2/e;
|
|
|
|
.field public final e:Ljava/util/concurrent/Semaphore;
|
|
|
|
.field public final f:[Lx/a/b2/b$a;
|
|
|
|
.field public final g:Ljava/util/Random;
|
|
|
|
.field public final h:I
|
|
|
|
.field public final i:I
|
|
|
|
.field public final j:J
|
|
|
|
.field public final k:Ljava/lang/String;
|
|
|
|
.field public volatile parkedWorkersStack:J
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 5
|
|
|
|
const/16 v0, 0x3e8
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/16 v2, 0x8
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const-string v4, "kotlinx.coroutines.scheduler.spins"
|
|
|
|
invoke-static {v4, v0, v1, v3, v2}, Lx/a/a2/w;->a(Ljava/lang/String;IIII)I
|
|
|
|
move-result v0
|
|
|
|
sput v0, Lx/a/b2/b;->o:I
|
|
|
|
sget v0, Lx/a/b2/b;->o:I
|
|
|
|
const-string v1, "kotlinx.coroutines.scheduler.yields"
|
|
|
|
invoke-static {v1, v3, v3, v3, v2}, Lx/a/a2/w;->a(Ljava/lang/String;IIII)I
|
|
|
|
move-result v1
|
|
|
|
add-int/2addr v0, v1
|
|
|
|
sput v0, Lx/a/b2/b;->p:I
|
|
|
|
sget-object v0, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
const-wide/16 v1, 0x1
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
|
|
|
|
move-result-wide v0
|
|
|
|
long-to-int v1, v0
|
|
|
|
sput v1, Lx/a/b2/b;->q:I
|
|
|
|
sget-wide v0, Lx/a/b2/m;->a:J
|
|
|
|
const/4 v2, 0x4
|
|
|
|
int-to-long v2, v2
|
|
|
|
div-long/2addr v0, v2
|
|
|
|
const-wide/16 v2, 0xa
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-gez v4, :cond_0
|
|
|
|
move-wide v0, v2
|
|
|
|
:cond_0
|
|
sget v2, Lx/a/b2/b;->q:I
|
|
|
|
int-to-long v2, v2
|
|
|
|
invoke-static {v0, v1, v2, v3}, Lw/x/f;->coerceAtMost(JJ)J
|
|
|
|
move-result-wide v0
|
|
|
|
long-to-int v1, v0
|
|
|
|
sput v1, Lx/a/b2/b;->r:I
|
|
|
|
new-instance v0, Lx/a/a2/v;
|
|
|
|
const-string v1, "NOT_IN_STACK"
|
|
|
|
invoke-direct {v0, v1}, Lx/a/a2/v;-><init>(Ljava/lang/String;)V
|
|
|
|
sput-object v0, Lx/a/b2/b;->s:Lx/a/a2/v;
|
|
|
|
const-class v0, Lx/a/b2/b;
|
|
|
|
const-string v1, "parkedWorkersStack"
|
|
|
|
invoke-static {v0, v1}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lx/a/b2/b;->l:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
const-class v0, Lx/a/b2/b;
|
|
|
|
const-string v1, "controlState"
|
|
|
|
invoke-static {v0, v1}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lx/a/b2/b;->m:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
const-class v0, Lx/a/b2/b;
|
|
|
|
const-string v1, "_isTerminated"
|
|
|
|
invoke-static {v0, v1}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lx/a/b2/b;->n:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(IIJLjava/lang/String;)V
|
|
.locals 2
|
|
|
|
if-eqz p5, :cond_8
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput p1, p0, Lx/a/b2/b;->h:I
|
|
|
|
iput p2, p0, Lx/a/b2/b;->i:I
|
|
|
|
iput-wide p3, p0, Lx/a/b2/b;->j:J
|
|
|
|
iput-object p5, p0, Lx/a/b2/b;->k:Ljava/lang/String;
|
|
|
|
iget p1, p0, Lx/a/b2/b;->h:I
|
|
|
|
const/4 p2, 0x0
|
|
|
|
const/4 p3, 0x1
|
|
|
|
if-lt p1, p3, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
if-eqz p1, :cond_7
|
|
|
|
iget p1, p0, Lx/a/b2/b;->i:I
|
|
|
|
iget p4, p0, Lx/a/b2/b;->h:I
|
|
|
|
if-lt p1, p4, :cond_1
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
:goto_1
|
|
const-string p4, "Max pool size "
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
iget p1, p0, Lx/a/b2/b;->i:I
|
|
|
|
const p5, 0x1ffffe
|
|
|
|
if-gt p1, p5, :cond_2
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/4 p1, 0x0
|
|
|
|
:goto_2
|
|
if-eqz p1, :cond_5
|
|
|
|
iget-wide p4, p0, Lx/a/b2/b;->j:J
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
cmp-long p1, p4, v0
|
|
|
|
if-lez p1, :cond_3
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
const/4 p1, 0x0
|
|
|
|
:goto_3
|
|
if-eqz p1, :cond_4
|
|
|
|
new-instance p1, Lx/a/b2/e;
|
|
|
|
invoke-direct {p1}, Lx/a/b2/e;-><init>()V
|
|
|
|
iput-object p1, p0, Lx/a/b2/b;->d:Lx/a/b2/e;
|
|
|
|
new-instance p1, Ljava/util/concurrent/Semaphore;
|
|
|
|
iget p4, p0, Lx/a/b2/b;->h:I
|
|
|
|
invoke-direct {p1, p4, p2}, Ljava/util/concurrent/Semaphore;-><init>(IZ)V
|
|
|
|
iput-object p1, p0, Lx/a/b2/b;->e:Ljava/util/concurrent/Semaphore;
|
|
|
|
iput-wide v0, p0, Lx/a/b2/b;->parkedWorkersStack:J
|
|
|
|
iget p1, p0, Lx/a/b2/b;->i:I
|
|
|
|
add-int/2addr p1, p3
|
|
|
|
new-array p1, p1, [Lx/a/b2/b$a;
|
|
|
|
iput-object p1, p0, Lx/a/b2/b;->f:[Lx/a/b2/b$a;
|
|
|
|
iput-wide v0, p0, Lx/a/b2/b;->controlState:J
|
|
|
|
new-instance p1, Ljava/util/Random;
|
|
|
|
invoke-direct {p1}, Ljava/util/Random;-><init>()V
|
|
|
|
iput-object p1, p0, Lx/a/b2/b;->g:Ljava/util/Random;
|
|
|
|
iput p2, p0, Lx/a/b2/b;->_isTerminated:I
|
|
|
|
return-void
|
|
|
|
:cond_4
|
|
const-string p1, "Idle worker keep alive time "
|
|
|
|
invoke-static {p1}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
iget-wide p2, p0, Lx/a/b2/b;->j:J
|
|
|
|
const-string p4, " must be positive"
|
|
|
|
invoke-static {p1, p2, p3, p4}, Le/e/b/a/a;->a(Ljava/lang/StringBuilder;JLjava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
:cond_5
|
|
invoke-static {p4}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
iget p2, p0, Lx/a/b2/b;->i:I
|
|
|
|
const-string p3, " should not exceed maximal supported number of threads 2097150"
|
|
|
|
invoke-static {p1, p2, p3}, Le/e/b/a/a;->a(Ljava/lang/StringBuilder;ILjava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
:cond_6
|
|
invoke-static {p4}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
iget p2, p0, Lx/a/b2/b;->i:I
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string p2, " should be greater than or equals to core pool size "
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget p2, p0, Lx/a/b2/b;->h:I
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
:cond_7
|
|
const-string p1, "Core pool size "
|
|
|
|
invoke-static {p1}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
iget p2, p0, Lx/a/b2/b;->h:I
|
|
|
|
const-string p3, " should be at least 1"
|
|
|
|
invoke-static {p1, p2, p3}, Le/e/b/a/a;->a(Ljava/lang/StringBuilder;ILjava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
:cond_8
|
|
const-string p1, "schedulerName"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static final synthetic a(Lx/a/b2/b;)I
|
|
.locals 0
|
|
|
|
iget p0, p0, Lx/a/b2/b;->h:I
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static synthetic a(Lx/a/b2/b;Ljava/lang/Runnable;Lx/a/b2/j;ZI)V
|
|
.locals 1
|
|
|
|
and-int/lit8 v0, p4, 0x2
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
sget-object p2, Lx/a/b2/h;->e:Lx/a/b2/h;
|
|
|
|
:cond_0
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
if-eqz p4, :cond_1
|
|
|
|
const/4 p3, 0x0
|
|
|
|
:cond_1
|
|
invoke-virtual {p0, p1, p2, p3}, Lx/a/b2/b;->a(Ljava/lang/Runnable;Lx/a/b2/j;Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic a(Lx/a/b2/b;Lx/a/b2/b$a;)V
|
|
.locals 0
|
|
|
|
invoke-virtual {p0, p1}, Lx/a/b2/b;->b(Lx/a/b2/b$a;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic a(Lx/a/b2/b;Lx/a/b2/b$a;II)V
|
|
.locals 8
|
|
|
|
:cond_0
|
|
:goto_0
|
|
iget-wide v2, p0, Lx/a/b2/b;->parkedWorkersStack:J
|
|
|
|
const-wide/32 v0, 0x1fffff
|
|
|
|
and-long/2addr v0, v2
|
|
|
|
long-to-int v1, v0
|
|
|
|
const-wide/32 v4, 0x200000
|
|
|
|
add-long/2addr v4, v2
|
|
|
|
const-wide/32 v6, -0x200000
|
|
|
|
and-long/2addr v4, v6
|
|
|
|
if-ne v1, p2, :cond_2
|
|
|
|
if-nez p3, :cond_1
|
|
|
|
invoke-virtual {p0, p1}, Lx/a/b2/b;->a(Lx/a/b2/b$a;)I
|
|
|
|
move-result v0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move v0, p3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
move v0, v1
|
|
|
|
:goto_1
|
|
if-gez v0, :cond_3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
sget-object v1, Lx/a/b2/b;->l:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
int-to-long v6, v0
|
|
|
|
or-long/2addr v4, v6
|
|
|
|
move-object v0, v1
|
|
|
|
move-object v1, p0
|
|
|
|
invoke-virtual/range {v0 .. v5}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic b(Lx/a/b2/b;)I
|
|
.locals 4
|
|
|
|
iget-wide v0, p0, Lx/a/b2/b;->controlState:J
|
|
|
|
const-wide/32 v2, 0x1fffff
|
|
|
|
and-long/2addr v0, v2
|
|
|
|
long-to-int p0, v0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static final synthetic c(Lx/a/b2/b;)J
|
|
.locals 2
|
|
|
|
iget-wide v0, p0, Lx/a/b2/b;->j:J
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public static final synthetic d(Lx/a/b2/b;)Z
|
|
.locals 0
|
|
|
|
iget p0, p0, Lx/a/b2/b;->_isTerminated:I
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|
|
|
|
.method public static final synthetic e()I
|
|
.locals 1
|
|
|
|
sget v0, Lx/a/b2/b;->q:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public static final synthetic e(Lx/a/b2/b;)V
|
|
.locals 0
|
|
|
|
invoke-virtual {p0}, Lx/a/b2/b;->c()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a()I
|
|
.locals 10
|
|
|
|
iget-object v0, p0, Lx/a/b2/b;->f:[Lx/a/b2/b$a;
|
|
|
|
monitor-enter v0
|
|
|
|
:try_start_0
|
|
iget v1, p0, Lx/a/b2/b;->_isTerminated:I
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v1, -0x1
|
|
|
|
monitor-exit v0
|
|
|
|
return v1
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
iget-wide v4, p0, Lx/a/b2/b;->controlState:J
|
|
|
|
const-wide/32 v6, 0x1fffff
|
|
|
|
and-long v8, v4, v6
|
|
|
|
long-to-int v1, v8
|
|
|
|
const-wide v8, 0x3ffffe00000L
|
|
|
|
and-long/2addr v4, v8
|
|
|
|
const/16 v8, 0x15
|
|
|
|
shr-long/2addr v4, v8
|
|
|
|
long-to-int v5, v4
|
|
|
|
sub-int v4, v1, v5
|
|
|
|
iget v5, p0, Lx/a/b2/b;->h:I
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
if-lt v4, v5, :cond_2
|
|
|
|
monitor-exit v0
|
|
|
|
return v2
|
|
|
|
:cond_2
|
|
:try_start_2
|
|
iget v5, p0, Lx/a/b2/b;->i:I
|
|
|
|
if-ge v1, v5, :cond_8
|
|
|
|
iget-object v1, p0, Lx/a/b2/b;->e:Ljava/util/concurrent/Semaphore;
|
|
|
|
invoke-virtual {v1}, Ljava/util/concurrent/Semaphore;->availablePermits()I
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
iget-wide v8, p0, Lx/a/b2/b;->controlState:J
|
|
|
|
and-long/2addr v8, v6
|
|
|
|
long-to-int v1, v8
|
|
|
|
add-int/2addr v1, v3
|
|
|
|
if-lez v1, :cond_4
|
|
|
|
iget-object v5, p0, Lx/a/b2/b;->f:[Lx/a/b2/b$a;
|
|
|
|
aget-object v5, v5, v1
|
|
|
|
if-nez v5, :cond_4
|
|
|
|
const/4 v5, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
const/4 v5, 0x0
|
|
|
|
:goto_1
|
|
if-eqz v5, :cond_7
|
|
|
|
new-instance v5, Lx/a/b2/b$a;
|
|
|
|
invoke-direct {v5, p0, v1}, Lx/a/b2/b$a;-><init>(Lx/a/b2/b;I)V
|
|
|
|
invoke-virtual {v5}, Ljava/lang/Thread;->start()V
|
|
|
|
sget-object v8, Lx/a/b2/b;->m:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
invoke-virtual {v8, p0}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->incrementAndGet(Ljava/lang/Object;)J
|
|
|
|
move-result-wide v8
|
|
|
|
and-long/2addr v6, v8
|
|
|
|
long-to-int v7, v6
|
|
|
|
if-ne v1, v7, :cond_5
|
|
|
|
const/4 v2, 0x1
|
|
|
|
:cond_5
|
|
if-eqz v2, :cond_6
|
|
|
|
iget-object v2, p0, Lx/a/b2/b;->f:[Lx/a/b2/b$a;
|
|
|
|
aput-object v5, v2, v1
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
add-int/2addr v4, v3
|
|
|
|
monitor-exit v0
|
|
|
|
return v4
|
|
|
|
:cond_6
|
|
:try_start_3
|
|
const-string v1, "Failed requirement."
|
|
|
|
new-instance v2, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v2, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_7
|
|
const-string v1, "Failed requirement."
|
|
|
|
new-instance v2, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v2, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
:cond_8
|
|
:goto_2
|
|
monitor-exit v0
|
|
|
|
return v2
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
monitor-exit v0
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public final a(Lx/a/b2/b$a;)I
|
|
.locals 1
|
|
|
|
iget-object p1, p1, Lx/a/b2/b$a;->nextParkedWorker:Ljava/lang/Object;
|
|
|
|
:goto_0
|
|
sget-object v0, Lx/a/b2/b;->s:Lx/a/a2/v;
|
|
|
|
if-ne p1, v0, :cond_0
|
|
|
|
const/4 p1, -0x1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
if-nez p1, :cond_1
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
|
|
:cond_1
|
|
check-cast p1, Lx/a/b2/b$a;
|
|
|
|
iget v0, p1, Lx/a/b2/b$a;->indexInArray:I
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
return v0
|
|
|
|
:cond_2
|
|
iget-object p1, p1, Lx/a/b2/b$a;->nextParkedWorker:Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public final a(Lx/a/b2/i;Z)I
|
|
.locals 6
|
|
|
|
invoke-virtual {p0}, Lx/a/b2/b;->b()Lx/a/b2/b$a;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
iget-object v2, v0, Lx/a/b2/b$a;->state:Lx/a/b2/b$b;
|
|
|
|
sget-object v3, Lx/a/b2/b$b;->h:Lx/a/b2/b$b;
|
|
|
|
if-ne v2, v3, :cond_0
|
|
|
|
return v1
|
|
|
|
:cond_0
|
|
const/4 v2, -0x1
|
|
|
|
invoke-virtual {p1}, Lx/a/b2/i;->a()Lx/a/b2/l;
|
|
|
|
move-result-object v3
|
|
|
|
sget-object v4, Lx/a/b2/l;->d:Lx/a/b2/l;
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-ne v3, v4, :cond_3
|
|
|
|
iget-object v3, v0, Lx/a/b2/b$a;->state:Lx/a/b2/b$b;
|
|
|
|
sget-object v4, Lx/a/b2/b$b;->e:Lx/a/b2/b$b;
|
|
|
|
if-ne v3, v4, :cond_1
|
|
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v3, :cond_2
|
|
|
|
const/4 v2, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
invoke-virtual {v0}, Lx/a/b2/b$a;->c()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_3
|
|
|
|
return v1
|
|
|
|
:cond_3
|
|
:goto_1
|
|
if-eqz p2, :cond_4
|
|
|
|
iget-object p2, v0, Lx/a/b2/b$a;->d:Lx/a/b2/o;
|
|
|
|
iget-object v1, p0, Lx/a/b2/b;->d:Lx/a/b2/e;
|
|
|
|
invoke-virtual {p2, p1, v1}, Lx/a/b2/o;->b(Lx/a/b2/i;Lx/a/b2/e;)Z
|
|
|
|
move-result p1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
iget-object p2, v0, Lx/a/b2/b$a;->d:Lx/a/b2/o;
|
|
|
|
iget-object v1, p0, Lx/a/b2/b;->d:Lx/a/b2/e;
|
|
|
|
invoke-virtual {p2, p1, v1}, Lx/a/b2/o;->a(Lx/a/b2/i;Lx/a/b2/e;)Z
|
|
|
|
move-result p1
|
|
|
|
:goto_2
|
|
if-eqz p1, :cond_6
|
|
|
|
iget-object p1, v0, Lx/a/b2/b$a;->d:Lx/a/b2/o;
|
|
|
|
invoke-virtual {p1}, Lx/a/b2/o;->a()I
|
|
|
|
move-result p1
|
|
|
|
sget p2, Lx/a/b2/m;->b:I
|
|
|
|
if-le p1, p2, :cond_5
|
|
|
|
return v5
|
|
|
|
:cond_5
|
|
return v2
|
|
|
|
:cond_6
|
|
return v5
|
|
|
|
:cond_7
|
|
return v1
|
|
.end method
|
|
|
|
.method public final a(Ljava/lang/Runnable;Lx/a/b2/j;)Lx/a/b2/i;
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
sget-object v0, Lx/a/b2/m;->f:Lx/a/b2/n;
|
|
|
|
invoke-virtual {v0}, Lx/a/b2/n;->a()J
|
|
|
|
move-result-wide v0
|
|
|
|
instance-of v2, p1, Lx/a/b2/i;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
check-cast p1, Lx/a/b2/i;
|
|
|
|
iput-wide v0, p1, Lx/a/b2/i;->d:J
|
|
|
|
iput-object p2, p1, Lx/a/b2/i;->e:Lx/a/b2/j;
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
new-instance v2, Lx/a/b2/k;
|
|
|
|
invoke-direct {v2, p1, v0, v1, p2}, Lx/a/b2/k;-><init>(Ljava/lang/Runnable;JLx/a/b2/j;)V
|
|
|
|
return-object v2
|
|
|
|
:cond_1
|
|
const-string p1, "taskContext"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p1, "block"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final a(Ljava/lang/Runnable;Lx/a/b2/j;Z)V
|
|
.locals 1
|
|
|
|
const-string v0, "block"
|
|
|
|
invoke-static {p1, v0}, Lw/u/b/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "taskContext"
|
|
|
|
invoke-static {p2, v0}, Lw/u/b/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {}, Lx/a/w1;->a()Lx/a/v1;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lx/a/h0;
|
|
|
|
invoke-virtual {v0}, Lx/a/h0;->c()V
|
|
|
|
invoke-virtual {p0, p1, p2}, Lx/a/b2/b;->a(Ljava/lang/Runnable;Lx/a/b2/j;)Lx/a/b2/i;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p1, p3}, Lx/a/b2/b;->a(Lx/a/b2/i;Z)I
|
|
|
|
move-result p2
|
|
|
|
const/4 p3, -0x1
|
|
|
|
if-eq p2, p3, :cond_2
|
|
|
|
const/4 p3, 0x1
|
|
|
|
if-eq p2, p3, :cond_0
|
|
|
|
invoke-virtual {p0}, Lx/a/b2/b;->c()V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object p2, p0, Lx/a/b2/b;->d:Lx/a/b2/e;
|
|
|
|
invoke-virtual {p2, p1}, Lx/a/a2/o;->a(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p0}, Lx/a/b2/b;->c()V
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/util/concurrent/RejectedExecutionException;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object p3, p0, Lx/a/b2/b;->k:Ljava/lang/String;
|
|
|
|
const-string v0, " was terminated"
|
|
|
|
invoke-static {p2, p3, v0}, Le/e/b/a/a;->a(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/util/concurrent/RejectedExecutionException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method public final a(Lx/a/b2/i;)V
|
|
.locals 2
|
|
|
|
:try_start_0
|
|
invoke-interface {p1}, Ljava/lang/Runnable;->run()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
sget-object p1, Lx/a/w1;->a:Lx/a/v1;
|
|
|
|
check-cast p1, Lx/a/h0;
|
|
|
|
invoke-virtual {p1}, Lx/a/h0;->d()V
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
:try_start_1
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "thread"
|
|
|
|
invoke-static {v0, v1}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Thread;->getUncaughtExceptionHandler()Ljava/lang/Thread$UncaughtExceptionHandler;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1, v0, p1}, Ljava/lang/Thread$UncaughtExceptionHandler;->uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwable;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
|
|
|
goto :goto_0
|
|
|
|
:goto_1
|
|
return-void
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
sget-object v0, Lx/a/w1;->a:Lx/a/v1;
|
|
|
|
check-cast v0, Lx/a/h0;
|
|
|
|
invoke-virtual {v0}, Lx/a/h0;->d()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final b()Lx/a/b2/b$a;
|
|
.locals 3
|
|
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lx/a/b2/b$a;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
move-object v0, v2
|
|
|
|
:cond_0
|
|
check-cast v0, Lx/a/b2/b$a;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v1, v0, Lx/a/b2/b$a;->j:Lx/a/b2/b;
|
|
|
|
invoke-static {v1, p0}, Lw/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
move-object v2, v0
|
|
|
|
:cond_1
|
|
return-object v2
|
|
.end method
|
|
|
|
.method public final b(Lx/a/b2/b$a;)V
|
|
.locals 8
|
|
|
|
iget-object v0, p1, Lx/a/b2/b$a;->nextParkedWorker:Ljava/lang/Object;
|
|
|
|
sget-object v1, Lx/a/b2/b;->s:Lx/a/a2/v;
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-wide v4, p0, Lx/a/b2/b;->parkedWorkersStack:J
|
|
|
|
const-wide/32 v0, 0x1fffff
|
|
|
|
and-long/2addr v0, v4
|
|
|
|
long-to-int v1, v0
|
|
|
|
const-wide/32 v2, 0x200000
|
|
|
|
add-long/2addr v2, v4
|
|
|
|
const-wide/32 v6, -0x200000
|
|
|
|
and-long/2addr v2, v6
|
|
|
|
iget v0, p1, Lx/a/b2/b$a;->indexInArray:I
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
const/4 v6, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v6, 0x0
|
|
|
|
:goto_0
|
|
sget-boolean v7, Lw/p;->a:Z
|
|
|
|
if-eqz v7, :cond_3
|
|
|
|
if-eqz v6, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
new-instance p1, Ljava/lang/AssertionError;
|
|
|
|
const-string v0, "Assertion failed"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
:goto_1
|
|
iget-object v6, p0, Lx/a/b2/b;->f:[Lx/a/b2/b$a;
|
|
|
|
aget-object v1, v6, v1
|
|
|
|
iput-object v1, p1, Lx/a/b2/b$a;->nextParkedWorker:Ljava/lang/Object;
|
|
|
|
sget-object v1, Lx/a/b2/b;->l:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
int-to-long v6, v0
|
|
|
|
or-long/2addr v6, v2
|
|
|
|
move-object v2, v1
|
|
|
|
move-object v3, p0
|
|
|
|
invoke-virtual/range {v2 .. v7}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final c()V
|
|
.locals 6
|
|
|
|
iget-object v0, p0, Lx/a/b2/b;->e:Ljava/util/concurrent/Semaphore;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/Semaphore;->availablePermits()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-virtual {p0}, Lx/a/b2/b;->d()Z
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lx/a/b2/b;->d()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
iget-wide v0, p0, Lx/a/b2/b;->controlState:J
|
|
|
|
const-wide/32 v2, 0x1fffff
|
|
|
|
and-long/2addr v2, v0
|
|
|
|
long-to-int v3, v2
|
|
|
|
const-wide v4, 0x3ffffe00000L
|
|
|
|
and-long/2addr v0, v4
|
|
|
|
const/16 v2, 0x15
|
|
|
|
shr-long/2addr v0, v2
|
|
|
|
long-to-int v1, v0
|
|
|
|
sub-int/2addr v3, v1
|
|
|
|
iget v0, p0, Lx/a/b2/b;->h:I
|
|
|
|
if-ge v3, v0, :cond_3
|
|
|
|
invoke-virtual {p0}, Lx/a/b2/b;->a()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-ne v0, v1, :cond_2
|
|
|
|
iget v2, p0, Lx/a/b2/b;->h:I
|
|
|
|
if-le v2, v1, :cond_2
|
|
|
|
invoke-virtual {p0}, Lx/a/b2/b;->a()I
|
|
|
|
:cond_2
|
|
if-lez v0, :cond_3
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
invoke-virtual {p0}, Lx/a/b2/b;->d()Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public close()V
|
|
.locals 2
|
|
|
|
const-wide/16 v0, 0x2710
|
|
|
|
invoke-virtual {p0, v0, v1}, Lx/a/b2/b;->h(J)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final d()Z
|
|
.locals 9
|
|
|
|
:cond_0
|
|
:goto_0
|
|
iget-wide v2, p0, Lx/a/b2/b;->parkedWorkersStack:J
|
|
|
|
const-wide/32 v0, 0x1fffff
|
|
|
|
and-long/2addr v0, v2
|
|
|
|
long-to-int v1, v0
|
|
|
|
iget-object v0, p0, Lx/a/b2/b;->f:[Lx/a/b2/b$a;
|
|
|
|
aget-object v6, v0, v1
|
|
|
|
if-eqz v6, :cond_2
|
|
|
|
const-wide/32 v0, 0x200000
|
|
|
|
add-long/2addr v0, v2
|
|
|
|
const-wide/32 v4, -0x200000
|
|
|
|
and-long/2addr v0, v4
|
|
|
|
invoke-virtual {p0, v6}, Lx/a/b2/b;->a(Lx/a/b2/b$a;)I
|
|
|
|
move-result v4
|
|
|
|
if-gez v4, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
sget-object v5, Lx/a/b2/b;->l:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
|
|
|
|
int-to-long v7, v4
|
|
|
|
or-long/2addr v7, v0
|
|
|
|
move-object v0, v5
|
|
|
|
move-object v1, p0
|
|
|
|
move-wide v4, v7
|
|
|
|
invoke-virtual/range {v0 .. v5}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
sget-object v0, Lx/a/b2/b;->s:Lx/a/a2/v;
|
|
|
|
invoke-virtual {v6, v0}, Lx/a/b2/b$a;->a(Ljava/lang/Object;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v6, 0x0
|
|
|
|
:goto_1
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz v6, :cond_9
|
|
|
|
sget v1, Lx/a/b2/b;->r:I
|
|
|
|
iput v1, v6, Lx/a/b2/b$a;->g:I
|
|
|
|
iput v0, v6, Lx/a/b2/b$a;->spins:I
|
|
|
|
iget-object v1, v6, Lx/a/b2/b$a;->state:Lx/a/b2/b$b;
|
|
|
|
sget-object v2, Lx/a/b2/b$b;->f:Lx/a/b2/b$b;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-ne v1, v2, :cond_3
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
const/4 v1, 0x0
|
|
|
|
:goto_2
|
|
invoke-static {v6}, Ljava/util/concurrent/locks/LockSupport;->unpark(Ljava/lang/Thread;)V
|
|
|
|
if-nez v1, :cond_4
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
iget v1, v6, Lx/a/b2/b$a;->terminationState:I
|
|
|
|
const/4 v2, -0x1
|
|
|
|
if-eq v1, v2, :cond_7
|
|
|
|
if-eqz v1, :cond_6
|
|
|
|
if-ne v1, v3, :cond_5
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
const-string v0, "Invalid terminationState = "
|
|
|
|
invoke-static {v0, v1}, Le/e/b/a/a;->a(Ljava/lang/String;I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:cond_6
|
|
sget-object v1, Lx/a/b2/b$a;->k:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;
|
|
|
|
invoke-virtual {v1, v6, v0, v2}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->compareAndSet(Ljava/lang/Object;II)Z
|
|
|
|
move-result v0
|
|
|
|
:cond_7
|
|
:goto_3
|
|
if-nez v0, :cond_8
|
|
|
|
goto :goto_0
|
|
|
|
:cond_8
|
|
return v3
|
|
|
|
:cond_9
|
|
return v0
|
|
.end method
|
|
|
|
.method public execute(Ljava/lang/Runnable;)V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x6
|
|
|
|
invoke-static {p0, p1, v0, v1, v2}, Lx/a/b2/b;->a(Lx/a/b2/b;Ljava/lang/Runnable;Lx/a/b2/j;ZI)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "command"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final h(J)V
|
|
.locals 8
|
|
|
|
sget-object v0, Lx/a/b2/b;->n:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v0, p0, v1, v2}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->compareAndSet(Ljava/lang/Object;II)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lx/a/b2/b;->b()Lx/a/b2/b$a;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v3, p0, Lx/a/b2/b;->f:[Lx/a/b2/b$a;
|
|
|
|
monitor-enter v3
|
|
|
|
:try_start_0
|
|
iget-wide v4, p0, Lx/a/b2/b;->controlState:J
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
const-wide/32 v6, 0x1fffff
|
|
|
|
and-long/2addr v4, v6
|
|
|
|
long-to-int v5, v4
|
|
|
|
monitor-exit v3
|
|
|
|
if-gt v2, v5, :cond_6
|
|
|
|
const/4 v3, 0x1
|
|
|
|
:goto_0
|
|
iget-object v4, p0, Lx/a/b2/b;->f:[Lx/a/b2/b$a;
|
|
|
|
aget-object v4, v4, v3
|
|
|
|
if-eqz v4, :cond_5
|
|
|
|
if-eq v4, v0, :cond_4
|
|
|
|
:goto_1
|
|
invoke-virtual {v4}, Ljava/lang/Thread;->isAlive()Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_1
|
|
|
|
invoke-static {v4}, Ljava/util/concurrent/locks/LockSupport;->unpark(Ljava/lang/Thread;)V
|
|
|
|
invoke-virtual {v4, p1, p2}, Ljava/lang/Thread;->join(J)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget-object v6, v4, Lx/a/b2/b$a;->state:Lx/a/b2/b$b;
|
|
|
|
sget-object v7, Lx/a/b2/b$b;->h:Lx/a/b2/b$b;
|
|
|
|
if-ne v6, v7, :cond_2
|
|
|
|
const/4 v7, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/4 v7, 0x0
|
|
|
|
:goto_2
|
|
if-eqz v7, :cond_3
|
|
|
|
iget-object v4, v4, Lx/a/b2/b$a;->d:Lx/a/b2/o;
|
|
|
|
iget-object v6, p0, Lx/a/b2/b;->d:Lx/a/b2/e;
|
|
|
|
invoke-virtual {v4, v6}, Lx/a/b2/o;->a(Lx/a/b2/e;)V
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string p2, "Expected TERMINATED state, but found "
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
:cond_4
|
|
:goto_3
|
|
if-eq v3, v5, :cond_6
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_5
|
|
invoke-static {}, Lw/u/b/j;->throwNpe()V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
|
|
:cond_6
|
|
iget-object p1, p0, Lx/a/b2/b;->d:Lx/a/b2/e;
|
|
|
|
:goto_4
|
|
iget-object p2, p1, Lx/a/a2/o;->_cur$internal:Ljava/lang/Object;
|
|
|
|
check-cast p2, Lx/a/a2/p;
|
|
|
|
invoke-virtual {p2}, Lx/a/a2/p;->a()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_d
|
|
|
|
:goto_5
|
|
if-eqz v0, :cond_7
|
|
|
|
invoke-virtual {v0}, Lx/a/b2/b$a;->b()Lx/a/b2/i;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_7
|
|
|
|
goto :goto_6
|
|
|
|
:cond_7
|
|
iget-object p1, p0, Lx/a/b2/b;->d:Lx/a/b2/e;
|
|
|
|
invoke-virtual {p1}, Lx/a/a2/o;->a()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lx/a/b2/i;
|
|
|
|
:goto_6
|
|
if-eqz p1, :cond_8
|
|
|
|
invoke-virtual {p0, p1}, Lx/a/b2/b;->a(Lx/a/b2/i;)V
|
|
|
|
goto :goto_5
|
|
|
|
:cond_8
|
|
if-eqz v0, :cond_9
|
|
|
|
sget-object p1, Lx/a/b2/b$b;->h:Lx/a/b2/b$b;
|
|
|
|
invoke-virtual {v0, p1}, Lx/a/b2/b$a;->a(Lx/a/b2/b$b;)Z
|
|
|
|
:cond_9
|
|
iget-object p1, p0, Lx/a/b2/b;->e:Ljava/util/concurrent/Semaphore;
|
|
|
|
invoke-virtual {p1}, Ljava/util/concurrent/Semaphore;->availablePermits()I
|
|
|
|
move-result p1
|
|
|
|
iget p2, p0, Lx/a/b2/b;->h:I
|
|
|
|
if-ne p1, p2, :cond_a
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:cond_a
|
|
sget-boolean p1, Lw/p;->a:Z
|
|
|
|
if-eqz p1, :cond_c
|
|
|
|
if-eqz v1, :cond_b
|
|
|
|
goto :goto_7
|
|
|
|
:cond_b
|
|
new-instance p1, Ljava/lang/AssertionError;
|
|
|
|
const-string p2, "Assertion failed"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
|
|
|
|
throw p1
|
|
|
|
:cond_c
|
|
:goto_7
|
|
const-wide/16 p1, 0x0
|
|
|
|
iput-wide p1, p0, Lx/a/b2/b;->parkedWorkersStack:J
|
|
|
|
iput-wide p1, p0, Lx/a/b2/b;->controlState:J
|
|
|
|
return-void
|
|
|
|
:cond_d
|
|
sget-object v3, Lx/a/a2/o;->a:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;
|
|
|
|
invoke-virtual {p2}, Lx/a/a2/p;->c()Lx/a/a2/p;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v3, p1, p2, v4}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
goto :goto_4
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit v3
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public toString()Ljava/lang/String;
|
|
.locals 14
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iget-object v1, p0, Lx/a/b2/b;->f:[Lx/a/b2/b$a;
|
|
|
|
array-length v2, v1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
:goto_0
|
|
if-ge v4, v2, :cond_8
|
|
|
|
aget-object v10, v1, v4
|
|
|
|
if-nez v10, :cond_0
|
|
|
|
goto/16 :goto_1
|
|
|
|
:cond_0
|
|
iget-object v11, v10, Lx/a/b2/b$a;->d:Lx/a/b2/o;
|
|
|
|
iget-object v12, v11, Lx/a/b2/o;->lastScheduledTask:Ljava/lang/Object;
|
|
|
|
const/4 v13, 0x1
|
|
|
|
invoke-virtual {v11}, Lx/a/b2/o;->a()I
|
|
|
|
move-result v11
|
|
|
|
if-eqz v12, :cond_1
|
|
|
|
add-int/2addr v11, v13
|
|
|
|
:cond_1
|
|
iget-object v10, v10, Lx/a/b2/b$a;->state:Lx/a/b2/b$b;
|
|
|
|
sget-object v12, Lx/a/b2/a;->a:[I
|
|
|
|
invoke-virtual {v10}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v10
|
|
|
|
aget v10, v12, v10
|
|
|
|
if-eq v10, v13, :cond_6
|
|
|
|
const/4 v12, 0x2
|
|
|
|
if-eq v10, v12, :cond_5
|
|
|
|
const/4 v12, 0x3
|
|
|
|
if-eq v10, v12, :cond_4
|
|
|
|
const/4 v12, 0x4
|
|
|
|
if-eq v10, v12, :cond_3
|
|
|
|
const/4 v11, 0x5
|
|
|
|
if-eq v10, v11, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
add-int/lit8 v9, v9, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
add-int/lit8 v8, v8, 0x1
|
|
|
|
if-lez v11, :cond_7
|
|
|
|
new-instance v10, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-static {v11}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v11, "r"
|
|
|
|
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-interface {v0, v10}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
add-int/lit8 v5, v5, 0x1
|
|
|
|
new-instance v10, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-static {v11}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v11, "c"
|
|
|
|
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-interface {v0, v10}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
add-int/lit8 v6, v6, 0x1
|
|
|
|
new-instance v10, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-static {v11}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v11, "b"
|
|
|
|
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-interface {v0, v10}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_6
|
|
add-int/lit8 v7, v7, 0x1
|
|
|
|
:cond_7
|
|
:goto_1
|
|
add-int/lit8 v4, v4, 0x1
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_8
|
|
iget-wide v1, p0, Lx/a/b2/b;->controlState:J
|
|
|
|
new-instance v4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v10, p0, Lx/a/b2/b;->k:Ljava/lang/String;
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const/16 v10, 0x40
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {p0}, Lx/a/e0;->b(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const/16 v10, 0x5b
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
const-string v10, "Pool Size {"
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v10, "core = "
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v10, p0, Lx/a/b2/b;->h:I
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v10, ", "
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v11, "max = "
|
|
|
|
invoke-virtual {v4, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v11, p0, Lx/a/b2/b;->i:I
|
|
|
|
invoke-virtual {v4, v11}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v11, "}, "
|
|
|
|
invoke-virtual {v4, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v12, "Worker States {"
|
|
|
|
invoke-virtual {v4, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v12, "CPU = "
|
|
|
|
invoke-virtual {v4, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v5, "blocking = "
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v6, "parked = "
|
|
|
|
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v6, "retired = "
|
|
|
|
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v6, "terminated = "
|
|
|
|
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v9}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v6, "running workers queues = "
|
|
|
|
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "global queue size = "
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v0, p0, Lx/a/b2/b;->d:Lx/a/b2/e;
|
|
|
|
iget-object v0, v0, Lx/a/a2/o;->_cur$internal:Ljava/lang/Object;
|
|
|
|
check-cast v0, Lx/a/a2/p;
|
|
|
|
iget-wide v6, v0, Lx/a/a2/p;->_state$internal:J
|
|
|
|
const-wide/32 v8, 0x3fffffff
|
|
|
|
and-long/2addr v8, v6
|
|
|
|
shr-long/2addr v8, v3
|
|
|
|
long-to-int v0, v8
|
|
|
|
const-wide v8, 0xfffffffc0000000L
|
|
|
|
and-long/2addr v6, v8
|
|
|
|
const/16 v3, 0x1e
|
|
|
|
shr-long/2addr v6, v3
|
|
|
|
long-to-int v3, v6
|
|
|
|
sub-int/2addr v3, v0
|
|
|
|
const v0, 0x3fffffff # 1.9999999f
|
|
|
|
and-int/2addr v0, v3
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "Control State Workers {"
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "created = "
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-wide/32 v6, 0x1fffff
|
|
|
|
and-long/2addr v6, v1
|
|
|
|
long-to-int v0, v6
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-wide v5, 0x3ffffe00000L
|
|
|
|
and-long v0, v1, v5
|
|
|
|
const/16 v2, 0x15
|
|
|
|
shr-long/2addr v0, v2
|
|
|
|
long-to-int v1, v0
|
|
|
|
invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const/16 v0, 0x7d
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "]"
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|