mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-26 09:02:34 -06:00
143 lines
4.9 KiB
Java
143 lines
4.9 KiB
Java
package com.google.common.hash;
|
|
|
|
import java.lang.reflect.Field;
|
|
import java.security.AccessController;
|
|
import java.security.PrivilegedActionException;
|
|
import java.security.PrivilegedExceptionAction;
|
|
import java.util.Random;
|
|
import javax.annotation.CheckForNull;
|
|
import sun.misc.Unsafe;
|
|
|
|
@ElementTypesAreNonnullByDefault
|
|
/* loaded from: classes3.dex */
|
|
abstract class Striped64 extends Number {
|
|
private static final Unsafe UNSAFE;
|
|
private static final long baseOffset;
|
|
private static final long busyOffset;
|
|
volatile transient long base;
|
|
volatile transient int busy;
|
|
|
|
@CheckForNull
|
|
volatile transient Cell[] cells;
|
|
static final ThreadLocal<int[]> threadHashCode = new ThreadLocal<>();
|
|
static final Random rng = new Random();
|
|
static final int NCPU = Runtime.getRuntime().availableProcessors();
|
|
|
|
abstract long fn(long j, long j2);
|
|
|
|
static /* synthetic */ Unsafe access$000() {
|
|
return getUnsafe();
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
static final class Cell {
|
|
private static final Unsafe UNSAFE;
|
|
private static final long valueOffset;
|
|
volatile long p0;
|
|
volatile long p1;
|
|
volatile long p2;
|
|
volatile long p3;
|
|
volatile long p4;
|
|
volatile long p5;
|
|
volatile long p6;
|
|
volatile long q0;
|
|
volatile long q1;
|
|
volatile long q2;
|
|
volatile long q3;
|
|
volatile long q4;
|
|
volatile long q5;
|
|
volatile long q6;
|
|
volatile long value;
|
|
|
|
Cell(long j) {
|
|
this.value = j;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final boolean cas(long j, long j2) {
|
|
return UNSAFE.compareAndSwapLong(this, valueOffset, j, j2);
|
|
}
|
|
|
|
static {
|
|
try {
|
|
Unsafe access$000 = Striped64.access$000();
|
|
UNSAFE = access$000;
|
|
valueOffset = access$000.objectFieldOffset(Cell.class.getDeclaredField("value"));
|
|
} catch (Exception e) {
|
|
throw new Error(e);
|
|
}
|
|
}
|
|
}
|
|
|
|
static {
|
|
try {
|
|
Unsafe unsafe = getUnsafe();
|
|
UNSAFE = unsafe;
|
|
baseOffset = unsafe.objectFieldOffset(Striped64.class.getDeclaredField("base"));
|
|
busyOffset = unsafe.objectFieldOffset(Striped64.class.getDeclaredField("busy"));
|
|
} catch (Exception e) {
|
|
throw new Error(e);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final boolean casBase(long j, long j2) {
|
|
return UNSAFE.compareAndSwapLong(this, baseOffset, j, j2);
|
|
}
|
|
|
|
final boolean casBusy() {
|
|
return UNSAFE.compareAndSwapInt(this, busyOffset, 0, 1);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* JADX WARN: Removed duplicated region for block: B:105:0x00ee A[SYNTHETIC] */
|
|
/* JADX WARN: Removed duplicated region for block: B:107:0x0023 A[SYNTHETIC] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final void retryUpdate(long r17, @javax.annotation.CheckForNull int[] r19, boolean r20) {
|
|
/*
|
|
Method dump skipped, instructions count: 239
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.google.common.hash.Striped64.retryUpdate(long, int[], boolean):void");
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final void internalReset(long j) {
|
|
Cell[] cellArr = this.cells;
|
|
this.base = j;
|
|
if (cellArr != null) {
|
|
for (Cell cell : cellArr) {
|
|
if (cell != null) {
|
|
cell.value = j;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private static Unsafe getUnsafe() {
|
|
try {
|
|
try {
|
|
return Unsafe.getUnsafe();
|
|
} catch (PrivilegedActionException e) {
|
|
throw new RuntimeException("Could not initialize intrinsics", e.getCause());
|
|
}
|
|
} catch (SecurityException unused) {
|
|
return (Unsafe) AccessController.doPrivileged(new PrivilegedExceptionAction<Unsafe>() { // from class: com.google.common.hash.Striped64.1
|
|
@Override // java.security.PrivilegedExceptionAction
|
|
public Unsafe run() throws Exception {
|
|
for (Field field : Unsafe.class.getDeclaredFields()) {
|
|
field.setAccessible(true);
|
|
Object obj = field.get(null);
|
|
if (Unsafe.class.isInstance(obj)) {
|
|
return (Unsafe) Unsafe.class.cast(obj);
|
|
}
|
|
}
|
|
throw new NoSuchFieldError("the Unsafe");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|