Skip to content
Snippets Groups Projects
Commit 3464151a authored by Lukas Stadler's avatar Lukas Stadler
Browse files

Merge pull request #316 in G/fastr from fix_interop_regression to master

* commit '47c286f0':
  Fix slow type check for external TruffleObjects.
parents 3295a612 47c286f0
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