464 lines
10 KiB
Smali
464 lines
10 KiB
Smali
.class public final Lrx/internal/util/a/e;
|
|
.super Ljava/util/concurrent/atomic/AtomicReferenceArray;
|
|
.source "SpscExactAtomicArrayQueue.java"
|
|
|
|
# interfaces
|
|
.implements Ljava/util/Queue;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/util/concurrent/atomic/AtomicReferenceArray<",
|
|
"TT;>;",
|
|
"Ljava/util/Queue<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final serialVersionUID:J = 0x5631d997036b8b85L
|
|
|
|
|
|
# instance fields
|
|
.field final capacitySkip:I
|
|
|
|
.field final consumerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
.field final mask:I
|
|
|
|
.field final producerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(I)V
|
|
.locals 2
|
|
|
|
invoke-static {p1}, Lrx/internal/util/b/h;->dV(I)I
|
|
|
|
move-result v0
|
|
|
|
invoke-direct {p0, v0}, Ljava/util/concurrent/atomic/AtomicReferenceArray;-><init>(I)V
|
|
|
|
invoke-virtual {p0}, Lrx/internal/util/a/e;->length()I
|
|
|
|
move-result v0
|
|
|
|
add-int/lit8 v1, v0, -0x1
|
|
|
|
iput v1, p0, Lrx/internal/util/a/e;->mask:I
|
|
|
|
sub-int/2addr v0, p1
|
|
|
|
iput v0, p0, Lrx/internal/util/a/e;->capacitySkip:I
|
|
|
|
new-instance p1, Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-direct {p1}, Ljava/util/concurrent/atomic/AtomicLong;-><init>()V
|
|
|
|
iput-object p1, p0, Lrx/internal/util/a/e;->producerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
new-instance p1, Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-direct {p1}, Ljava/util/concurrent/atomic/AtomicLong;-><init>()V
|
|
|
|
iput-object p1, p0, Lrx/internal/util/a/e;->consumerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final add(Ljava/lang/Object;)Z
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final addAll(Ljava/util/Collection;)Z
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Collection<",
|
|
"+TT;>;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final clear()V
|
|
.locals 1
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lrx/internal/util/a/e;->poll()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-virtual {p0}, Lrx/internal/util/a/e;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final contains(Ljava/lang/Object;)Z
|
|
.locals 0
|
|
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final containsAll(Ljava/util/Collection;)Z
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Collection<",
|
|
"*>;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final element()Ljava/lang/Object;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()TT;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final isEmpty()Z
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lrx/internal/util/a/e;->producerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
iget-object v1, p0, Lrx/internal/util/a/e;->consumerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final iterator()Ljava/util/Iterator;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/Iterator<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final offer(Ljava/lang/Object;)Z
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
iget-object v0, p0, Lrx/internal/util/a/e;->producerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
iget v2, p0, Lrx/internal/util/a/e;->mask:I
|
|
|
|
iget v3, p0, Lrx/internal/util/a/e;->capacitySkip:I
|
|
|
|
int-to-long v3, v3
|
|
|
|
add-long/2addr v3, v0
|
|
|
|
long-to-int v4, v3
|
|
|
|
and-int v3, v4, v2
|
|
|
|
invoke-virtual {p0, v3}, Lrx/internal/util/a/e;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
long-to-int v3, v0
|
|
|
|
and-int/2addr v2, v3
|
|
|
|
iget-object v3, p0, Lrx/internal/util/a/e;->producerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
const-wide/16 v4, 0x1
|
|
|
|
add-long/2addr v0, v4
|
|
|
|
invoke-virtual {v3, v0, v1}, Ljava/util/concurrent/atomic/AtomicLong;->lazySet(J)V
|
|
|
|
invoke-virtual {p0, v2, p1}, Lrx/internal/util/a/e;->lazySet(ILjava/lang/Object;)V
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/NullPointerException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/NullPointerException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final peek()Ljava/lang/Object;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()TT;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lrx/internal/util/a/e;->consumerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
long-to-int v1, v0
|
|
|
|
iget v0, p0, Lrx/internal/util/a/e;->mask:I
|
|
|
|
and-int/2addr v0, v1
|
|
|
|
invoke-virtual {p0, v0}, Lrx/internal/util/a/e;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final poll()Ljava/lang/Object;
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()TT;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lrx/internal/util/a/e;->consumerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
long-to-int v2, v0
|
|
|
|
iget v3, p0, Lrx/internal/util/a/e;->mask:I
|
|
|
|
and-int/2addr v2, v3
|
|
|
|
invoke-virtual {p0, v2}, Lrx/internal/util/a/e;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
const/4 v4, 0x0
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
return-object v4
|
|
|
|
:cond_0
|
|
iget-object v5, p0, Lrx/internal/util/a/e;->consumerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
const-wide/16 v6, 0x1
|
|
|
|
add-long/2addr v0, v6
|
|
|
|
invoke-virtual {v5, v0, v1}, Ljava/util/concurrent/atomic/AtomicLong;->lazySet(J)V
|
|
|
|
invoke-virtual {p0, v2, v4}, Lrx/internal/util/a/e;->lazySet(ILjava/lang/Object;)V
|
|
|
|
return-object v3
|
|
.end method
|
|
|
|
.method public final remove()Ljava/lang/Object;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()TT;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final remove(Ljava/lang/Object;)Z
|
|
.locals 0
|
|
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final removeAll(Ljava/util/Collection;)Z
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Collection<",
|
|
"*>;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final retainAll(Ljava/util/Collection;)Z
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Collection<",
|
|
"*>;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final size()I
|
|
.locals 7
|
|
|
|
iget-object v0, p0, Lrx/internal/util/a/e;->consumerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
:goto_0
|
|
iget-object v2, p0, Lrx/internal/util/a/e;->producerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-virtual {v2}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v2
|
|
|
|
iget-object v4, p0, Lrx/internal/util/a/e;->consumerIndex:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-virtual {v4}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v4
|
|
|
|
cmp-long v6, v0, v4
|
|
|
|
if-nez v6, :cond_0
|
|
|
|
sub-long/2addr v2, v4
|
|
|
|
long-to-int v0, v2
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
move-wide v0, v4
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public final toArray()[Ljava/lang/Object;
|
|
.locals 1
|
|
|
|
new-instance v0, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">([TE;)[TE;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|