diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/IntersectFastPath.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/IntersectFastPath.java index 1761d786f2f7355c2c5b2fdb6d412130bf377275..f0f89021ec90b82d1f0b0281507438a598bf3852 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/IntersectFastPath.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/IntersectFastPath.java @@ -27,6 +27,7 @@ import java.util.Arrays; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.Fallback; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.nodes.Node; import com.oracle.truffle.api.nodes.NodeCost; @@ -38,8 +39,6 @@ import com.oracle.truffle.r.runtime.nodes.RFastPathNode; public abstract class IntersectFastPath extends RFastPathNode { - protected static final int TYPE_LIMIT = 2; - private static final int[] EMPTY_INT_ARRAY = new int[0]; protected static final class IntersectSortedNode extends Node { @@ -139,7 +138,7 @@ public abstract class IntersectFastPath extends RFastPathNode { return new IntersectSortedNode(false); } - @Specialization(limit = "TYPE_LIMIT", guards = {"x.getClass() == xClass", "y.getClass() == yClass", "length(x, xClass) > 0", "length(y, yClass) > 0"}, rewriteOn = IllegalArgumentException.class) + @Specialization(limit = "1", guards = {"x.getClass() == xClass", "y.getClass() == yClass", "length(x, xClass) > 0", "length(y, yClass) > 0"}, rewriteOn = IllegalArgumentException.class) protected RAbstractIntVector intersectMaybeSorted(RAbstractIntVector x, RAbstractIntVector y, @Cached("x.getClass()") Class<? extends RAbstractIntVector> xClass, @Cached("y.getClass()") Class<? extends RAbstractIntVector> yClass, @@ -160,7 +159,7 @@ public abstract class IntersectFastPath extends RFastPathNode { return new IntersectSortedNode(true); } - @Specialization(limit = "TYPE_LIMIT", guards = {"x.getClass() == xClass", "y.getClass() == yClass", "length(x, xClass) > 0", "length(y, yClass) > 0"}) + @Specialization(limit = "1", guards = {"x.getClass() == xClass", "y.getClass() == yClass", "length(x, xClass) > 0", "length(y, yClass) > 0"}) protected RAbstractIntVector intersect(RAbstractIntVector x, RAbstractIntVector y, @Cached("x.getClass()") Class<? extends RAbstractIntVector> xClass, @Cached("y.getClass()") Class<? extends RAbstractIntVector> yClass, @@ -235,4 +234,9 @@ public abstract class IntersectFastPath extends RFastPathNode { Arrays.sort(temp); } + @Fallback + protected Object fallback(@SuppressWarnings("unused") Object x, @SuppressWarnings("unused") Object y) { + return null; + } + }