@@ -442,7 +442,9 @@ Object get(VirtualFrame frame, SuperObject self, Object attr,
442
442
@ Cached GetObjectSlotsNode getSlotsNode ,
443
443
@ Cached TruffleString .EqualNode equalNode ,
444
444
@ Cached GetObjectTypeNode getObjectType ,
445
- @ Cached CastToTruffleStringCheckedNode castToTruffleStringNode ) {
445
+ @ Cached CastToTruffleStringCheckedNode castToTruffleStringNode ,
446
+ @ Cached InlinedConditionProfile hasDescrGetProfile ,
447
+ @ Cached InlinedConditionProfile getObjectIsStartObjectProfile ) {
446
448
Object startType = getObjectType .execute (inliningTarget , self );
447
449
if (startType == null ) {
448
450
return genericGetAttr (frame , self , attr );
@@ -482,7 +484,7 @@ Object get(VirtualFrame frame, SuperObject self, Object attr,
482
484
Object res = readFromDict .execute (tmp , stringAttr );
483
485
if (res != PNone .NO_VALUE ) {
484
486
TpSlots resSlots = getSlotsNode .execute (inliningTarget , res );
485
- if (resSlots .tp_descr_get () != null ) {
487
+ if (hasDescrGetProfile . profile ( inliningTarget , resSlots .tp_descr_get () != null ) ) {
486
488
/*
487
489
* Only pass 'obj' param if this is instance-mode super (See SF ID #743627)
488
490
*/
@@ -495,7 +497,13 @@ Object get(VirtualFrame frame, SuperObject self, Object attr,
495
497
CompilerDirectives .transferToInterpreterAndInvalidate ();
496
498
getObject = insert (GetObjectNodeGen .create ());
497
499
}
498
- res = callGetSlotNode .executeCached (frame , resSlots .tp_descr_get (), res , getObject .executeCached (self ) == startType ? PNone .NO_VALUE : self .getObject (), startType );
500
+ Object obj ;
501
+ if (getObjectIsStartObjectProfile .profile (inliningTarget , getObject .executeCached (self ) == startType )) {
502
+ obj = PNone .NO_VALUE ;
503
+ } else {
504
+ obj = self .getObject ();
505
+ }
506
+ res = callGetSlotNode .executeCached (frame , resSlots .tp_descr_get (), res , obj , startType );
499
507
}
500
508
return res ;
501
509
}
0 commit comments