|
125 | 125 | import com.oracle.truffle.api.nodes.Node; |
126 | 126 | import com.oracle.truffle.api.profiles.BranchProfile; |
127 | 127 | import com.oracle.truffle.api.profiles.InlinedConditionProfile; |
| 128 | +import com.oracle.truffle.api.profiles.InlinedIntValueProfile; |
128 | 129 | import com.oracle.truffle.api.strings.TruffleString; |
129 | 130 |
|
130 | 131 | @CoreFunctions(extendClasses = PythonBuiltinClassType.Super) |
@@ -517,6 +518,7 @@ Object get(VirtualFrame frame, SuperObject self, Object attr, |
517 | 518 | @Cached TruffleString.EqualNode equalNode, |
518 | 519 | @Cached GetObjectTypeNode getObjectType, |
519 | 520 | @Cached CastToTruffleStringChecked1Node castToTruffleStringNode, |
| 521 | + @Cached InlinedIntValueProfile mroLenProfile, |
520 | 522 | @Cached InlinedConditionProfile hasDescrGetProfile, |
521 | 523 | @Cached InlinedConditionProfile getObjectIsStartObjectProfile, |
522 | 524 | @Cached IsForeignObjectNode isForeignObjectNode, |
@@ -545,7 +547,7 @@ Object get(VirtualFrame frame, SuperObject self, Object attr, |
545 | 547 | PythonAbstractClass[] mro = getMro(startType); |
546 | 548 | /* No need to check the last one: it's gonna be skipped anyway. */ |
547 | 549 | int i = 0; |
548 | | - int n = mro.length; |
| 550 | + int n = mroLenProfile.profile(inliningTarget, mro.length); |
549 | 551 | for (i = 0; i + 1 < n; i++) { |
550 | 552 | if (isSameType(type, mro[i])) { |
551 | 553 | break; |
|
0 commit comments