Skip to content
Snippets Groups Projects
Commit 47c286f0 authored by Christian Humer's avatar Christian Humer
Browse files

Fix slow type check for external TruffleObjects.

parent bd9a010b
Branches
No related tags found
No related merge requests found
......@@ -932,12 +932,17 @@ abstract class CheckTypeNode extends RBaseNode {
return type == RType.Function || type == RType.Closure || type == RType.Builtin || type == RType.Special;
}
@Specialization(guards = "isExternalObject(o)")
boolean checkType(@SuppressWarnings("unused") TruffleObject o) {
return type == RType.Function || type == RType.Closure || type == RType.Builtin || type == RType.Special;
}
protected static boolean isExternalObject(TruffleObject o) {
return !(o instanceof RTypedValue);
}
@Fallback
boolean checkType(Object o) {
if (type == RType.Function || type == RType.Closure || type == RType.Builtin || type == RType.Special) {
return o instanceof TruffleObject && !(o instanceof RTypedValue);
} else {
return false;
}
boolean checkType(@SuppressWarnings("unused") Object o) {
return false;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment