183 lines
4.4 KiB
Smali
183 lines
4.4 KiB
Smali
.class public Lcom/alibaba/fastjson/util/IdentityHashMap;
|
|
.super Ljava/lang/Object;
|
|
.source "IdentityHashMap.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<K:",
|
|
"Ljava/lang/Object;",
|
|
"V:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/lang/Object;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final buckets:[Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"[",
|
|
"Lcom/alibaba/fastjson/util/IdentityHashMap$Entry<",
|
|
"TK;TV;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final indexMask:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
const/16 v0, 0x400
|
|
|
|
.line 29
|
|
invoke-direct {p0, v0}, Lcom/alibaba/fastjson/util/IdentityHashMap;-><init>(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(I)V
|
|
.locals 1
|
|
|
|
.line 32
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
add-int/lit8 v0, p1, -0x1
|
|
|
|
.line 33
|
|
iput v0, p0, Lcom/alibaba/fastjson/util/IdentityHashMap;->indexMask:I
|
|
|
|
.line 34
|
|
new-array p1, p1, [Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
|
|
iput-object p1, p0, Lcom/alibaba/fastjson/util/IdentityHashMap;->buckets:[Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TK;)TV;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 38
|
|
invoke-static {p1}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I
|
|
|
|
move-result v0
|
|
|
|
.line 39
|
|
iget v1, p0, Lcom/alibaba/fastjson/util/IdentityHashMap;->indexMask:I
|
|
|
|
and-int/2addr v0, v1
|
|
|
|
.line 41
|
|
iget-object v1, p0, Lcom/alibaba/fastjson/util/IdentityHashMap;->buckets:[Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
|
|
aget-object v0, v1, v0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 42
|
|
iget-object v1, v0, Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;->key:Ljava/lang/Object;
|
|
|
|
if-ne p1, v1, :cond_0
|
|
|
|
.line 43
|
|
iget-object p1, v0, Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;->value:Ljava/lang/Object;
|
|
|
|
return-object p1
|
|
|
|
.line 41
|
|
:cond_0
|
|
iget-object v0, v0, Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;->next:Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public put(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TK;TV;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
.line 51
|
|
invoke-static {p1}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I
|
|
|
|
move-result v0
|
|
|
|
.line 52
|
|
iget v1, p0, Lcom/alibaba/fastjson/util/IdentityHashMap;->indexMask:I
|
|
|
|
and-int/2addr v1, v0
|
|
|
|
.line 54
|
|
iget-object v2, p0, Lcom/alibaba/fastjson/util/IdentityHashMap;->buckets:[Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
|
|
aget-object v2, v2, v1
|
|
|
|
:goto_0
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 55
|
|
iget-object v3, v2, Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;->key:Ljava/lang/Object;
|
|
|
|
if-ne p1, v3, :cond_0
|
|
|
|
.line 56
|
|
iput-object p2, v2, Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;->value:Ljava/lang/Object;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
.line 54
|
|
:cond_0
|
|
iget-object v2, v2, Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;->next:Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
|
|
goto :goto_0
|
|
|
|
.line 61
|
|
:cond_1
|
|
new-instance v2, Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
|
|
iget-object v3, p0, Lcom/alibaba/fastjson/util/IdentityHashMap;->buckets:[Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
|
|
aget-object v3, v3, v1
|
|
|
|
invoke-direct {v2, p1, p2, v0, v3}, Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;-><init>(Ljava/lang/Object;Ljava/lang/Object;ILcom/alibaba/fastjson/util/IdentityHashMap$Entry;)V
|
|
|
|
.line 62
|
|
iget-object p1, p0, Lcom/alibaba/fastjson/util/IdentityHashMap;->buckets:[Lcom/alibaba/fastjson/util/IdentityHashMap$Entry;
|
|
|
|
aput-object v2, p1, v1
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|