@@ -136,8 +136,11 @@ private HashingStorage.InitNode getInitNode() {
136
136
@ Specialization (guards = {"args.length == 1" , "firstArgIterable(args, lib)" , "!firstArgString(args)" })
137
137
Object doVarargs (VirtualFrame frame , PDict self , Object [] args , PKeyword [] kwargs ,
138
138
@ Cached SetDictStorageNode setStorage ,
139
- @ SuppressWarnings ("unused" ) @ CachedLibrary (limit = "1" ) PythonObjectLibrary lib ) {
140
- setStorage .execute (self , getInitNode ().execute (frame , args [0 ], kwargs ));
139
+ @ SuppressWarnings ("unused" ) @ CachedLibrary (limit = "1" ) PythonObjectLibrary lib ,
140
+ @ CachedLibrary (limit = "1" ) HashingStorageLibrary storageLib ) {
141
+ HashingStorage storage = self .getDictStorage ();
142
+ storage = storageLib .addAllToOther (getInitNode ().execute (frame , args [0 ], kwargs ), storage );
143
+ setStorage .execute (self , storage );
141
144
return PNone .NONE ;
142
145
}
143
146
@@ -155,10 +158,19 @@ static Object doString(Object self, Object[] args, PKeyword[] kwargs,
155
158
throw raise .raise (ValueError , ErrorMessages .DICT_UPDATE_SEQ_ELEM_HAS_LENGTH_2_REQUIRED , 0 , 1 );
156
159
}
157
160
158
- @ Specialization (guards = "args.length == 0" )
161
+ @ Specialization (guards = { "args.length == 0" , "kwargs.length > 0" } )
159
162
Object doKeywords (VirtualFrame frame , PDict self , @ SuppressWarnings ("unused" ) Object [] args , PKeyword [] kwargs ,
160
- @ Cached SetDictStorageNode setStorage ) {
161
- setStorage .execute (self , getInitNode ().execute (frame , NO_VALUE , kwargs ));
163
+ @ Cached SetDictStorageNode setStorage ,
164
+ @ CachedLibrary (limit = "1" ) HashingStorageLibrary storageLib ) {
165
+ HashingStorage storage = self .getDictStorage ();
166
+ storage = storageLib .addAllToOther (getInitNode ().execute (frame , NO_VALUE , kwargs ), storage );
167
+ setStorage .execute (self , storage );
168
+ return PNone .NONE ;
169
+ }
170
+
171
+ @ SuppressWarnings ("unused" )
172
+ @ Specialization (guards = {"args.length == 0" , "kwargs.length == 0" })
173
+ Object doEmpty (PDict self , Object [] args , PKeyword [] kwargs ) {
162
174
return PNone .NONE ;
163
175
}
164
176
0 commit comments