@@ -2577,22 +2577,23 @@ private static HiddenKey createTypeKey(String name) {
2577
2577
private void addDictDescrAttribute (PythonAbstractClass [] basesArray , PythonClass pythonClass ) {
2578
2578
// Note: we need to avoid MRO lookup of __dict__ using slots because they are not
2579
2579
// initialized yet
2580
- if ((!hasPythonClassBases (basesArray ) &&
2581
- LookupAttributeInMRONode .lookupSlowPath (pythonClass , __DICT__ ) == PNone .NO_VALUE ) ||
2582
- basesHaveSlots (basesArray )) {
2583
- Builtin dictBuiltin = ObjectBuiltins .DictNode .class .getAnnotation (Builtin .class );
2580
+ if ((!hasPythonClassBases (basesArray ) && LookupAttributeInMRONode .lookupSlowPath (pythonClass , __DICT__ ) == PNone .NO_VALUE ) || basesHaveSlots (basesArray )) {
2584
2581
RootCallTarget callTarget = PythonLanguage .getCurrent ().createCachedCallTarget (
2585
- l -> new BuiltinFunctionRootNode (l , dictBuiltin , new StandaloneBuiltinFactory <PythonBinaryBuiltinNode >(DictNodeGen .create ()), true ), dictBuiltin ,
2586
- StandaloneBuiltinFactory .class );
2582
+ l -> {
2583
+ Builtin dictBuiltin = ObjectBuiltins .DictNode .class .getAnnotation (Builtin .class );
2584
+ return new BuiltinFunctionRootNode (l , dictBuiltin , new StandaloneBuiltinFactory <PythonBinaryBuiltinNode >(DictNodeGen .create ()), true );
2585
+ }, ObjectBuiltins .DictNode .class , StandaloneBuiltinFactory .class );
2587
2586
setAttribute (__DICT__ , callTarget , pythonClass );
2588
2587
}
2589
2588
}
2590
2589
2591
2590
@ TruffleBoundary
2592
2591
private void addWeakrefDescrAttribute (PythonClass pythonClass ) {
2593
- Builtin builtin = GetWeakRefsNode .class .getAnnotation (Builtin .class );
2594
2592
RootCallTarget callTarget = PythonLanguage .getCurrent ().createCachedCallTarget (
2595
- l -> new BuiltinFunctionRootNode (l , builtin , WeakRefModuleBuiltinsFactory .GetWeakRefsNodeFactory .getInstance (), true ), builtin , WeakRefModuleBuiltinsFactory .class );
2593
+ l -> {
2594
+ Builtin builtin = GetWeakRefsNode .class .getAnnotation (Builtin .class );
2595
+ return new BuiltinFunctionRootNode (l , builtin , WeakRefModuleBuiltinsFactory .GetWeakRefsNodeFactory .getInstance (), true );
2596
+ }, GetWeakRefsNode .class , WeakRefModuleBuiltinsFactory .class );
2596
2597
setAttribute (__WEAKREF__ , callTarget , pythonClass );
2597
2598
}
2598
2599
0 commit comments