From d84e520f619c67c5f2003fe3c65da3b94c010a2d Mon Sep 17 00:00:00 2001 From: Mick Jordan <mick.jordan@oracle.com> Date: Mon, 14 Mar 2016 07:50:35 -0700 Subject: [PATCH] review fixes --- .../oracle/truffle/r/nodes/builtin/base/FileFunctions.java | 7 ++----- .../src/com/oracle/truffle/r/nodes/builtin/base/Names.java | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/FileFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/FileFunctions.java index 228a77e564..d435101253 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/FileFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/FileFunctions.java @@ -215,12 +215,12 @@ public class FileFunctions { @Override protected void createCasts(CastBuilder casts) { - casts.toLogical(1); + casts.firstBoolean(1, "extra_cols"); } @Specialization @TruffleBoundary - protected RList doFileInfo(RAbstractStringVector vec, byte extraCols) { + protected RList doFileInfo(RAbstractStringVector vec, @SuppressWarnings("unused") byte extraCols) { /* * Create a list, the elements of which are vectors of length vec.getLength() containing * the information. The R closure that called the .Internal turns the result into a @@ -234,9 +234,6 @@ public class FileFunctions { * TODO implement extras_cols=FALSE */ controlVisibility(); - if (RRuntime.isNA(extraCols)) { - throw RError.error(this, RError.Message.INVALID_ARGUMENT, "extra_cols"); - } int vecLength = vec.getLength(); Object[] data = new Object[NAMES.length]; boolean[] complete = new boolean[NAMES.length]; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Names.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Names.java index 3cf6799b22..4b577299bd 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Names.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Names.java @@ -24,6 +24,7 @@ package com.oracle.truffle.r.nodes.builtin.base; import static com.oracle.truffle.r.runtime.RBuiltinKind.*; +import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.dsl.*; import com.oracle.truffle.api.profiles.*; import com.oracle.truffle.r.nodes.builtin.*; @@ -49,6 +50,7 @@ public abstract class Names extends RBuiltinNode { } @Specialization + @TruffleBoundary protected Object getNames(REnvironment env) { controlVisibility(); return env.ls(true, null, false); -- GitLab