IdentityHashMap.smali
5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
.class public Lnet/json/fastjson/util/IdentityHashMap;
.super Ljava/lang/Object;
.source "IdentityHashMap.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lnet/json/fastjson/util/IdentityHashMap$Entry;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<V:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;"
}
.end annotation
# instance fields
.field private final buckets:[Lnet/json/fastjson/util/IdentityHashMap$Entry;
.annotation system Ldalvik/annotation/Signature;
value = {
"[",
"Lnet/json/fastjson/util/IdentityHashMap$Entry<",
"TV;>;"
}
.end annotation
.end field
.field private final indexMask:I
# direct methods
.method public constructor <init>(I)V
.locals 1
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
add-int/lit8 v0, p1, -0x1
.line 2
iput v0, p0, Lnet/json/fastjson/util/IdentityHashMap;->indexMask:I
.line 3
new-array p1, p1, [Lnet/json/fastjson/util/IdentityHashMap$Entry;
iput-object p1, p0, Lnet/json/fastjson/util/IdentityHashMap;->buckets:[Lnet/json/fastjson/util/IdentityHashMap$Entry;
return-void
.end method
# virtual methods
.method public findClass(Ljava/lang/String;)Ljava/lang/Class;
.locals 5
const/4 v0, 0x0
.line 1
:goto_0
iget-object v1, p0, Lnet/json/fastjson/util/IdentityHashMap;->buckets:[Lnet/json/fastjson/util/IdentityHashMap$Entry;
array-length v2, v1
if-ge v0, v2, :cond_3
.line 2
aget-object v1, v1, v0
if-nez v1, :cond_0
goto :goto_2
:cond_0
move-object v2, v1
:goto_1
if-eqz v2, :cond_2
.line 9
iget-object v3, v1, Lnet/json/fastjson/util/IdentityHashMap$Entry;->key:Ljava/lang/reflect/Type;
.line 10
instance-of v4, v3, Ljava/lang/Class;
if-eqz v4, :cond_1
.line 11
check-cast v3, Ljava/lang/Class;
.line 12
invoke-virtual {v3}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v4
.line 13
invoke-virtual {v4, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_1
return-object v3
.line 14
:cond_1
iget-object v2, v2, Lnet/json/fastjson/util/IdentityHashMap$Entry;->next:Lnet/json/fastjson/util/IdentityHashMap$Entry;
goto :goto_1
:cond_2
:goto_2
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_3
const/4 p1, 0x0
return-object p1
.end method
.method public final get(Ljava/lang/reflect/Type;)Ljava/lang/Object;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/reflect/Type;",
")TV;"
}
.end annotation
.line 1
invoke-static {p1}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I
move-result v0
.line 2
iget v1, p0, Lnet/json/fastjson/util/IdentityHashMap;->indexMask:I
and-int/2addr v0, v1
.line 4
iget-object v1, p0, Lnet/json/fastjson/util/IdentityHashMap;->buckets:[Lnet/json/fastjson/util/IdentityHashMap$Entry;
aget-object v0, v1, v0
:goto_0
if-eqz v0, :cond_1
.line 5
iget-object v1, v0, Lnet/json/fastjson/util/IdentityHashMap$Entry;->key:Ljava/lang/reflect/Type;
if-ne p1, v1, :cond_0
.line 6
iget-object p1, v0, Lnet/json/fastjson/util/IdentityHashMap$Entry;->value:Ljava/lang/Object;
return-object p1
.line 7
:cond_0
iget-object v0, v0, Lnet/json/fastjson/util/IdentityHashMap$Entry;->next:Lnet/json/fastjson/util/IdentityHashMap$Entry;
goto :goto_0
:cond_1
const/4 p1, 0x0
return-object p1
.end method
.method public put(Ljava/lang/reflect/Type;Ljava/lang/Object;)Z
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/reflect/Type;",
"TV;)Z"
}
.end annotation
.line 1
invoke-static {p1}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I
move-result v0
.line 2
iget v1, p0, Lnet/json/fastjson/util/IdentityHashMap;->indexMask:I
and-int/2addr v1, v0
.line 4
iget-object v2, p0, Lnet/json/fastjson/util/IdentityHashMap;->buckets:[Lnet/json/fastjson/util/IdentityHashMap$Entry;
aget-object v2, v2, v1
:goto_0
if-eqz v2, :cond_1
.line 5
iget-object v3, v2, Lnet/json/fastjson/util/IdentityHashMap$Entry;->key:Ljava/lang/reflect/Type;
if-ne p1, v3, :cond_0
.line 6
iput-object p2, v2, Lnet/json/fastjson/util/IdentityHashMap$Entry;->value:Ljava/lang/Object;
const/4 p1, 0x1
return p1
.line 7
:cond_0
iget-object v2, v2, Lnet/json/fastjson/util/IdentityHashMap$Entry;->next:Lnet/json/fastjson/util/IdentityHashMap$Entry;
goto :goto_0
.line 14
:cond_1
new-instance v2, Lnet/json/fastjson/util/IdentityHashMap$Entry;
iget-object v3, p0, Lnet/json/fastjson/util/IdentityHashMap;->buckets:[Lnet/json/fastjson/util/IdentityHashMap$Entry;
aget-object v3, v3, v1
invoke-direct {v2, p1, p2, v0, v3}, Lnet/json/fastjson/util/IdentityHashMap$Entry;-><init>(Ljava/lang/reflect/Type;Ljava/lang/Object;ILnet/json/fastjson/util/IdentityHashMap$Entry;)V
.line 15
iget-object p1, p0, Lnet/json/fastjson/util/IdentityHashMap;->buckets:[Lnet/json/fastjson/util/IdentityHashMap$Entry;
aput-object v2, p1, v1
const/4 p1, 0x0
return p1
.end method