@@ -62,13 +62,15 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::Clear___VOID
62
62
NANOCLR_NOCLEANUP ();
63
63
}
64
64
65
- HRESULT Library_nf_system_collections_System_Collections_Hashtable::Contains___BOOLEAN__OBJECT (CLR_RT_StackFrame &stack)
65
+ HRESULT Library_nf_system_collections_System_Collections_Hashtable::ContainsNative___BOOLEAN__OBJECT__I4 (
66
+ CLR_RT_StackFrame &stack)
66
67
{
67
68
NANOCLR_HEADER ();
68
69
69
70
int32_t entry = 0 ;
70
71
int32_t bucketNumber;
71
72
uint32_t hashcode;
73
+ int32_t keyHashCode;
72
74
uint32_t seed;
73
75
uint32_t incr;
74
76
int32_t bucketsLength;
@@ -85,10 +87,12 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::Contains___B
85
87
key = stack.Arg1 ().Dereference ();
86
88
FAULT_ON_NULL_ARG (key);
87
89
90
+ keyHashCode = stack.Arg2 ().NumericByRef ().s4 ;
91
+
88
92
buckets = pThis[FIELD___buckets].DereferenceArray ();
89
93
bucketsLength = buckets->m_numOfElements ;
90
94
91
- hashcode = InitHash (key , bucketsLength, &seed, &incr);
95
+ hashcode = InitHash (keyHashCode , bucketsLength, &seed, &incr);
92
96
93
97
bucketNumber = (int )(seed % (uint32_t )bucketsLength);
94
98
@@ -117,13 +121,15 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::Contains___B
117
121
NANOCLR_NOCLEANUP ();
118
122
}
119
123
120
- HRESULT Library_nf_system_collections_System_Collections_Hashtable::Remove___VOID__OBJECT (CLR_RT_StackFrame &stack)
124
+ HRESULT Library_nf_system_collections_System_Collections_Hashtable::RemoveNative___VOID__OBJECT__I4 (
125
+ CLR_RT_StackFrame &stack)
121
126
{
122
127
NANOCLR_HEADER ();
123
128
124
129
int32_t entry = 0 ;
125
130
int32_t bucketNumber;
126
131
uint32_t hashcode;
132
+ int32_t keyHashCode;
127
133
uint32_t seed;
128
134
uint32_t incr;
129
135
int32_t bucketsLength;
@@ -140,10 +146,12 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::Remove___VOI
140
146
key = stack.Arg1 ().Dereference ();
141
147
FAULT_ON_NULL_ARG (key);
142
148
149
+ keyHashCode = stack.Arg2 ().NumericByRef ().s4 ;
150
+
143
151
buckets = pThis[FIELD___buckets].DereferenceArray ();
144
152
bucketsLength = buckets->m_numOfElements ;
145
153
146
- hashcode = InitHash (key , bucketsLength, &seed, &incr);
154
+ hashcode = InitHash (keyHashCode , bucketsLength, &seed, &incr);
147
155
148
156
bucketNumber = (int )(seed % (uint32_t )bucketsLength);
149
157
@@ -178,7 +186,7 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::Remove___VOI
178
186
NANOCLR_NOCLEANUP ();
179
187
}
180
188
181
- HRESULT Library_nf_system_collections_System_Collections_Hashtable::InsertNative___VOID__OBJECT__OBJECT__BOOLEAN (
189
+ HRESULT Library_nf_system_collections_System_Collections_Hashtable::InsertNative___VOID__OBJECT__OBJECT__BOOLEAN__I4 (
182
190
CLR_RT_StackFrame &stack)
183
191
{
184
192
NANOCLR_HEADER ();
@@ -187,6 +195,7 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::InsertNative
187
195
uint32_t entry = 0 ;
188
196
int32_t bucketNumber;
189
197
uint32_t hashcode;
198
+ int32_t keyHashCode;
190
199
uint32_t seed;
191
200
uint32_t incr;
192
201
uint32_t bucketsLength;
@@ -208,6 +217,8 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::InsertNative
208
217
209
218
add = (bool )stack.Arg3 ().NumericByRef ().u1 ;
210
219
220
+ keyHashCode = stack.Arg4 ().NumericByRef ().s4 ;
221
+
211
222
if (pThis[FIELD___count].NumericByRef ().s4 >= pThis[FIELD___loadsize].NumericByRef ().s4 )
212
223
{
213
224
NANOCLR_CHECK_HRESULT (Expand (stack));
@@ -216,7 +227,7 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::InsertNative
216
227
buckets = pThis[FIELD___buckets].DereferenceArray ();
217
228
bucketsLength = buckets->m_numOfElements ;
218
229
219
- hashcode = InitHash (key , bucketsLength, &seed, &incr);
230
+ hashcode = InitHash (keyHashCode , bucketsLength, &seed, &incr);
220
231
221
232
bucketNumber = (int )(seed % bucketsLength);
222
233
@@ -286,13 +297,15 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::InsertNative
286
297
NANOCLR_NOCLEANUP ();
287
298
}
288
299
289
- HRESULT Library_nf_system_collections_System_Collections_Hashtable::GetNative___OBJECT__OBJECT (CLR_RT_StackFrame &stack)
300
+ HRESULT Library_nf_system_collections_System_Collections_Hashtable::GetNative___OBJECT__OBJECT__I4 (
301
+ CLR_RT_StackFrame &stack)
290
302
{
291
303
NANOCLR_HEADER ();
292
304
293
305
int32_t entry = 0 ;
294
306
int32_t bucketNumber;
295
307
uint32_t hashcode;
308
+ int32_t keyHashCode;
296
309
uint32_t seed;
297
310
uint32_t incr;
298
311
int32_t bucketsLength;
@@ -309,10 +322,12 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::GetNative___
309
322
key = stack.Arg1 ().Dereference ();
310
323
FAULT_ON_NULL_ARG (key);
311
324
325
+ keyHashCode = stack.Arg2 ().NumericByRef ().s4 ;
326
+
312
327
buckets = pThis[FIELD___buckets].DereferenceArray ();
313
328
bucketsLength = buckets->m_numOfElements ;
314
329
315
- hashcode = InitHash (key , bucketsLength, &seed, &incr);
330
+ hashcode = InitHash (keyHashCode , bucketsLength, &seed, &incr);
316
331
317
332
bucketNumber = (int )(seed % (uint32_t )bucketsLength);
318
333
@@ -485,15 +500,13 @@ HRESULT Library_nf_system_collections_System_Collections_Hashtable::Expand(CLR_R
485
500
}
486
501
487
502
uint32_t Library_nf_system_collections_System_Collections_Hashtable::InitHash (
488
- CLR_RT_HeapBlock *key ,
503
+ const int32_t keyHashCode ,
489
504
int32_t hashsize,
490
505
uint32_t *seed,
491
506
uint32_t *incr)
492
507
{
493
- uint32_t hashcode;
508
+ uint32_t hashcode = keyHashCode ;
494
509
495
- // compute hash code for key
496
- hashcode = CLR_RT_HeapBlock::GetHashCode (key, true , 0 );
497
510
*seed = hashcode;
498
511
499
512
// compute and store incr value
0 commit comments