tmap/smali_classes3/com/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper.smali
2022-06-10 21:38:30 +09:00

330 lines
10 KiB
Smali

.class final Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;
.super Lcom/google/common/util/concurrent/AbstractFuture$AtomicHelper;
.source "AbstractFuture.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/common/util/concurrent/AbstractFuture;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x19
name = "UnsafeAtomicHelper"
.end annotation
# static fields
.field public static final LISTENERS_OFFSET:J
.field public static final UNSAFE:Lsun/misc/Unsafe;
.field public static final VALUE_OFFSET:J
.field public static final WAITERS_OFFSET:J
.field public static final WAITER_NEXT_OFFSET:J
.field public static final WAITER_THREAD_OFFSET:J
# direct methods
.method public static constructor <clinit>()V
.locals 5
.line 1
const-class v0, Lcom/google/common/util/concurrent/AbstractFuture$Waiter;
:try_start_0
invoke-static {}, Lsun/misc/Unsafe;->getUnsafe()Lsun/misc/Unsafe;
move-result-object v1
:try_end_0
.catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 2
:catch_0
:try_start_1
new-instance v1, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper$1;
invoke-direct {v1}, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper$1;-><init>()V
.line 3
invoke-static {v1}, Ljava/security/AccessController;->doPrivileged(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lsun/misc/Unsafe;
:try_end_1
.catch Ljava/security/PrivilegedActionException; {:try_start_1 .. :try_end_1} :catch_2
.line 4
:goto_0
:try_start_2
const-class v2, Lcom/google/common/util/concurrent/AbstractFuture;
const-string v3, "waiters"
.line 5
invoke-virtual {v2, v3}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v3
invoke-virtual {v1, v3}, Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J
move-result-wide v3
sput-wide v3, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->WAITERS_OFFSET:J
const-string v3, "listeners"
.line 6
invoke-virtual {v2, v3}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v3
invoke-virtual {v1, v3}, Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J
move-result-wide v3
sput-wide v3, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->LISTENERS_OFFSET:J
const-string v3, "value"
.line 7
invoke-virtual {v2, v3}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v2
invoke-virtual {v1, v2}, Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J
move-result-wide v2
sput-wide v2, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->VALUE_OFFSET:J
const-string v2, "thread"
.line 8
invoke-virtual {v0, v2}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v2
invoke-virtual {v1, v2}, Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J
move-result-wide v2
sput-wide v2, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->WAITER_THREAD_OFFSET:J
const-string v2, "next"
.line 9
invoke-virtual {v0, v2}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v0
invoke-virtual {v1, v0}, Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J
move-result-wide v2
sput-wide v2, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->WAITER_NEXT_OFFSET:J
.line 10
sput-object v1, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->UNSAFE:Lsun/misc/Unsafe;
:try_end_2
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1
return-void
:catch_1
move-exception v0
.line 11
invoke-static {v0}, Lcom/google/common/base/Throwables;->throwIfUnchecked(Ljava/lang/Throwable;)V
.line 12
new-instance v1, Ljava/lang/RuntimeException;
invoke-direct {v1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
throw v1
:catch_2
move-exception v0
.line 13
new-instance v1, Ljava/lang/RuntimeException;
invoke-virtual {v0}, Ljava/security/PrivilegedActionException;->getCause()Ljava/lang/Throwable;
move-result-object v0
const-string v2, "Could not initialize intrinsics"
invoke-direct {v1, v2, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v1
.end method
.method private constructor <init>()V
.locals 1
const/4 v0, 0x0
.line 1
invoke-direct {p0, v0}, Lcom/google/common/util/concurrent/AbstractFuture$AtomicHelper;-><init>(Lcom/google/common/util/concurrent/AbstractFuture$1;)V
return-void
.end method
.method public synthetic constructor <init>(Lcom/google/common/util/concurrent/AbstractFuture$1;)V
.locals 0
.line 2
invoke-direct {p0}, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;-><init>()V
return-void
.end method
# virtual methods
.method public casListeners(Lcom/google/common/util/concurrent/AbstractFuture;Lcom/google/common/util/concurrent/AbstractFuture$Listener;Lcom/google/common/util/concurrent/AbstractFuture$Listener;)Z
.locals 6
.param p2 # Lcom/google/common/util/concurrent/AbstractFuture$Listener;
.annotation runtime Ljavax/annotation/CheckForNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/util/concurrent/AbstractFuture<",
"*>;",
"Lcom/google/common/util/concurrent/AbstractFuture$Listener;",
"Lcom/google/common/util/concurrent/AbstractFuture$Listener;",
")Z"
}
.end annotation
.line 1
sget-object v0, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->UNSAFE:Lsun/misc/Unsafe;
sget-wide v2, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->LISTENERS_OFFSET:J
move-object v1, p1
move-object v4, p2
move-object v5, p3
invoke-virtual/range {v0 .. v5}, Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z
move-result p1
return p1
.end method
.method public casValue(Lcom/google/common/util/concurrent/AbstractFuture;Ljava/lang/Object;Ljava/lang/Object;)Z
.locals 6
.param p2 # Ljava/lang/Object;
.annotation runtime Ljavax/annotation/CheckForNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/util/concurrent/AbstractFuture<",
"*>;",
"Ljava/lang/Object;",
"Ljava/lang/Object;",
")Z"
}
.end annotation
.line 1
sget-object v0, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->UNSAFE:Lsun/misc/Unsafe;
sget-wide v2, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->VALUE_OFFSET:J
move-object v1, p1
move-object v4, p2
move-object v5, p3
invoke-virtual/range {v0 .. v5}, Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z
move-result p1
return p1
.end method
.method public casWaiters(Lcom/google/common/util/concurrent/AbstractFuture;Lcom/google/common/util/concurrent/AbstractFuture$Waiter;Lcom/google/common/util/concurrent/AbstractFuture$Waiter;)Z
.locals 6
.param p2 # Lcom/google/common/util/concurrent/AbstractFuture$Waiter;
.annotation runtime Ljavax/annotation/CheckForNull;
.end annotation
.end param
.param p3 # Lcom/google/common/util/concurrent/AbstractFuture$Waiter;
.annotation runtime Ljavax/annotation/CheckForNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/util/concurrent/AbstractFuture<",
"*>;",
"Lcom/google/common/util/concurrent/AbstractFuture$Waiter;",
"Lcom/google/common/util/concurrent/AbstractFuture$Waiter;",
")Z"
}
.end annotation
.line 1
sget-object v0, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->UNSAFE:Lsun/misc/Unsafe;
sget-wide v2, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->WAITERS_OFFSET:J
move-object v1, p1
move-object v4, p2
move-object v5, p3
invoke-virtual/range {v0 .. v5}, Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z
move-result p1
return p1
.end method
.method public putNext(Lcom/google/common/util/concurrent/AbstractFuture$Waiter;Lcom/google/common/util/concurrent/AbstractFuture$Waiter;)V
.locals 3
.param p2 # Lcom/google/common/util/concurrent/AbstractFuture$Waiter;
.annotation runtime Ljavax/annotation/CheckForNull;
.end annotation
.end param
.line 1
sget-object v0, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->UNSAFE:Lsun/misc/Unsafe;
sget-wide v1, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->WAITER_NEXT_OFFSET:J
invoke-virtual {v0, p1, v1, v2, p2}, Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V
return-void
.end method
.method public putThread(Lcom/google/common/util/concurrent/AbstractFuture$Waiter;Ljava/lang/Thread;)V
.locals 3
.line 1
sget-object v0, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->UNSAFE:Lsun/misc/Unsafe;
sget-wide v1, Lcom/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper;->WAITER_THREAD_OFFSET:J
invoke-virtual {v0, p1, v1, v2, p2}, Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V
return-void
.end method