@@ -163,66 +163,65 @@ static boolean maySideEffect(PythonObject o, LookupInheritedAttributeNode.Dynami
163
163
@ Specialization
164
164
static HashingStorage setItemTruffleString (EconomicMapStorage self , TruffleString key , Object value , ThreadState state ,
165
165
@ Shared ("tsHash" ) @ Cached TruffleString .HashCodeNode hashCodeNode ,
166
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles profiles ,
166
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
167
167
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
168
168
VirtualFrame frame = gotState .profile (state == null ) ? null : PArguments .frameForCall (state );
169
- DictKey newKey = new DictKey (key , PyObjectHashNode .hash (key , hashCodeNode ));
170
- self .map .put (frame , key , PyObjectHashNode .hash (key , hashCodeNode ), assertNoJavaString (value ), profiles );
169
+ putNode .put (state , self .map , key , PyObjectHashNode .hash (key , hashCodeNode ), assertNoJavaString (value ));
171
170
return self ;
172
171
}
173
172
174
173
@ Specialization (guards = {"isBuiltinString(key, isBuiltinClassProfile)" }, limit = "1" )
175
174
static HashingStorage setItemPString (EconomicMapStorage self , PString key , Object value , ThreadState state ,
176
175
@ Shared ("stringMaterialize" ) @ Cached StringMaterializeNode stringMaterializeNode ,
177
176
@ Shared ("tsHash" ) @ Cached TruffleString .HashCodeNode hashCodeNode ,
178
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles profiles ,
177
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
179
178
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ,
180
179
@ Shared ("builtinProfile" ) @ Cached IsBuiltinClassProfile isBuiltinClassProfile ) {
181
180
final TruffleString k = stringMaterializeNode .execute (key );
182
- return setItemTruffleString (self , k , value , state , hashCodeNode , profiles , gotState );
181
+ return setItemTruffleString (self , k , value , state , hashCodeNode , putNode , gotState );
183
182
}
184
183
185
184
@ Specialization (guards = {"!hasSideEffect(self)" , "!isBuiltin(key,builtinProfile) || !isBuiltin(value,builtinProfile)" ,
186
185
"maySideEffect(key, lookup) || maySideEffect(value, lookup)" }, limit = "1" )
187
186
static HashingStorage setItemPythonObjectWithSideEffect (EconomicMapStorage self , PythonObject key , PythonObject value , ThreadState state ,
188
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles profiles ,
187
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
189
188
@ Shared ("hashNode" ) @ Cached PyObjectHashNode hashNode ,
190
189
@ Shared ("lookup" ) @ Cached LookupInheritedAttributeNode .Dynamic lookup ,
191
190
@ Shared ("builtinProfile" ) @ Cached IsBuiltinClassProfile builtinProfile ,
192
191
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
193
192
convertToSideEffectMap (self );
194
- return setItemGeneric (self , key , value , state , profiles , hashNode , gotState );
193
+ return setItemGeneric (self , key , value , state , putNode , hashNode , gotState );
195
194
}
196
195
197
196
@ Specialization (guards = {"!hasSideEffect(self)" , "!isBuiltin(key,builtinProfile)" , "maySideEffect(key, lookup)" }, limit = "1" )
198
197
static HashingStorage setItemPythonObjectWithSideEffect (EconomicMapStorage self , PythonObject key , Object value , ThreadState state ,
199
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles profiles ,
198
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
200
199
@ Shared ("hashNode" ) @ Cached PyObjectHashNode hashNode ,
201
200
@ Shared ("lookup" ) @ Cached LookupInheritedAttributeNode .Dynamic lookup ,
202
201
@ Shared ("builtinProfile" ) @ Cached IsBuiltinClassProfile builtinProfile ,
203
202
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
204
203
convertToSideEffectMap (self );
205
- return setItemGeneric (self , key , value , state , profiles , hashNode , gotState );
204
+ return setItemGeneric (self , key , value , state , putNode , hashNode , gotState );
206
205
}
207
206
208
207
@ Specialization (guards = {"!hasSideEffect(self)" , "!isBuiltin(value,builtinProfile)" , "maySideEffect(value, lookup)" }, limit = "1" )
209
208
static HashingStorage setItemPythonObjectWithSideEffect (EconomicMapStorage self , Object key , PythonObject value , ThreadState state ,
210
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles profiles ,
209
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
211
210
@ Shared ("hashNode" ) @ Cached PyObjectHashNode hashNode ,
212
211
@ Shared ("lookup" ) @ Cached LookupInheritedAttributeNode .Dynamic lookup ,
213
212
@ Shared ("builtinProfile" ) @ Cached IsBuiltinClassProfile builtinProfile ,
214
213
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
215
214
convertToSideEffectMap (self );
216
- return setItemGeneric (self , key , value , state , profiles , hashNode , gotState );
215
+ return setItemGeneric (self , key , value , state , putNode , hashNode , gotState );
217
216
}
218
217
219
218
@ Specialization (replaces = {"setItemPString" , "setItemTruffleString" })
220
219
static HashingStorage setItemGeneric (EconomicMapStorage self , Object key , Object value , ThreadState state ,
221
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles profiles ,
220
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
222
221
@ Shared ("hashNode" ) @ Cached PyObjectHashNode hashNode ,
223
222
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
224
223
VirtualFrame frame = gotState .profile (state == null ) ? null : PArguments .frameForCall (state );
225
- self . map . put (frame , key , hashNode .execute (frame , key ), assertNoJavaString (value ), profiles );
224
+ putNode . put (state , self . map , key , hashNode .execute (frame , key ), assertNoJavaString (value ));
226
225
return self ;
227
226
}
228
227
}
@@ -328,7 +327,7 @@ public static class EqualsWithState {
328
327
@ Specialization
329
328
static boolean equalSameType (EconomicMapStorage self , EconomicMapStorage other , ThreadState state ,
330
329
@ CachedLibrary ("self" ) HashingStorageLibrary thisLib ,
331
- @ Shared ("getNode" ) @ Cached ObjectHashMap .GetNode getNode ,
330
+ @ Shared ("getNode" ) @ Cached ObjectHashMap .GetNode getNode ,
332
331
@ Shared ("eqNode" ) @ Cached PyObjectRichCompareBool .EqNode eqNode ,
333
332
@ Shared ("selfEntriesLoop" ) @ Cached LoopConditionProfile loopProfile ,
334
333
@ Shared ("selfEntriesLoopExit" ) @ Cached LoopConditionProfile earlyExitProfile ,
@@ -403,7 +402,7 @@ static int compareSameType(EconomicMapStorage self, EconomicMapStorage other, Th
403
402
@ CachedLibrary ("self" ) HashingStorageLibrary thisLib ,
404
403
@ Shared ("selfEntriesLoop" ) @ Cached LoopConditionProfile loopProfile ,
405
404
@ Shared ("selfEntriesLoopExit" ) @ Cached LoopConditionProfile earlyExitProfile ,
406
- @ Shared ("getNode" ) @ Cached ObjectHashMap .GetNode getNode ,
405
+ @ Shared ("getNode" ) @ Cached ObjectHashMap .GetNode getNode ,
407
406
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
408
407
int size = self .map .size ();
409
408
int size2 = other .map .size ();
@@ -476,8 +475,8 @@ public static class IntersectWithState {
476
475
@ Specialization
477
476
static HashingStorage intersectSameType (EconomicMapStorage self , EconomicMapStorage other , ThreadState state ,
478
477
@ CachedLibrary ("self" ) HashingStorageLibrary thisLib ,
479
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles putProfiles ,
480
- @ Shared ("getNode" ) @ Cached ObjectHashMap .GetNode getNode ,
478
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
479
+ @ Shared ("getNode" ) @ Cached ObjectHashMap .GetNode getNode ,
481
480
@ Shared ("selfEntriesLoop" ) @ Cached LoopConditionProfile loopProfile ,
482
481
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
483
482
EconomicMapStorage result = EconomicMapStorage .create ();
@@ -489,7 +488,7 @@ static HashingStorage intersectSameType(EconomicMapStorage self, EconomicMapStor
489
488
LoopNode .reportLoopCount (thisLib , size );
490
489
while (loopProfile .inject (advance (cursor ))) {
491
490
if (getNode .get (state , other .map , getDictKey (cursor )) != null ) {
492
- result . map . put (frame , getDictKey (cursor ), getValue (cursor ), putProfiles );
491
+ putNode . put (state , result . map , getDictKey (cursor ), getValue (cursor ));
493
492
}
494
493
}
495
494
return result ;
@@ -498,7 +497,7 @@ static HashingStorage intersectSameType(EconomicMapStorage self, EconomicMapStor
498
497
@ Specialization
499
498
static HashingStorage intersectGeneric (EconomicMapStorage self , HashingStorage other , @ SuppressWarnings ("unused" ) ThreadState state ,
500
499
@ CachedLibrary ("self" ) HashingStorageLibrary thisLib ,
501
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles putProfiles ,
500
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
502
501
@ Shared ("selfEntriesLoop" ) @ Cached LoopConditionProfile loopProfile ,
503
502
@ Shared ("otherHLib" ) @ CachedLibrary (limit = "2" ) HashingStorageLibrary hlib ,
504
503
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
@@ -511,7 +510,7 @@ static HashingStorage intersectGeneric(EconomicMapStorage self, HashingStorage o
511
510
LoopNode .reportLoopCount (thisLib , size );
512
511
while (loopProfile .inject (advance (cursor ))) {
513
512
if (hlib .hasKey (other , getKey (cursor ))) {
514
- result . map . put (frame , getDictKey (cursor ), getValue (cursor ), putProfiles );
513
+ putNode . put (state , result . map , getDictKey (cursor ), getValue (cursor ));
515
514
}
516
515
}
517
516
return result ;
@@ -523,8 +522,8 @@ public static class DiffWithState {
523
522
@ Specialization
524
523
static HashingStorage diffSameType (EconomicMapStorage self , EconomicMapStorage other , ThreadState state ,
525
524
@ CachedLibrary ("self" ) HashingStorageLibrary thisLib ,
526
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles putProfiles ,
527
- @ Shared ("getNode" ) @ Cached ObjectHashMap .GetNode getNode ,
525
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
526
+ @ Shared ("getNode" ) @ Cached ObjectHashMap .GetNode getNode ,
528
527
@ Shared ("selfEntriesLoop" ) @ Cached LoopConditionProfile loopProfile ,
529
528
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
530
529
EconomicMapStorage result = EconomicMapStorage .create ();
@@ -536,7 +535,7 @@ static HashingStorage diffSameType(EconomicMapStorage self, EconomicMapStorage o
536
535
LoopNode .reportLoopCount (thisLib , size );
537
536
while (loopProfile .inject (advance (cursor ))) {
538
537
if (getNode .get (state , other .map , getDictKey (cursor )) == null ) {
539
- result . map . put (frame , getDictKey (cursor ), getValue (cursor ), putProfiles );
538
+ putNode . put (state , result . map , getDictKey (cursor ), getValue (cursor ));
540
539
}
541
540
}
542
541
return result ;
@@ -545,7 +544,7 @@ static HashingStorage diffSameType(EconomicMapStorage self, EconomicMapStorage o
545
544
@ Specialization
546
545
static HashingStorage diffGeneric (EconomicMapStorage self , HashingStorage other , @ SuppressWarnings ("unused" ) ThreadState state ,
547
546
@ CachedLibrary ("self" ) HashingStorageLibrary thisLib ,
548
- @ Shared ("putProfiles " ) @ Cached ObjectHashMap .PutProfiles profiles ,
547
+ @ Shared ("putNode " ) @ Cached ObjectHashMap .PutNode putNode ,
549
548
@ Shared ("selfEntriesLoop" ) @ Cached LoopConditionProfile loopProfile ,
550
549
@ Shared ("otherHLib" ) @ CachedLibrary (limit = "2" ) HashingStorageLibrary hlib ,
551
550
@ Shared ("gotState" ) @ Cached ConditionProfile gotState ) {
@@ -558,7 +557,7 @@ static HashingStorage diffGeneric(EconomicMapStorage self, HashingStorage other,
558
557
LoopNode .reportLoopCount (thisLib , size );
559
558
while (loopProfile .profile (advance (cursor ))) {
560
559
if (!hlib .hasKey (other , getKey (cursor ))) {
561
- result . map . put (frame , getDictKey (cursor ), getValue (cursor ), profiles );
560
+ putNode . put (state , result . map , getDictKey (cursor ), getValue (cursor ));
562
561
}
563
562
}
564
563
return result ;
0 commit comments