Skip to content

Commit be6d1ee

Browse files
committed
TypeNode optimize doManaged specializations
1 parent 76212ca commit be6d1ee

File tree

1 file changed

+4
-6
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type

1 file changed

+4
-6
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type/TypeNodes.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -594,15 +594,13 @@ boolean doManaged(PythonBuiltinClassType left, PythonBuiltinClassType right) {
594594
}
595595

596596
@Specialization
597-
boolean doManaged(PythonBuiltinClassType left, PythonManagedClass right,
598-
@Shared("context") @CachedContext(PythonLanguage.class) PythonContext context) {
599-
return context.getCore().lookupType(left) == right;
597+
boolean doManaged(PythonBuiltinClassType left, PythonBuiltinClass right) {
598+
return left == right.getType();
600599
}
601600

602601
@Specialization
603-
boolean doManaged(PythonManagedClass left, PythonBuiltinClassType right,
604-
@Shared("context") @CachedContext(PythonLanguage.class) PythonContext context) {
605-
return left == context.getCore().lookupType(right);
602+
boolean doManaged(PythonBuiltinClass left, PythonBuiltinClassType right) {
603+
return left.getType() == right;
606604
}
607605

608606
@Specialization

0 commit comments

Comments
 (0)