Skip to content

Commit d907fe0

Browse files
committed
Add trivial case IsSubtypeNode
1 parent 1088631 commit d907fe0

File tree

1 file changed

+7
-0
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/classes

1 file changed

+7
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/classes/IsSubtypeNode.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ protected PythonBuiltinClassType getType(Object cls, ConditionProfile builtinTyp
119119
}
120120
}
121121

122+
@Specialization(guards = "isSameType(isSameTypeNode, derived, cls)")
123+
static boolean isIdentical(Object derived, Object cls,
124+
@SuppressWarnings("unused") @Cached IsSameTypeNode isSameTypeNode) {
125+
// trivial case: derived == cls
126+
return true;
127+
}
128+
122129
@Specialization(guards = {
123130
"cachedDerived != null",
124131
"cachedCls != null",

0 commit comments

Comments
 (0)