alexandroid/decompiled/jadx/sources/com/google/common/hash/Striped64.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

137 lines
4.8 KiB
Java

package com.google.common.hash;
import ai.onnxruntime.OnnxMap$$ExternalSyntheticBUOutline0;
import com.google.common.annotations.GwtIncompatible;
import java.lang.reflect.Field;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Random;
import sun.misc.Unsafe;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@GwtIncompatible
/* loaded from: classes8.dex */
abstract class Striped64 extends Number {
private static final long BASE_OFFSET;
private static final long BUSY_OFFSET;
private static final Unsafe UNSAFE;
volatile transient long base;
volatile transient int busy;
volatile transient Cell[] cells;
static final ThreadLocal<int[]> threadHashCode = new ThreadLocal<>();
static final Random rng = new Random();
static final int NCPU = Runtime.getRuntime().availableProcessors();
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class Cell {
private static final Unsafe UNSAFE;
private static final long VALUE_OFFSET;
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;
static {
try {
Unsafe unsafe = Striped64.getUnsafe();
UNSAFE = unsafe;
VALUE_OFFSET = unsafe.objectFieldOffset(Cell.class.getDeclaredField("value"));
} catch (Exception e) {
throw new Error(e);
}
}
public Cell(long j) {
this.value = j;
}
public final boolean cas(long j, long j2) {
return UNSAFE.compareAndSwapLong(this, VALUE_OFFSET, j, j2);
}
}
static {
try {
Unsafe unsafe = getUnsafe();
UNSAFE = unsafe;
BASE_OFFSET = unsafe.objectFieldOffset(Striped64.class.getDeclaredField("base"));
BUSY_OFFSET = unsafe.objectFieldOffset(Striped64.class.getDeclaredField("busy"));
} catch (Exception e) {
throw new Error(e);
}
}
/* JADX INFO: Access modifiers changed from: private */
public static Unsafe getUnsafe() {
try {
try {
return Unsafe.getUnsafe();
} catch (PrivilegedActionException e) {
OnnxMap$$ExternalSyntheticBUOutline0.m("Could not initialize intrinsics", e.getCause());
return null;
}
} 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");
}
});
}
}
public final boolean casBase(long j, long j2) {
return UNSAFE.compareAndSwapLong(this, BASE_OFFSET, j, j2);
}
public final boolean casBusy() {
return UNSAFE.compareAndSwapInt(this, BUSY_OFFSET, 0, 1);
}
public abstract long fn(long j, long j2);
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;
}
}
}
}
/* JADX WARN: Removed duplicated region for block: B:106:0x00f1 A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:108: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, int[] r19, boolean r20) {
/*
Method dump skipped, instructions count: 242
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");
}
}