Skip to content
Snippets Groups Projects
Commit 5072fa56 authored by stepan's avatar stepan
Browse files

Convert graphics related nodes to new casts system

parent 37d7c17a
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
*/
package com.oracle.truffle.r.nodes.builtin.base;
import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.instanceOf;
import static com.oracle.truffle.r.runtime.builtins.RBehavior.COMPLEX;
import static com.oracle.truffle.r.runtime.builtins.RBuiltinKind.INTERNAL;
......@@ -53,6 +54,13 @@ public abstract class RecordGraphics extends RBuiltinNode {
@Child private SetVisibilityNode visibility = SetVisibilityNode.create();
@Child private RList2EnvNode list2EnvNode = new RList2EnvNode();
static {
Casts casts = new Casts(RecordGraphics.class);
casts.arg("expr").mustBe(instanceOf(RLanguage.class).or(instanceOf(RExpression.class)));
casts.arg("list").mustBe(instanceOf(RList.class));
casts.arg("env").mustBe(instanceOf(REnvironment.class));
}
public static RecordGraphics create() {
return RecordGraphicsNodeGen.create();
}
......
......@@ -911,6 +911,10 @@ public class CallAndExternalFunctions {
private final BranchProfile errorProfile = BranchProfile.create();
static {
Casts.noCasts(DotExternalGraphics.class);
}
@Override
@TruffleBoundary
protected RExternalBuiltinNode lookupBuiltin(RList f) {
......@@ -970,6 +974,10 @@ public class CallAndExternalFunctions {
private final BranchProfile errorProfile = BranchProfile.create();
static {
Casts.noCasts(DotCallGraphics.class);
}
@Override
public Object[] getDefaultParameterValues() {
return new Object[]{RMissing.instance, RArgsValuesAndNames.EMPTY, RMissing.instance};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment