@@ -91,7 +91,7 @@ public abstract static class GetIndexNode extends CoreMethodArrayArgumentsNode {
91
91
@ Specialization
92
92
protected Object getIndex (RubyConcurrentMap self , Object key ,
93
93
@ Cached ToHashByHashCode hashNode ) {
94
- final int hashCode = hashNode .execute (key );
94
+ final int hashCode = hashNode .execute (this , key );
95
95
return nullToNil (get (self .getMap (), new Key (key , hashCode )));
96
96
}
97
97
}
@@ -101,7 +101,7 @@ public abstract static class SetIndexNode extends CoreMethodArrayArgumentsNode {
101
101
@ Specialization
102
102
protected Object setIndex (RubyConcurrentMap self , Object key , Object value ,
103
103
@ Cached ToHashByHashCode hashNode ) {
104
- final int hashCode = hashNode .execute (key );
104
+ final int hashCode = hashNode .execute (this , key );
105
105
put (self .getMap (), new Key (key , hashCode ), value );
106
106
return value ;
107
107
}
@@ -118,7 +118,7 @@ public abstract static class ComputeIfAbsentNode extends CoreMethodArrayArgument
118
118
protected Object computeIfAbsent (RubyConcurrentMap self , Object key , RubyProc block ,
119
119
@ Cached ToHashByHashCode hashNode ,
120
120
@ Cached CallBlockNode yieldNode ) {
121
- final int hashCode = hashNode .execute (key );
121
+ final int hashCode = hashNode .execute (this , key );
122
122
final Object returnValue = ConcurrentOperations
123
123
.getOrCompute (self .getMap (), new Key (key , hashCode ), (k ) -> yieldNode .yield (block ));
124
124
assert returnValue != null ;
@@ -133,7 +133,7 @@ public abstract static class ComputeIfPresentNode extends CoreMethodArrayArgumen
133
133
protected Object computeIfPresent (RubyConcurrentMap self , Object key , RubyProc block ,
134
134
@ Cached ToHashByHashCode hashNode ,
135
135
@ Cached CallBlockNode yieldNode ) {
136
- final int hashCode = hashNode .execute (key );
136
+ final int hashCode = hashNode .execute (this , key );
137
137
return nullToNil (
138
138
computeIfPresent (self .getMap (), new Key (key , hashCode ), (k , v ) ->
139
139
// TODO (Chris, 6 May 2021): It's unfortunate we're calling this behind a boundary! Can we do better?
@@ -153,7 +153,7 @@ public abstract static class ComputeNode extends CoreMethodArrayArgumentsNode {
153
153
protected Object compute (RubyConcurrentMap self , Object key , RubyProc block ,
154
154
@ Cached ToHashByHashCode hashNode ,
155
155
@ Cached CallBlockNode yieldNode ) {
156
- final int hashCode = hashNode .execute (key );
156
+ final int hashCode = hashNode .execute (this , key );
157
157
return nullToNil (compute (
158
158
self .getMap (),
159
159
new Key (key , hashCode ),
@@ -173,7 +173,7 @@ public abstract static class MergePairNode extends CoreMethodArrayArgumentsNode
173
173
protected Object mergePair (RubyConcurrentMap self , Object key , Object value , RubyProc block ,
174
174
@ Cached ToHashByHashCode hashNode ,
175
175
@ Cached CallBlockNode yieldNode ) {
176
- final int hashCode = hashNode .execute (key );
176
+ final int hashCode = hashNode .execute (this , key );
177
177
return nullToNil (merge (
178
178
self .getMap (),
179
179
new Key (key , hashCode ),
@@ -196,7 +196,7 @@ protected boolean replacePairPrimitive(
196
196
RubyConcurrentMap self , Object key , Object expectedValue , Object newValue ,
197
197
@ Exclusive @ Cached ToHashByHashCode hashNode ,
198
198
@ Cached ReferenceEqualNode equalNode ) {
199
- final int hashCode = hashNode .execute (key );
199
+ final int hashCode = hashNode .execute (this , key );
200
200
final Key keyWrapper = new Key (key , hashCode );
201
201
202
202
while (true ) {
@@ -216,7 +216,7 @@ protected boolean replacePairPrimitive(
216
216
@ Specialization (guards = "!isPrimitive(expectedValue)" )
217
217
protected boolean replacePair (RubyConcurrentMap self , Object key , Object expectedValue , Object newValue ,
218
218
@ Exclusive @ Cached ToHashByHashCode hashNode ) {
219
- final int hashCode = hashNode .execute (key );
219
+ final int hashCode = hashNode .execute (this , key );
220
220
return replace (self .getMap (), new Key (key , hashCode ), expectedValue , newValue );
221
221
}
222
222
@@ -233,7 +233,7 @@ public abstract static class DeletePairNode extends CoreMethodArrayArgumentsNode
233
233
protected boolean deletePairPrimitive (RubyConcurrentMap self , Object key , Object expectedValue ,
234
234
@ Exclusive @ Cached ToHashByHashCode hashNode ,
235
235
@ Cached ReferenceEqualNode equalNode ) {
236
- final int hashCode = hashNode .execute (key );
236
+ final int hashCode = hashNode .execute (this , key );
237
237
final Key keyWrapper = new Key (key , hashCode );
238
238
239
239
while (true ) {
@@ -253,7 +253,7 @@ protected boolean deletePairPrimitive(RubyConcurrentMap self, Object key, Object
253
253
@ Specialization (guards = "!isPrimitive(expectedValue)" )
254
254
protected boolean deletePair (RubyConcurrentMap self , Object key , Object expectedValue ,
255
255
@ Exclusive @ Cached ToHashByHashCode hashNode ) {
256
- final int hashCode = hashNode .execute (key );
256
+ final int hashCode = hashNode .execute (this , key );
257
257
return remove (self .getMap (), new Key (key , hashCode ), expectedValue );
258
258
}
259
259
@@ -268,7 +268,7 @@ public abstract static class ReplaceIfExistsNode extends CoreMethodArrayArgument
268
268
@ Specialization
269
269
protected Object replaceIfExists (RubyConcurrentMap self , Object key , Object newValue ,
270
270
@ Cached ToHashByHashCode hashNode ) {
271
- final int hashCode = hashNode .execute (key );
271
+ final int hashCode = hashNode .execute (this , key );
272
272
return nullToNil (replace (self .getMap (), new Key (key , hashCode ), newValue ));
273
273
}
274
274
@@ -283,7 +283,7 @@ public abstract static class GetAndSetNode extends CoreMethodArrayArgumentsNode
283
283
@ Specialization
284
284
protected Object getAndSet (RubyConcurrentMap self , Object key , Object value ,
285
285
@ Cached ToHashByHashCode hashNode ) {
286
- final int hashCode = hashNode .execute (key );
286
+ final int hashCode = hashNode .execute (this , key );
287
287
return nullToNil (put (self .getMap (), new Key (key , hashCode ), value ));
288
288
}
289
289
@@ -298,7 +298,7 @@ public abstract static class KeyNode extends CoreMethodArrayArgumentsNode {
298
298
@ Specialization
299
299
protected boolean key (RubyConcurrentMap self , Object key ,
300
300
@ Cached ToHashByHashCode hashNode ) {
301
- final int hashCode = hashNode .execute (key );
301
+ final int hashCode = hashNode .execute (this , key );
302
302
return containsKey (self .getMap (), new Key (key , hashCode ));
303
303
}
304
304
@@ -313,7 +313,7 @@ public abstract static class DeleteNode extends CoreMethodArrayArgumentsNode {
313
313
@ Specialization
314
314
protected Object delete (RubyConcurrentMap self , Object key ,
315
315
@ Cached ToHashByHashCode hashNode ) {
316
- final int hashCode = hashNode .execute (key );
316
+ final int hashCode = hashNode .execute (this , key );
317
317
return nullToNil (remove (self .getMap (), new Key (key , hashCode )));
318
318
}
319
319
@@ -347,7 +347,7 @@ public abstract static class GetOrDefaultNode extends CoreMethodArrayArgumentsNo
347
347
@ Specialization
348
348
protected Object getOrDefault (RubyConcurrentMap self , Object key , Object defaultValue ,
349
349
@ Cached ToHashByHashCode hashNode ) {
350
- final int hashCode = hashNode .execute (key );
350
+ final int hashCode = hashNode .execute (this , key );
351
351
return getOrDefault (self .getMap (), new Key (key , hashCode ), defaultValue );
352
352
}
353
353
0 commit comments