@@ -109,8 +109,8 @@ private static PDict getGlobalsDict(VirtualFrame frame) {
109
109
110
110
@ Specialization (guards = {"getGlobals(frame) == cachedGlobals" , "isBuiltinDict(cachedGlobals, builtinProfile)" }, assumptions = "singleContextAssumption" , limit = "1" )
111
111
void writeDictBooleanCached (VirtualFrame frame , boolean value ,
112
- @ Cached ("getGlobals(frame)" ) Object cachedGlobals ,
113
- @ Cached ( "create()" ) HashingCollectionNodes .SetItemNode storeNode ) {
112
+ @ Cached (value = "getGlobals(frame)" , weak = true ) Object cachedGlobals ,
113
+ @ Cached HashingCollectionNodes .SetItemNode storeNode ) {
114
114
storeNode .execute (frame , (PDict ) cachedGlobals , attributeId , value );
115
115
}
116
116
@@ -122,49 +122,49 @@ void writeDictBoolean(VirtualFrame frame, boolean value,
122
122
123
123
@ Specialization (guards = {"getGlobals(frame) == cachedGlobals" , "isBuiltinDict(cachedGlobals, builtinProfile)" }, assumptions = "singleContextAssumption" , limit = "1" )
124
124
void writeDictIntCached (VirtualFrame frame , int value ,
125
- @ Cached ("getGlobals(frame)" ) Object cachedGlobals ,
126
- @ Cached ( "create()" ) HashingCollectionNodes .SetItemNode storeNode ) {
125
+ @ Cached (value = "getGlobals(frame)" , weak = true ) Object cachedGlobals ,
126
+ @ Cached HashingCollectionNodes .SetItemNode storeNode ) {
127
127
storeNode .execute (frame , (PDict ) cachedGlobals , attributeId , value );
128
128
}
129
129
130
130
@ Specialization (guards = "isBuiltinDict(getGlobals(frame), builtinProfile)" , replaces = "writeDictIntCached" )
131
131
void writeDictInt (VirtualFrame frame , int value ,
132
- @ Cached ( "create()" ) HashingCollectionNodes .SetItemNode storeNode ) {
132
+ @ Cached HashingCollectionNodes .SetItemNode storeNode ) {
133
133
storeNode .execute (frame , getGlobalsDict (frame ), attributeId , value );
134
134
}
135
135
136
136
@ Specialization (guards = {"getGlobals(frame) == cachedGlobals" , "isBuiltinDict(cachedGlobals, builtinProfile)" }, assumptions = "singleContextAssumption" , limit = "1" )
137
137
void writeDictLongCached (VirtualFrame frame , long value ,
138
- @ Cached ("getGlobals(frame)" ) Object cachedGlobals ,
139
- @ Cached ( "create()" ) HashingCollectionNodes .SetItemNode storeNode ) {
138
+ @ Cached (value = "getGlobals(frame)" , weak = true ) Object cachedGlobals ,
139
+ @ Cached HashingCollectionNodes .SetItemNode storeNode ) {
140
140
storeNode .execute (frame , (PDict ) cachedGlobals , attributeId , value );
141
141
}
142
142
143
143
@ Specialization (guards = "isBuiltinDict(getGlobals(frame), builtinProfile)" , replaces = "writeDictLongCached" )
144
144
void writeDictLong (VirtualFrame frame , long value ,
145
- @ Cached ( "create()" ) HashingCollectionNodes .SetItemNode storeNode ) {
145
+ @ Cached HashingCollectionNodes .SetItemNode storeNode ) {
146
146
storeNode .execute (frame , getGlobalsDict (frame ), attributeId , value );
147
147
}
148
148
149
149
@ Specialization (guards = {"getGlobals(frame) == cachedGlobals" , "isBuiltinDict(cachedGlobals, builtinProfile)" }, assumptions = "singleContextAssumption" , limit = "1" )
150
150
void writeDictDoubleCached (VirtualFrame frame , double value ,
151
- @ Cached ("getGlobals(frame)" ) Object cachedGlobals ,
152
- @ Cached ( "create()" ) HashingCollectionNodes .SetItemNode storeNode ) {
151
+ @ Cached (value = "getGlobals(frame)" , weak = true ) Object cachedGlobals ,
152
+ @ Cached HashingCollectionNodes .SetItemNode storeNode ) {
153
153
storeNode .execute (frame , (PDict ) cachedGlobals , attributeId , value );
154
154
}
155
155
156
156
@ Specialization (guards = "isBuiltinDict(getGlobals(frame), builtinProfile)" , replaces = "writeDictDoubleCached" )
157
157
void writeDictDouble (VirtualFrame frame , double value ,
158
- @ Cached ( "create()" ) HashingCollectionNodes .SetItemNode storeNode ) {
158
+ @ Cached HashingCollectionNodes .SetItemNode storeNode ) {
159
159
storeNode .execute (frame , getGlobalsDict (frame ), attributeId , value );
160
160
}
161
161
162
162
@ Specialization (replaces = {
163
163
"writeDictBooleanCached" , "writeDictBoolean" , "writeDictInt" , "writeDictIntCached" , "writeDictLong" , "writeDictLongCached" , "writeDictDouble" , "writeDictDoubleCached"
164
164
}, guards = {"getGlobals(frame) == cachedGlobals" , "isBuiltinDict(cachedGlobals, builtinProfile)" }, assumptions = "singleContextAssumption" , limit = "1" )
165
165
void writeDictObjectCached (VirtualFrame frame , Object value ,
166
- @ Cached ("getGlobals(frame)" ) Object cachedGlobals ,
167
- @ Cached ( "create()" ) HashingCollectionNodes .SetItemNode storeNode ) {
166
+ @ Cached (value = "getGlobals(frame)" , weak = true ) Object cachedGlobals ,
167
+ @ Cached HashingCollectionNodes .SetItemNode storeNode ) {
168
168
storeNode .execute (frame , (PDict ) cachedGlobals , attributeId , value );
169
169
}
170
170
@@ -173,7 +173,7 @@ void writeDictObjectCached(VirtualFrame frame, Object value,
173
173
"writeDictObjectCached"
174
174
}, guards = "isBuiltinDict(getGlobals(frame), builtinProfile)" )
175
175
void writeDictObject (VirtualFrame frame , Object value ,
176
- @ Cached ( "create()" ) HashingCollectionNodes .SetItemNode storeNode ) {
176
+ @ Cached HashingCollectionNodes .SetItemNode storeNode ) {
177
177
storeNode .execute (frame , getGlobalsDict (frame ), attributeId , value );
178
178
}
179
179
@@ -182,8 +182,8 @@ void writeDictObject(VirtualFrame frame, Object value,
182
182
"writeDictObject" , "writeDictObjectCached"
183
183
}, guards = {"getGlobals(frame) == cachedGlobals" , "isDict(cachedGlobals)" }, assumptions = "singleContextAssumption" , limit = "1" )
184
184
void writeGenericDictCached (VirtualFrame frame , Object value ,
185
- @ Cached ("getGlobals(frame)" ) Object cachedGlobals ,
186
- @ Cached ( "create()" ) SetItemNode storeNode ) {
185
+ @ Cached (value = "getGlobals(frame)" , weak = true ) Object cachedGlobals ,
186
+ @ Cached SetItemNode storeNode ) {
187
187
storeNode .executeWith (frame , cachedGlobals , attributeId , value );
188
188
}
189
189
@@ -192,13 +192,13 @@ void writeGenericDictCached(VirtualFrame frame, Object value,
192
192
"writeDictObject" , "writeDictObjectCached" , "writeGenericDictCached" ,
193
193
}, guards = "isDict(getGlobals(frame))" )
194
194
void writeGenericDict (VirtualFrame frame , Object value ,
195
- @ Cached ( "create()" ) SetItemNode storeNode ) {
195
+ @ Cached SetItemNode storeNode ) {
196
196
storeNode .executeWith (frame , PArguments .getGlobals (frame ), attributeId , value );
197
197
}
198
198
199
199
@ Specialization (guards = {"getGlobals(frame) == cachedGlobals" , "isModule(getGlobals(frame))" }, assumptions = "singleContextAssumption" , limit = "1" )
200
200
void writeModuleCached (VirtualFrame frame , Object value ,
201
- @ Cached ("getGlobals(frame)" ) Object cachedGlobals ,
201
+ @ Cached (value = "getGlobals(frame)" , weak = true ) Object cachedGlobals ,
202
202
@ Cached ("create(attributeId)" ) SetAttributeNode storeNode ) {
203
203
storeNode .executeVoid (frame , cachedGlobals , value );
204
204
}
0 commit comments