@@ -254,21 +254,12 @@ public PDictView items(PDict self) {
254
254
@ Builtin (name = "get" , minNumOfPositionalArgs = 2 , maxNumOfPositionalArgs = 3 )
255
255
@ GenerateNodeFactory
256
256
public abstract static class GetNode extends PythonTernaryBuiltinNode {
257
-
258
- @ Specialization (guards = "!isNoValue(defaultValue)" , limit = "1" )
257
+ @ Specialization (limit = "getCallSiteInlineCacheMaxDepth()" )
259
258
public Object doWithDefault (VirtualFrame frame , PDict self , Object key , Object defaultValue ,
260
259
@ CachedLibrary (value = "self.getDictStorage()" ) HashingStorageLibrary hlib ,
261
- @ Exclusive @ Cached ("createBinaryProfile()" ) ConditionProfile profile ) {
262
- final Object value = hlib .getItemWithFrame (self .getDictStorage (), key , profile , frame );
263
- return value != null ? value : defaultValue ;
264
- }
265
-
266
- @ Specialization (limit = "1" )
267
- public Object doNoDefault (VirtualFrame frame , PDict self , Object key , @ SuppressWarnings ("unused" ) PNone defaultValue ,
268
- @ CachedLibrary (value = "self.getDictStorage()" ) HashingStorageLibrary hlib ,
269
- @ Exclusive @ Cached ("createBinaryProfile()" ) ConditionProfile profile ) {
260
+ @ Cached ConditionProfile profile ) {
270
261
final Object value = hlib .getItemWithFrame (self .getDictStorage (), key , profile , frame );
271
- return value != null ? value : PNone .NONE ;
262
+ return value != null ? value : ( defaultValue == PNone .NO_VALUE ? PNone . NONE : defaultValue ) ;
272
263
}
273
264
}
274
265
0 commit comments