From 4c9943fc45bf3e6b6f1ef4cdfa93be10178e769d Mon Sep 17 00:00:00 2001 From: stepan <stepan.sindelar@oracle.com> Date: Tue, 10 May 2016 17:57:02 +0200 Subject: [PATCH] Removed controlVisibility calls from RBuiltins --- .../truffle/r/nodes/builtin/base/APerm.java | 2 - .../truffle/r/nodes/builtin/base/All.java | 5 - .../truffle/r/nodes/builtin/base/Any.java | 2 - .../truffle/r/nodes/builtin/base/AnyNA.java | 3 - .../truffle/r/nodes/builtin/base/Args.java | 1 - .../truffle/r/nodes/builtin/base/Array.java | 14 --- .../r/nodes/builtin/base/AsCharacter.java | 10 -- .../r/nodes/builtin/base/AsComplex.java | 8 -- .../r/nodes/builtin/base/AsDouble.java | 10 -- .../r/nodes/builtin/base/AsInteger.java | 10 -- .../r/nodes/builtin/base/AsLogical.java | 8 -- .../truffle/r/nodes/builtin/base/AsRaw.java | 10 -- .../r/nodes/builtin/base/AsVector.java | 1 - .../truffle/r/nodes/builtin/base/Assign.java | 1 - .../r/nodes/builtin/base/AttachFunctions.java | 4 - .../truffle/r/nodes/builtin/base/Attr.java | 4 - .../r/nodes/builtin/base/Attributes.java | 2 - .../builtin/base/BaseGammaFunctions.java | 2 - .../truffle/r/nodes/builtin/base/Bind.java | 2 - .../nodes/builtin/base/BitwiseFunctions.java | 8 -- .../nodes/builtin/base/BrowserFunctions.java | 5 - .../r/nodes/builtin/base/CacheClass.java | 1 - .../builtin/base/CapabilitiesFunctions.java | 1 - .../truffle/r/nodes/builtin/base/Cat.java | 2 - .../truffle/r/nodes/builtin/base/Col.java | 4 +- .../r/nodes/builtin/base/ColMeans.java | 7 -- .../truffle/r/nodes/builtin/base/ColSums.java | 4 - .../truffle/r/nodes/builtin/base/Combine.java | 2 - .../r/nodes/builtin/base/CommandArgs.java | 1 - .../truffle/r/nodes/builtin/base/Complex.java | 1 - .../builtin/base/ConditionFunctions.java | 9 -- .../builtin/base/ConnectionFunctions.java | 28 ------ .../r/nodes/builtin/base/Contributors.java | 1 - .../r/nodes/builtin/base/Crossprod.java | 4 - .../truffle/r/nodes/builtin/base/CumMax.java | 10 -- .../truffle/r/nodes/builtin/base/CumMin.java | 10 -- .../truffle/r/nodes/builtin/base/CumProd.java | 8 -- .../truffle/r/nodes/builtin/base/CumSum.java | 9 -- .../truffle/r/nodes/builtin/base/DPut.java | 1 - .../r/nodes/builtin/base/DebugFunctions.java | 3 - .../r/nodes/builtin/base/DelayedAssign.java | 1 - .../truffle/r/nodes/builtin/base/Deparse.java | 1 - .../truffle/r/nodes/builtin/base/Diag.java | 3 - .../truffle/r/nodes/builtin/base/Dim.java | 4 +- .../r/nodes/builtin/base/DimNames.java | 2 - .../truffle/r/nodes/builtin/base/Drop.java | 1 - .../nodes/builtin/base/DynLoadFunctions.java | 6 -- .../r/nodes/builtin/base/EnvFunctions.java | 24 ----- .../r/nodes/builtin/base/EvalFunctions.java | 1 - .../truffle/r/nodes/builtin/base/Exists.java | 3 +- .../r/nodes/builtin/base/FileFunctions.java | 15 --- .../truffle/r/nodes/builtin/base/Formals.java | 2 - .../r/nodes/builtin/base/FrameFunctions.java | 11 --- .../truffle/r/nodes/builtin/base/Gc.java | 1 - .../r/nodes/builtin/base/GetClass.java | 1 - .../r/nodes/builtin/base/GetFunctions.java | 6 -- .../r/nodes/builtin/base/GetOldClass.java | 3 - .../truffle/r/nodes/builtin/base/Getwd.java | 1 - .../r/nodes/builtin/base/GrepFunctions.java | 8 -- .../builtin/base/HiddenInternalFunctions.java | 2 - .../r/nodes/builtin/base/Identical.java | 93 ++++++------------- .../r/nodes/builtin/base/IntToBits.java | 2 - .../r/nodes/builtin/base/Interactive.java | 1 - .../r/nodes/builtin/base/Internal.java | 1 - .../r/nodes/builtin/base/Invisible.java | 1 - .../truffle/r/nodes/builtin/base/IsATTY.java | 2 - .../nodes/builtin/base/IsFiniteFunctions.java | 6 -- .../builtin/base/IsMethodsDispatchOn.java | 1 - .../truffle/r/nodes/builtin/base/IsNA.java | 16 ---- .../r/nodes/builtin/base/IsTypeFunctions.java | 46 --------- .../r/nodes/builtin/base/IsUnsorted.java | 3 - .../r/nodes/builtin/base/LaFunctions.java | 1 - .../truffle/r/nodes/builtin/base/Lapply.java | 1 - .../truffle/r/nodes/builtin/base/Length.java | 1 - .../truffle/r/nodes/builtin/base/License.java | 1 - .../r/nodes/builtin/base/ListBuiltin.java | 4 - .../nodes/builtin/base/LoadSaveFunctions.java | 2 - .../r/nodes/builtin/base/LocaleFunctions.java | 4 - .../r/nodes/builtin/base/LogFunctions.java | 5 - .../truffle/r/nodes/builtin/base/Ls.java | 1 - .../r/nodes/builtin/base/MakeUnique.java | 3 - .../truffle/r/nodes/builtin/base/Mapply.java | 1 - .../truffle/r/nodes/builtin/base/MatMult.java | 15 --- .../truffle/r/nodes/builtin/base/Match.java | 10 -- .../truffle/r/nodes/builtin/base/Matrix.java | 4 - .../truffle/r/nodes/builtin/base/Mean.java | 4 - .../truffle/r/nodes/builtin/base/Missing.java | 3 - .../truffle/r/nodes/builtin/base/NChar.java | 8 -- .../truffle/r/nodes/builtin/base/NZChar.java | 6 -- .../truffle/r/nodes/builtin/base/Names.java | 3 - .../builtin/base/NamespaceFunctions.java | 9 -- .../r/nodes/builtin/base/NormalizePath.java | 2 - .../truffle/r/nodes/builtin/base/OnExit.java | 1 - .../nodes/builtin/base/OptionsFunctions.java | 1 - .../truffle/r/nodes/builtin/base/Parse.java | 1 - .../truffle/r/nodes/builtin/base/Paste.java | 2 - .../truffle/r/nodes/builtin/base/Paste0.java | 1 - .../r/nodes/builtin/base/PathExpand.java | 2 - .../r/nodes/builtin/base/PrintFunctions.java | 3 - .../r/nodes/builtin/base/ProcTime.java | 1 - .../truffle/r/nodes/builtin/base/Prod.java | 4 - .../truffle/r/nodes/builtin/base/Quit.java | 1 - .../truffle/r/nodes/builtin/base/Quote.java | 1 - .../r/nodes/builtin/base/RNGFunctions.java | 5 - .../r/nodes/builtin/base/RVersion.java | 1 - .../r/nodes/builtin/base/ReadREnviron.java | 1 - .../r/nodes/builtin/base/RepeatInternal.java | 2 - .../r/nodes/builtin/base/RepeatLength.java | 13 --- .../truffle/r/nodes/builtin/base/Return.java | 1 - .../truffle/r/nodes/builtin/base/Rhome.java | 1 - .../truffle/r/nodes/builtin/base/Rm.java | 2 - .../truffle/r/nodes/builtin/base/Round.java | 10 -- .../truffle/r/nodes/builtin/base/Row.java | 2 - .../r/nodes/builtin/base/RowMeans.java | 7 -- .../truffle/r/nodes/builtin/base/RowSums.java | 2 - .../builtin/base/S3DispatchFunctions.java | 2 - .../truffle/r/nodes/builtin/base/Seq.java | 57 ------------ .../r/nodes/builtin/base/SeqAlong.java | 1 - .../truffle/r/nodes/builtin/base/SeqLen.java | 1 - .../builtin/base/SerializeFunctions.java | 3 - .../truffle/r/nodes/builtin/base/Setwd.java | 1 - .../r/nodes/builtin/base/ShortRowNames.java | 1 - .../truffle/r/nodes/builtin/base/Signif.java | 2 - .../r/nodes/builtin/base/SinkFunctions.java | 2 - .../truffle/r/nodes/builtin/base/Sprintf.java | 10 -- .../r/nodes/builtin/base/StandardGeneric.java | 3 - .../truffle/r/nodes/builtin/base/Stop.java | 3 +- .../r/nodes/builtin/base/Substitute.java | 3 - .../truffle/r/nodes/builtin/base/Substr.java | 4 +- .../truffle/r/nodes/builtin/base/Switch.java | 2 - .../r/nodes/builtin/base/SysFunctions.java | 16 ---- .../r/nodes/builtin/base/Tabulate.java | 1 - .../truffle/r/nodes/builtin/base/TempDir.java | 3 +- .../r/nodes/builtin/base/TempFile.java | 2 - .../r/nodes/builtin/base/ToLowerOrUpper.java | 2 - .../r/nodes/builtin/base/TraceFunctions.java | 3 - .../r/nodes/builtin/base/Transpose.java | 8 -- .../nodes/builtin/base/TrigExpFunctions.java | 7 -- .../truffle/r/nodes/builtin/base/UnClass.java | 3 - .../truffle/r/nodes/builtin/base/Unlist.java | 5 - .../r/nodes/builtin/base/UpdateAttr.java | 4 - .../nodes/builtin/base/UpdateAttributes.java | 3 - .../r/nodes/builtin/base/UpdateClass.java | 14 --- .../r/nodes/builtin/base/UpdateDim.java | 2 - .../r/nodes/builtin/base/UpdateDimNames.java | 3 - .../r/nodes/builtin/base/UpdateLength.java | 3 - .../r/nodes/builtin/base/UpdateLevels.java | 2 - .../r/nodes/builtin/base/UpdateNames.java | 1 - .../r/nodes/builtin/base/UpdateOldClass.java | 3 - .../nodes/builtin/base/UpdateStorageMode.java | 2 - .../r/nodes/builtin/base/UpdateSubstr.java | 2 - .../truffle/r/nodes/builtin/base/VApply.java | 1 - .../truffle/r/nodes/builtin/base/Vector.java | 2 - .../truffle/r/nodes/builtin/base/Warning.java | 1 - .../r/nodes/builtin/base/WhichFunctions.java | 4 - .../r/nodes/builtin/base/WithVisible.java | 2 - .../r/nodes/builtin/base/foreign/DotC.java | 2 - .../base/foreign/ForeignFunctions.java | 14 --- .../builtin/fastr/FastRCallCounting.java | 2 - .../r/nodes/builtin/fastr/FastRContext.java | 12 --- .../r/nodes/builtin/fastr/FastRDebug.java | 2 - .../builtin/fastr/FastRFunctionTimer.java | 2 - .../r/nodes/builtin/fastr/FastRInspect.java | 1 - .../r/nodes/builtin/fastr/FastRInterop.java | 3 - .../nodes/builtin/fastr/FastRStackTrace.java | 1 - .../nodes/builtin/fastr/FastRSyntaxTree.java | 1 - .../r/nodes/builtin/fastr/FastRThrowIt.java | 1 - .../r/nodes/builtin/fastr/FastRTrace.java | 40 ++++---- .../r/nodes/builtin/fastr/FastRTree.java | 1 - .../truffle/r/nodes/binary/ColonNode.java | 8 -- .../r/runtime/VisibilityController.java | 15 --- 171 files changed, 58 insertions(+), 880 deletions(-) diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/APerm.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/APerm.java index 5aee6fb1f5..b52b9448e8 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/APerm.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/APerm.java @@ -52,7 +52,6 @@ public abstract class APerm extends RBuiltinNode { @Specialization protected RAbstractVector aPerm(RAbstractVector vector, @SuppressWarnings("unused") RNull permVector, byte resize) { - controlVisibility(); checkErrorConditions(vector, resize); int[] dim = vector.getDimensions(); @@ -93,7 +92,6 @@ public abstract class APerm extends RBuiltinNode { @Specialization protected RAbstractVector aPerm(RAbstractVector vector, RAbstractIntVector permVector, byte resize) { - controlVisibility(); checkErrorConditions(vector, resize); int[] dim = vector.getDimensions(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/All.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/All.java index 49d29501da..8159aeb5fa 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/All.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/All.java @@ -61,25 +61,21 @@ public abstract class All extends RBuiltinNode { @Specialization protected byte all(byte value, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); return value; } @Specialization protected byte all(RLogicalVector vector, byte naRm) { - controlVisibility(); return accumulate(vector, naRm); } @Specialization protected byte all(@SuppressWarnings("unused") RNull vector, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Specialization protected byte all(@SuppressWarnings("unused") RMissing vector, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -89,7 +85,6 @@ public abstract class All extends RBuiltinNode { CompilerDirectives.transferToInterpreterAndInvalidate(); castLogicalNode = insert(CastLogicalNodeGen.create(true, false, false)); } - controlVisibility(); Object[] argValues = args.getArguments(); for (Object argValue : argValues) { byte result; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Any.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Any.java index a95f3ab6a2..e5cb5fea4d 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Any.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Any.java @@ -68,7 +68,6 @@ public abstract class Any extends RBuiltinNode { @ExplodeLoop protected byte anyCachedLength(RArgsValuesAndNames args, byte naRm, // @Cached("args.getLength()") int cachedLength) { - controlVisibility(); boolean profiledNaRm = naRmProfile.profile(naRm != RRuntime.LOGICAL_FALSE); Object[] arguments = args.getArguments(); @@ -87,7 +86,6 @@ public abstract class Any extends RBuiltinNode { @Specialization(contains = "anyCachedLength") protected byte any(RArgsValuesAndNames args, byte naRm) { - controlVisibility(); boolean profiledNaRm = naRmProfile.profile(naRm != RRuntime.LOGICAL_FALSE); byte result = RRuntime.LOGICAL_FALSE; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AnyNA.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AnyNA.java index 509f1530af..a4cdc0b8ad 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AnyNA.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AnyNA.java @@ -53,7 +53,6 @@ public abstract class AnyNA extends RBuiltinNode { public abstract byte execute(VirtualFrame frame, Object value); private byte doScalar(boolean isNA) { - controlVisibility(); return RRuntime.asLogical(isNA); } @@ -63,7 +62,6 @@ public abstract class AnyNA extends RBuiltinNode { } private <T extends RAbstractVector> byte doVector(T vector, VectorIndexPredicate<T> predicate) { - controlVisibility(); naCheck.enable(vector); for (int i = 0; i < vector.getLength(); i++) { if (predicate.apply(vector, i)) { @@ -148,7 +146,6 @@ public abstract class AnyNA extends RBuiltinNode { @Cached("createRecursive()") AnyNA recursive, // @Cached("createClassProfile()") ValueProfile elementProfile, // @Cached("create()") RLengthNode length) { - controlVisibility(); for (int i = 0; i < list.getLength(); i++) { Object value = elementProfile.profile(list.getDataAt(i)); if (length.executeInteger(frame, value) == 1) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Args.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Args.java index 4f906479ec..0a85d197b7 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Args.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Args.java @@ -77,7 +77,6 @@ public abstract class Args extends RBuiltinNode { @Specialization @TruffleBoundary protected Object args(RFunction fun) { - controlVisibility(); if (fun.isBuiltin()) { return RNull.instance; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Array.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Array.java index 43d564c671..b8e87f2572 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Array.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Array.java @@ -107,7 +107,6 @@ public abstract class Array extends RBuiltinNode { @Specialization protected RIntVector doArrayNoDimNames(RAbstractIntVector vec, RAbstractIntVector dim, @SuppressWarnings("unused") RNull dimnames) { - controlVisibility(); return doArrayInt(vec, dim); } @@ -115,7 +114,6 @@ public abstract class Array extends RBuiltinNode { protected RIntVector doArray(RAbstractIntVector vec, RAbstractIntVector dim, RList dimnames) { RIntVector ret = doArrayInt(vec, dim); updateDimNames(ret, dimnames); - controlVisibility(); return ret; } @@ -131,7 +129,6 @@ public abstract class Array extends RBuiltinNode { @Specialization protected RDoubleVector doArrayNoDimNames(RAbstractDoubleVector vec, RAbstractIntVector dim, @SuppressWarnings("unused") RNull dimnames) { - controlVisibility(); return doArrayDouble(vec, dim); } @@ -139,7 +136,6 @@ public abstract class Array extends RBuiltinNode { protected RDoubleVector doArray(RAbstractDoubleVector vec, RAbstractIntVector dim, RList dimnames) { RDoubleVector ret = doArrayDouble(vec, dim); updateDimNames(ret, dimnames); - controlVisibility(); return ret; } @@ -155,7 +151,6 @@ public abstract class Array extends RBuiltinNode { @Specialization protected RLogicalVector doArrayNoDimNames(RAbstractLogicalVector vec, RAbstractIntVector dim, @SuppressWarnings("unused") RNull dimnames) { - controlVisibility(); return doArrayLogical(vec, dim); } @@ -163,7 +158,6 @@ public abstract class Array extends RBuiltinNode { protected RLogicalVector doArray(RAbstractLogicalVector vec, RAbstractIntVector dim, RList dimnames) { RLogicalVector ret = doArrayLogical(vec, dim); updateDimNames(ret, dimnames); - controlVisibility(); return ret; } @@ -179,7 +173,6 @@ public abstract class Array extends RBuiltinNode { @Specialization protected RStringVector doArrayNoDimNames(RAbstractStringVector vec, RAbstractIntVector dim, @SuppressWarnings("unused") RNull dimnames) { - controlVisibility(); return doArrayString(vec, dim); } @@ -187,7 +180,6 @@ public abstract class Array extends RBuiltinNode { protected RStringVector doArray(RAbstractStringVector vec, RAbstractIntVector dim, RList dimnames) { RStringVector ret = doArrayString(vec, dim); updateDimNames(ret, dimnames); - controlVisibility(); return ret; } @@ -206,7 +198,6 @@ public abstract class Array extends RBuiltinNode { @Specialization protected RComplexVector doArrayNoDimNames(RAbstractComplexVector vec, RAbstractIntVector dim, @SuppressWarnings("unused") RNull dimnames) { - controlVisibility(); return doArrayComplex(vec, dim); } @@ -214,7 +205,6 @@ public abstract class Array extends RBuiltinNode { protected RComplexVector doArray(RAbstractComplexVector vec, RAbstractIntVector dim, RList dimnames) { RComplexVector ret = doArrayComplex(vec, dim); updateDimNames(ret, dimnames); - controlVisibility(); return ret; } @@ -230,7 +220,6 @@ public abstract class Array extends RBuiltinNode { @Specialization protected RRawVector doArrayNoDimNames(RAbstractRawVector vec, RAbstractIntVector dim, @SuppressWarnings("unused") RNull dimnames) { - controlVisibility(); return doArrayRaw(vec, dim); } @@ -238,7 +227,6 @@ public abstract class Array extends RBuiltinNode { protected RRawVector doArray(RAbstractRawVector vec, RAbstractIntVector dim, RList dimnames) { RRawVector ret = doArrayRaw(vec, dim); updateDimNames(ret, dimnames); - controlVisibility(); return ret; } @@ -254,7 +242,6 @@ public abstract class Array extends RBuiltinNode { @Specialization protected RList doArrayNoDimeNames(RList vec, RAbstractIntVector dim, @SuppressWarnings("unused") RNull dimnames) { - controlVisibility(); return doArrayList(vec, dim); } @@ -262,7 +249,6 @@ public abstract class Array extends RBuiltinNode { protected RList doArray(RList vec, RAbstractIntVector dim, RList dimnames) { RList ret = doArrayList(vec, dim); updateDimNames(ret, dimnames); - controlVisibility(); return ret; } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsCharacter.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsCharacter.java index 8d759b5728..3aff0b6e17 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsCharacter.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsCharacter.java @@ -81,56 +81,47 @@ public abstract class AsCharacter extends RBuiltinNode { @Specialization protected String doInt(int value) { - controlVisibility(); return castString(value); } @Specialization protected String doDouble(double value) { - controlVisibility(); return castString(value); } @Specialization protected String doLogical(byte value) { - controlVisibility(); return castString(value); } @Specialization protected String doRaw(RRaw value) { - controlVisibility(); initCast(); return (String) castStringNode.executeString(value); } @Specialization protected String doString(String value) { - controlVisibility(); return value; } @Specialization protected String doSymbol(RSymbol value) { - controlVisibility(); return value.getName(); } @Specialization protected RStringVector doNull(@SuppressWarnings("unused") RNull value) { - controlVisibility(); return RDataFactory.createStringVector(0); } @Specialization protected RStringVector doStringVector(RStringVector vector) { - controlVisibility(); return RDataFactory.createStringVector(vector.getDataCopy(), vector.isComplete()); } @Specialization protected RStringVector doList(RList list) { - controlVisibility(); int len = list.getLength(); boolean complete = RDataFactory.COMPLETE_VECTOR; String[] data = new String[len]; @@ -152,7 +143,6 @@ public abstract class AsCharacter extends RBuiltinNode { @Specialization(guards = "!isRList(container)") protected RStringVector doVector(RAbstractContainer container) { - controlVisibility(); return castStringVector(container); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsComplex.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsComplex.java index 23bfa6368f..6c3623f6cc 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsComplex.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsComplex.java @@ -50,53 +50,45 @@ public abstract class AsComplex extends RBuiltinNode { @Specialization protected RComplex doComplex(RComplex value) { - controlVisibility(); return value; } @Specialization protected RComplex doInt(int value) { - controlVisibility(); initCast(); return (RComplex) castComplexNode.executeComplex(value); } @Specialization protected RComplex doDouble(double value) { - controlVisibility(); initCast(); return (RComplex) castComplexNode.executeComplex(value); } @Specialization protected RComplex doLogical(byte value) { - controlVisibility(); initCast(); return (RComplex) castComplexNode.executeComplex(value); } @Specialization protected RComplex doString(String value) { - controlVisibility(); initCast(); return (RComplex) castComplexNode.executeComplex(value); } @Specialization protected RComplexVector doNull(@SuppressWarnings("unused") RNull value) { - controlVisibility(); return RDataFactory.createComplexVector(0); } @Specialization protected RComplexVector doComplexVector(RComplexVector vector) { - controlVisibility(); return RDataFactory.createComplexVector(vector.getDataCopy(), vector.isComplete()); } @Specialization protected RComplexVector doIntVector(RAbstractVector vector) { - controlVisibility(); initCast(); return (RComplexVector) castComplexNode.executeComplex(vector); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsDouble.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsDouble.java index 6cfb74ee4e..2d1259aef1 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsDouble.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsDouble.java @@ -53,65 +53,55 @@ public abstract class AsDouble extends RBuiltinNode { @Specialization protected double asDouble(double value) { - controlVisibility(); return value; } @Specialization protected double asDoubleInt(int value) { - controlVisibility(); initCast(); return (double) castDoubleNode.executeDouble(value); } @Specialization protected double asDouble(byte value) { - controlVisibility(); initCast(); return (double) castDoubleNode.executeDouble(value); } @Specialization protected double asDouble(RComplex value) { - controlVisibility(); initCast(); return (double) castDoubleNode.executeDouble(value); } @Specialization protected double asDouble(String value) { - controlVisibility(); initCast(); return (double) castDoubleNode.executeDouble(value); } @Specialization protected RDoubleVector asDouble(@SuppressWarnings("unused") RNull vector) { - controlVisibility(); return RDataFactory.createDoubleVector(0); } @Specialization protected RDoubleVector asDouble(RDoubleVector vector) { - controlVisibility(); return RDataFactory.createDoubleVector(vector.getDataCopy(), vector.isComplete()); } @Specialization protected RDoubleSequence asDouble(RDoubleSequence sequence) { - controlVisibility(); return sequence; } @Specialization protected RDoubleSequence asDouble(RIntSequence sequence) { - controlVisibility(); return RDataFactory.createDoubleSequence(sequence.getStart(), sequence.getStride(), sequence.getLength()); } @Specialization protected RDoubleVector asDouble(RAbstractVector vector) { - controlVisibility(); initCast(); return (RDoubleVector) castDoubleNode.executeDouble(vector); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsInteger.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsInteger.java index d1cc65badd..bedbe5a585 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsInteger.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsInteger.java @@ -54,66 +54,56 @@ public abstract class AsInteger extends RBuiltinNode { @Specialization protected int asInteger(int value) { - controlVisibility(); return value; } @Specialization protected int asInteger(double value) { - controlVisibility(); initCast(); return (int) castIntNode.executeInt(value); } @Specialization protected int asInteger(byte value) { - controlVisibility(); initCast(); return (int) castIntNode.executeInt(value); } @Specialization protected int asInteger(RComplex value) { - controlVisibility(); initCast(); return (int) castIntNode.executeInt(value); } @Specialization protected int asInteger(RRaw value) { - controlVisibility(); initCast(); return (int) castIntNode.executeInt(value); } @Specialization protected int asInteger(String value) { - controlVisibility(); initCast(); return (int) castIntNode.executeInt(value); } @Specialization protected RIntVector asInteger(@SuppressWarnings("unused") RNull value) { - controlVisibility(); return RDataFactory.createEmptyIntVector(); } @Specialization protected RIntVector asInteger(RIntVector vector) { - controlVisibility(); return RDataFactory.createIntVector(vector.getDataCopy(), vector.isComplete()); } @Specialization protected RIntVector asInteger(RIntSequence sequence) { - controlVisibility(); return (RIntVector) sequence.createVector(); } @Specialization protected RAbstractIntVector asInteger(RAbstractVector vector) { - controlVisibility(); initCast(); return (RAbstractIntVector) castIntNode.executeInt(vector); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsLogical.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsLogical.java index 0a3200dffc..65c091df97 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsLogical.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsLogical.java @@ -59,49 +59,41 @@ public abstract class AsLogical extends RBuiltinNode { @Specialization protected byte asLogical(byte value) { - controlVisibility(); return value; } @Specialization protected byte asLogical(int value) { - controlVisibility(); return castLogical(value); } @Specialization protected byte asLogical(double value) { - controlVisibility(); return castLogical(value); } @Specialization protected byte asLogical(RComplex value) { - controlVisibility(); return castLogical(value); } @Specialization protected byte asLogical(String value) { - controlVisibility(); return castLogical(value); } @Specialization protected RLogicalVector asLogical(@SuppressWarnings("unused") RNull vector) { - controlVisibility(); return RDataFactory.createLogicalVector(0); } @Specialization protected RLogicalVector asLogical(RLogicalVector vector) { - controlVisibility(); return RDataFactory.createLogicalVector(vector.getDataCopy(), vector.isComplete()); } @Specialization protected RLogicalVector asLogical(RAbstractContainer container) { - controlVisibility(); return castLogicalVector(container); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsRaw.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsRaw.java index 7ab3c9cfb4..077de464fe 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsRaw.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsRaw.java @@ -54,60 +54,51 @@ public abstract class AsRaw extends RBuiltinNode { @Specialization protected RRawVector asRaw(@SuppressWarnings("unused") RNull vector) { - controlVisibility(); return RDataFactory.createRawVector(0); } @Specialization protected RRaw asRaw(byte logical) { - controlVisibility(); initCast(); return (RRaw) castRawNode.executeRaw(logical); } @Specialization protected RRaw asRaw(int value) { - controlVisibility(); initCast(); return (RRaw) castRawNode.executeRaw(value); } @Specialization protected RRaw asRaw(double value) { - controlVisibility(); initCast(); return (RRaw) castRawNode.executeRaw(value); } @Specialization protected RRaw asRaw(RComplex value) { - controlVisibility(); initCast(); return (RRaw) castRawNode.executeRaw(value); } @Specialization protected RRaw asRaw(String value) { - controlVisibility(); initCast(); return (RRaw) castRawNode.executeRaw(value); } @Specialization protected RRaw asRaw(RRaw value) { - controlVisibility(); return value; } @Specialization protected RRawVector asRaw(RRawVector value) { - controlVisibility(); return RDataFactory.createRawVector(value.getDataCopy()); } @Specialization protected RRawVector asRaw(RList value) { - controlVisibility(); initCast(); int length = value.getLength(); RRawVector result = RDataFactory.createRawVector(length); @@ -119,7 +110,6 @@ public abstract class AsRaw extends RBuiltinNode { @Specialization protected RRawVector asRaw(RAbstractVector vector) { - controlVisibility(); initCast(); return (RRawVector) castRawNode.executeRaw(vector); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsVector.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsVector.java index 6aa16aab6f..e672553e70 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsVector.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsVector.java @@ -91,7 +91,6 @@ public abstract class AsVector extends RBuiltinNode { @Specialization protected Object asVector(VirtualFrame frame, Object x, String mode) { - controlVisibility(); RStringVector clazz = classHierarchy.execute(x); if (hasClassProfile.profile(clazz != null)) { if (useMethod == null) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Assign.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Assign.java index 92741dc79a..7c050c8a3f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Assign.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Assign.java @@ -85,7 +85,6 @@ public abstract class Assign extends RBuiltinNode { @Specialization protected Object assignInherit(RAbstractStringVector xVec, Object value, REnvironment envir, byte inherits, // @Cached("createBinaryProfile()") ConditionProfile inheritsProfile) { - controlVisibility(); String x = checkVariable(xVec); REnvironment env = envir; if (inheritsProfile.profile(inherits == RRuntime.LOGICAL_TRUE)) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AttachFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AttachFunctions.java index 88bb959a95..d36683f74e 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AttachFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AttachFunctions.java @@ -56,7 +56,6 @@ public class AttachFunctions { @Specialization @TruffleBoundary protected REnvironment doAttach(@SuppressWarnings("unused") RNull what, RAbstractIntVector pos, RAbstractStringVector name) { - controlVisibility(); REnvironment env = RDataFactory.createNewEnv(name.getDataAt(0)); doAttachEnv(pos.getDataAt(0), env); return env; @@ -65,7 +64,6 @@ public class AttachFunctions { @Specialization @TruffleBoundary protected REnvironment doAttach(REnvironment what, RAbstractIntVector pos, RAbstractStringVector name) { - controlVisibility(); REnvironment env = RDataFactory.createNewEnv(name.getDataAt(0)); RStringVector names = what.ls(true, null, false); for (int i = 0; i < names.getLength(); i++) { @@ -81,7 +79,6 @@ public class AttachFunctions { @Specialization @TruffleBoundary protected REnvironment doAttach(RList what, RAbstractIntVector pos, RAbstractStringVector name) { - controlVisibility(); REnvironment env = RDataFactory.createNewEnv(name.getDataAt(0)); RStringVector names = what.getNames(attrProfiles); for (int i = 0; i < names.getLength(); i++) { @@ -119,7 +116,6 @@ public class AttachFunctions { @Specialization @TruffleBoundary protected Object doDetach(RAbstractIntVector pos) { - controlVisibility(); try { return REnvironment.detach(pos.getDataAt(0)); } catch (DetachException ex) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Attr.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Attr.java index a9b57a7b2a..c685475df7 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Attr.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Attr.java @@ -114,7 +114,6 @@ public abstract class Attr extends RBuiltinNode { @Specialization(guards = "!isRowNamesAttr(name)") protected Object attr(RAbstractContainer container, String name) { - controlVisibility(); return attrRA(container, intern(name)); } @@ -130,7 +129,6 @@ public abstract class Attr extends RBuiltinNode { @Specialization(guards = "isRowNamesAttr(name)") protected Object attrRowNames(RAbstractContainer container, @SuppressWarnings("unused") String name) { - controlVisibility(); RAttributes attributes = container.getAttributes(); if (attributes == null) { return RNull.instance; @@ -152,7 +150,6 @@ public abstract class Attr extends RBuiltinNode { @SuppressWarnings("unused") @Specialization(guards = "!exactlyOne(name)") protected Object attrEmtpyName(RAbstractContainer container, RStringVector name) { - controlVisibility(); throw RError.error(this, RError.Message.EXACTLY_ONE_WHICH); } @@ -162,7 +159,6 @@ public abstract class Attr extends RBuiltinNode { @Fallback @TruffleBoundary protected Object attr(Object object, Object name) { - controlVisibility(); String sname = RRuntime.asString(name); if (sname == null) { throw RError.error(this, RError.Message.MUST_BE_CHARACTER, "which"); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Attributes.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Attributes.java index f40049c0be..a3ad155938 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Attributes.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Attributes.java @@ -54,7 +54,6 @@ public abstract class Attributes extends RBuiltinNode { @Specialization protected Object attributesNull(RAbstractContainer container, // @Cached("createBinaryProfile()") ConditionProfile hasAttributesProfile) { - controlVisibility(); if (hasAttributesProfile.profile(hasAttributes(container))) { return createResult(container, container instanceof RLanguage); } else { @@ -70,7 +69,6 @@ public abstract class Attributes extends RBuiltinNode { @Fallback @TruffleBoundary protected Object attributes(Object object) { - controlVisibility(); if (object instanceof RAttributable) { if (!hasAttributes((RAttributable) object)) { return RNull.instance; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BaseGammaFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BaseGammaFunctions.java index c40642105b..98ac9575c7 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BaseGammaFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BaseGammaFunctions.java @@ -79,7 +79,6 @@ public class BaseGammaFunctions { result[i] = GammaFunctions.lgammafn(xv); naValCheck.check(result[i]); } - controlVisibility(); return RDataFactory.createDoubleVector(result, naValCheck.neverSeenNA()); } @@ -123,7 +122,6 @@ public class BaseGammaFunctions { @Specialization protected RDoubleVector digamma(RAbstractDoubleVector x) { - controlVisibility(); naValCheck.enable(x); double[] result = new double[x.getLength()]; boolean warnNaN = false; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Bind.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Bind.java index 388a82fdd3..a87ca621d4 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Bind.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Bind.java @@ -409,7 +409,6 @@ public abstract class Bind extends RBaseNode { @Specialization protected Object bind(VirtualFrame frame, Object deparseLevelObj, RArgsValuesAndNames args) { - controlVisibility(); return bind.execute(frame, deparseLevelObj, args.getArguments(), (RArgsValuesAndNames) RArguments.getArgument(frame, 0), precedence(args.getArguments())); } } @@ -524,7 +523,6 @@ public abstract class Bind extends RBaseNode { @Specialization protected Object bind(VirtualFrame frame, Object deparseLevelObj, RArgsValuesAndNames args) { - controlVisibility(); return bind.execute(frame, deparseLevelObj, args.getArguments(), (RArgsValuesAndNames) RArguments.getArgument(frame, 0), precedence(args.getArguments())); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BitwiseFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BitwiseFunctions.java index 52706b6d1f..2aad58eac6 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BitwiseFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BitwiseFunctions.java @@ -174,7 +174,6 @@ public class BitwiseFunctions { @Specialization protected Object bitwAnd(RAbstractVector a, RAbstractVector b) { - controlVisibility(); return basicBit(a, b, Operation.AND); } } @@ -184,7 +183,6 @@ public class BitwiseFunctions { @Specialization protected Object bitwOr(RAbstractVector a, RAbstractVector b) { - controlVisibility(); return basicBit(a, b, Operation.OR); } } @@ -194,7 +192,6 @@ public class BitwiseFunctions { @Specialization protected Object bitwXor(RAbstractVector a, RAbstractVector b) { - controlVisibility(); return basicBit(a, b, Operation.XOR); } } @@ -204,14 +201,12 @@ public class BitwiseFunctions { @Specialization(guards = {"!shiftByCharacter(n)"}) protected Object bitwShiftR(RAbstractVector a, RAbstractVector n) { - controlVisibility(); return basicBit(a, n, Operation.SHIFTR); } @Specialization(guards = {"shiftByCharacter(n)"}) @SuppressWarnings("unused") protected Object bitwShiftRChar(RAbstractVector a, RAbstractVector n) { - controlVisibility(); checkShiftOrNot(a, Operation.SHIFTR); return makeNA(a.getLength()); } @@ -222,14 +217,12 @@ public class BitwiseFunctions { @Specialization(guards = {"!shiftByCharacter(n)"}) protected Object bitwShiftR(RAbstractVector a, RAbstractVector n) { - controlVisibility(); return basicBit(a, n, Operation.SHIFTL); } @Specialization(guards = {"shiftByCharacter(n)"}) @SuppressWarnings("unused") protected Object bitwShiftRChar(RAbstractVector a, RAbstractVector n) { - controlVisibility(); checkShiftOrNot(a, Operation.SHIFTL); return makeNA(a.getLength()); } @@ -240,7 +233,6 @@ public class BitwiseFunctions { @Specialization protected Object bitwNot(RAbstractVector a) { - controlVisibility(); checkShiftOrNot(a, Operation.NOT); return bitNot(a); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BrowserFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BrowserFunctions.java index 25a4cdaa19..976104e6de 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BrowserFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BrowserFunctions.java @@ -121,14 +121,12 @@ public class BrowserFunctions { @Specialization @TruffleBoundary protected String browserText(int n) { - controlVisibility(); return getHelperState(n).text; } @Specialization @TruffleBoundary protected String browserText(double n) { - controlVisibility(); return getHelperState((int) n).text; } } @@ -139,14 +137,12 @@ public class BrowserFunctions { @Specialization @TruffleBoundary protected Object browserCondition(int n) { - controlVisibility(); return getHelperState(n).condition; } @Specialization @TruffleBoundary protected Object browserCondition(double n) { - controlVisibility(); return getHelperState((int) n).condition; } } @@ -158,7 +154,6 @@ public class BrowserFunctions { @TruffleBoundary protected RNull browserSetDebug(@SuppressWarnings("unused") int n) { // TODO implement - controlVisibility(); return RNull.instance; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CacheClass.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CacheClass.java index 3c8ca4515b..ce2bfd638f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CacheClass.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CacheClass.java @@ -29,7 +29,6 @@ public abstract class CacheClass extends RBuiltinNode { @TruffleBoundary @Specialization protected RAbstractStringVector getClass(Object cl, RAbstractStringVector ext) { - controlVisibility(); String clString; if (cl instanceof String) { clString = (String) cl; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CapabilitiesFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CapabilitiesFunctions.java index 068e53d99c..9d9cf7ea93 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CapabilitiesFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CapabilitiesFunctions.java @@ -77,7 +77,6 @@ public class CapabilitiesFunctions { @Specialization protected RLogicalVector capabilities() { - controlVisibility(); byte[] data = new byte[NAMES.getLength()]; for (Capability c : Capability.values()) { boolean value = c.defValue; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Cat.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Cat.java index a7ce1c28d1..b8d845a5a5 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Cat.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Cat.java @@ -33,7 +33,6 @@ import com.oracle.truffle.api.dsl.Fallback; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.r.nodes.builtin.CastBuilder; import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; -import com.oracle.truffle.r.nodes.builtin.RInvisibleBuiltinNode; import com.oracle.truffle.r.nodes.unary.ToStringNode; import com.oracle.truffle.r.nodes.unary.ToStringNodeGen; import com.oracle.truffle.r.runtime.RBuiltin; @@ -215,7 +214,6 @@ public abstract class Cat extends RBuiltinNode { throw RError.error(this, RError.Message.GENERIC, ex.getMessage()); } - controlVisibility(); return RNull.instance; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Col.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Col.java index fac9d270c1..b31bbf00f3 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Col.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Col.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,6 @@ public abstract class Col extends RBuiltinNode { @Specialization protected RIntVector col(RAbstractIntVector x) { - controlVisibility(); int nrows = x.getDataAt(0); int ncols = x.getDataAt(1); int[] result = new int[nrows * ncols]; @@ -55,7 +54,6 @@ public abstract class Col extends RBuiltinNode { @Specialization @TruffleBoundary protected RIntVector col(@SuppressWarnings("unused") RNull x) { - controlVisibility(); throw RError.error(this, RError.Message.MATRIX_LIKE_REQUIRED, "col"); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ColMeans.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ColMeans.java index 3faf17382a..db30c7722f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ColMeans.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ColMeans.java @@ -40,7 +40,6 @@ public abstract class ColMeans extends RBuiltinNode { @Specialization(guards = "!isNaRm(naRm)") protected RDoubleVector colMeansNaRmFalse(RDoubleVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[colNum]; boolean isComplete = true; na.enable(x); @@ -66,7 +65,6 @@ public abstract class ColMeans extends RBuiltinNode { @Specialization(guards = "isNaRm(naRm)") protected RDoubleVector colMeansNaRmTrue(RDoubleVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[colNum]; boolean isComplete = true; na.enable(x); @@ -92,7 +90,6 @@ public abstract class ColMeans extends RBuiltinNode { @Specialization(guards = "!isNaRm(naRm)") protected RDoubleVector colMeansNaRmFalse(RLogicalVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[colNum]; na.enable(x); nextCol: for (int c = 0; c < colNum; c++) { @@ -112,7 +109,6 @@ public abstract class ColMeans extends RBuiltinNode { @Specialization(guards = "isNaRm(naRm)") protected RDoubleVector colMeansNaRmTrue(RLogicalVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[colNum]; boolean isComplete = true; na.enable(x); @@ -138,7 +134,6 @@ public abstract class ColMeans extends RBuiltinNode { @Specialization(guards = "!isNaRm(naRm)") protected RDoubleVector colMeansNaRmFalse(RIntVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[colNum]; na.enable(x); nextCol: for (int c = 0; c < colNum; c++) { @@ -158,7 +153,6 @@ public abstract class ColMeans extends RBuiltinNode { @Specialization(guards = "isNaRm(naRm)") protected RDoubleVector colMeansNaRmTrue(RIntVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[colNum]; boolean isComplete = true; na.enable(x); @@ -185,7 +179,6 @@ public abstract class ColMeans extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected RDoubleVector colMeans(RAbstractStringVector x, int rowNum, int colNum, byte naRm) { - controlVisibility(); throw RError.error(this, RError.Message.X_NUMERIC); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ColSums.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ColSums.java index 683c515be0..52c08b735e 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ColSums.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ColSums.java @@ -55,7 +55,6 @@ public abstract class ColSums extends RBuiltinNode { @Specialization protected RDoubleVector colSums(RDoubleVector x, int rowNum, int colNum, byte naRm) { - controlVisibility(); double[] result = new double[colNum]; boolean isComplete = true; final boolean rna = removeNA.profile(naRm == RRuntime.LOGICAL_TRUE); @@ -92,7 +91,6 @@ public abstract class ColSums extends RBuiltinNode { @Specialization protected RDoubleVector colSums(RLogicalVector x, int rowNum, int colNum, byte naRm) { - controlVisibility(); double[] result = new double[colNum]; boolean isComplete = true; final boolean rna = removeNA.profile(naRm == RRuntime.LOGICAL_TRUE); @@ -124,7 +122,6 @@ public abstract class ColSums extends RBuiltinNode { @Specialization protected RDoubleVector colSums(RIntVector x, int rowNum, int colNum, byte naRm) { - controlVisibility(); double[] result = new double[colNum]; boolean isComplete = true; final boolean rna = removeNA.profile(naRm == RRuntime.LOGICAL_TRUE); @@ -157,7 +154,6 @@ public abstract class ColSums extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected RDoubleVector colSums(RAbstractStringVector x, int rowNum, int colNum, byte naRm) { - controlVisibility(); throw RError.error(this, RError.Message.X_NUMERIC); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Combine.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Combine.java index ee4eaf0f8e..08105dfe95 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Combine.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Combine.java @@ -98,7 +98,6 @@ public abstract class Combine extends RBuiltinNode { @Specialization(guards = "isSimpleArguments(args)") protected Object combineSimple(RArgsValuesAndNames args) { - controlVisibility(); return args.getArgument(0); } @@ -112,7 +111,6 @@ public abstract class Combine extends RBuiltinNode { @Cached("create()") NACheck naCheck, // @Cached("create()") NACheck naNameCheck, // @Cached("createBinaryProfile()") ConditionProfile hasNamesProfile) { - controlVisibility(); CompilerAsserts.partialEvaluationConstant(cachedSignature); CompilerAsserts.partialEvaluationConstant(cachedPrecedence); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CommandArgs.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CommandArgs.java index 5761a81b70..9e784aad76 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CommandArgs.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CommandArgs.java @@ -38,7 +38,6 @@ public abstract class CommandArgs extends RBuiltinNode { @Specialization @TruffleBoundary protected RStringVector commandArgs() { - controlVisibility(); String[] s = RContext.getInstance().getOptions().getArguments(); return RDataFactory.createStringVector(s, RDataFactory.COMPLETE_VECTOR); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Complex.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Complex.java index 1b81856fd5..ce364a8e04 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Complex.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Complex.java @@ -52,7 +52,6 @@ public abstract class Complex extends RBuiltinNode { @Specialization(guards = "!resultEmpty(lengthOut, realAbsVec, imaginaryAbsVec)") protected RComplexVector complex(int lengthOut, RAbstractDoubleVector realAbsVec, RAbstractDoubleVector imaginaryAbsVec) { - controlVisibility(); RDoubleVector real = checkLength(realAbsVec); RDoubleVector imaginary = checkLength(imaginaryAbsVec); int realLength = real.getLength(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ConditionFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ConditionFunctions.java index eeb986fded..f937167235 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ConditionFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ConditionFunctions.java @@ -96,14 +96,12 @@ public class ConditionFunctions { public abstract static class AddRestart extends RestartAdapter { @Specialization protected Object addRestart(RList restart) { - controlVisibility(); RErrorHandling.addRestart(restart); return RNull.instance; } @Specialization(guards = "lengthok(restart)") protected Object addRestart(@SuppressWarnings("unused") Object restart) { - controlVisibility(); throw badRestart(); } } @@ -117,7 +115,6 @@ public class ConditionFunctions { @Specialization protected Object getRestart(int index) { - controlVisibility(); Object result = RErrorHandling.getRestart(index); return result; } @@ -127,7 +124,6 @@ public class ConditionFunctions { public abstract static class InvokeRestart extends RestartAdapter { @Specialization(guards = "lengthok(restart)") protected RNull invokeRestart(RList restart, Object args) { - controlVisibility(); if (RErrorHandling.invokeRestart(restart, args) == null) { throw RError.error(this, RError.Message.RESTART_NOT_ON_STACK); } else { @@ -138,7 +134,6 @@ public class ConditionFunctions { @SuppressWarnings("unused") @Fallback protected Object invokeRestart(Object restart, Object args) { - controlVisibility(); throw badRestart(); } } @@ -147,7 +142,6 @@ public class ConditionFunctions { public abstract static class SignalCondition extends RBuiltinNode { @Specialization protected RNull signalCondition(RList condition, RAbstractStringVector msg, Object call) { - controlVisibility(); RErrorHandling.signalCondition(condition, msg.getDataAt(0), call); return RNull.instance; } @@ -157,7 +151,6 @@ public class ConditionFunctions { public abstract static class Geterrmessage extends RBuiltinNode { @Specialization protected String geterrmessage() { - controlVisibility(); return RErrorHandling.geterrmessage(); } } @@ -176,7 +169,6 @@ public class ConditionFunctions { public abstract static class DfltWarn extends RBuiltinNode { @Specialization protected RNull dfltWarn(RAbstractStringVector msg, Object call) { - controlVisibility(); RErrorHandling.dfltWarn(msg.getDataAt(0), call); return RNull.instance; } @@ -186,7 +178,6 @@ public class ConditionFunctions { public abstract static class DfltStop extends RBuiltinNode { @Specialization protected Object dfltStop(RAbstractStringVector message, Object call) { - controlVisibility(); RErrorHandling.dfltStop(message.getDataAt(0), call); return RNull.instance; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ConnectionFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ConnectionFunctions.java index 500631d17b..ed5ba69dce 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ConnectionFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ConnectionFunctions.java @@ -96,7 +96,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected RConnection stdin() { - controlVisibility(); return getStdin(); } } @@ -106,7 +105,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected RConnection stdout() { - controlVisibility(); return getStdout(); } } @@ -116,7 +114,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected RConnection stderr() { - controlVisibility(); return getStderr(); } } @@ -127,7 +124,6 @@ public abstract class ConnectionFunctions { @TruffleBoundary @SuppressWarnings("unused") protected Object file(RAbstractStringVector description, RAbstractStringVector openVec, byte blocking, RAbstractStringVector encoding, byte raw) { - controlVisibility(); if (!RRuntime.fromLogical(blocking)) { throw RError.nyi(this, "non-blocking mode not supported"); } @@ -162,7 +158,6 @@ public abstract class ConnectionFunctions { @SuppressWarnings("unused") @Fallback protected Object file(Object description, Object open, Object blocking, Object encoding, Object raw) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_UNNAMED_ARGUMENTS); } } @@ -178,7 +173,6 @@ public abstract class ConnectionFunctions { @TruffleBoundary @SuppressWarnings("unused") protected Object gzFile(RAbstractStringVector description, RAbstractStringVector open, RAbstractStringVector encoding, double compression) { - controlVisibility(); try { return new GZIPRConnection(description.getDataAt(0), open.getDataAt(0)); } catch (ZipException ex) { @@ -204,7 +198,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected Object textConnection(RAbstractStringVector nm, RAbstractStringVector object, RAbstractStringVector open, REnvironment env, @SuppressWarnings("unused") RAbstractIntVector encoding) { - controlVisibility(); if (nm.getLength() != 1) { throw RError.error(this, RError.Message.INVALID_ARGUMENT, "description"); } @@ -228,7 +221,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected Object textConnection(RConnection conn) { - controlVisibility(); if (conn instanceof TextRConnection) { return RDataFactory.createStringVector(((TextRConnection) conn).getValue(), RDataFactory.COMPLETE_VECTOR); } else { @@ -270,7 +262,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected Object urlConnection(RAbstractStringVector url, RAbstractStringVector open, @SuppressWarnings("unused") byte blocking, @SuppressWarnings("unused") RAbstractStringVector encoding) { - controlVisibility(); try { return new URLRConnection(url.getDataAt(0), open.getDataAt(0)); } catch (MalformedURLException ex) { @@ -356,7 +347,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected RLogicalVector isOpen(RConnection con, RAbstractIntVector rw) { - controlVisibility(); BaseRConnection baseCon = getBaseConnection(con); boolean result = baseCon.isOpen(); switch (rw.getDataAt(0)) { @@ -433,7 +423,6 @@ public abstract class ConnectionFunctions { @TruffleBoundary protected Object readLines(RConnection con, int n, byte ok, byte warn, @SuppressWarnings("unused") String encoding, byte skipNul) { // TODO implement all the arguments - controlVisibility(); try (RConnection openConn = con.forceOpen("rt")) { String[] lines = openConn.readLines(n, RRuntime.fromLogical(warn), RRuntime.fromLogical(skipNul)); if (n > 0 && lines.length < n && ok == RRuntime.LOGICAL_FALSE) { @@ -454,7 +443,6 @@ public abstract class ConnectionFunctions { @SuppressWarnings("unused") @Fallback protected Object readLines(Object con, Object n, Object ok, Object warn, Object encoding, Object skipNul) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_UNNAMED_ARGUMENTS); } } @@ -476,7 +464,6 @@ public abstract class ConnectionFunctions { @SuppressWarnings("unused") @Fallback protected RNull writeLines(Object text, Object con, Object sep, Object useBytes) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_UNNAMED_ARGUMENTS); } } @@ -486,7 +473,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected RNull flush(RConnection con) { - controlVisibility(); try { con.flush(); } catch (IOException x) { @@ -507,7 +493,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected RNull pushBack(RAbstractStringVector data, RConnection connection, RAbstractLogicalVector newLine, @SuppressWarnings("unused") RAbstractIntVector type) { - controlVisibility(); if (newLine.getLength() == 0) { throw RError.error(this, RError.Message.INVALID_ARGUMENT, "newLine"); } @@ -519,7 +504,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected Object pushBack(RAbstractStringVector data, RConnection connection, RNull newLine, RAbstractIntVector type) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "newLine"); } @@ -527,7 +511,6 @@ public abstract class ConnectionFunctions { @Specialization(guards = "!newLineIsLogical(newLine)") @TruffleBoundary protected Object pushBack(RAbstractStringVector data, RConnection connection, RAbstractVector newLine, RAbstractIntVector type) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "newLine"); } @@ -535,7 +518,6 @@ public abstract class ConnectionFunctions { @Fallback @TruffleBoundary protected Object pushBack(Object data, Object connection, Object newLine, Object encoding) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_CONNECTION); } @@ -549,13 +531,11 @@ public abstract class ConnectionFunctions { @Specialization protected int pushBackLength(RConnection connection) { - controlVisibility(); return connection.pushBackLength(); } @Fallback protected Object pushBacklLength(@SuppressWarnings("unused") Object connection) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_CONNECTION); } } @@ -565,14 +545,12 @@ public abstract class ConnectionFunctions { @Specialization protected RNull pushBackClear(RConnection connection) { - controlVisibility(); connection.pushBackClear(); return RNull.instance; } @Fallback protected Object pushBackClear(@SuppressWarnings("unused") Object connection) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_CONNECTION); } } @@ -583,21 +561,18 @@ public abstract class ConnectionFunctions { @SuppressWarnings("unused") @Specialization(guards = "ncharsEmpty(nchars)") protected RStringVector readCharNcharsEmpty(RConnection con, RAbstractIntVector nchars, RAbstractLogicalVector useBytes) { - controlVisibility(); return RDataFactory.createEmptyStringVector(); } @SuppressWarnings("unused") @Specialization(guards = "useBytesEmpty(useBytes)") protected RStringVector readCharUseBytesEmpty(RConnection con, RAbstractIntVector nchars, RAbstractLogicalVector useBytes) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "useBytes"); } @Specialization(guards = {"!ncharsEmpty(nchars)", "!useBytesEmpty(useBytes)"}) @TruffleBoundary protected RStringVector readChar(RConnection con, RAbstractIntVector nchars, RAbstractLogicalVector useBytes) { - controlVisibility(); try (RConnection openConn = con.forceOpen("rb")) { String[] data = new String[nchars.getLength()]; for (int i = 0; i < data.length; i++) { @@ -623,7 +598,6 @@ public abstract class ConnectionFunctions { @TruffleBoundary @Specialization protected RNull writeChar(RAbstractStringVector object, RConnection con, RAbstractIntVector nchars, RAbstractStringVector eos, byte useBytes) { - controlVisibility(); try (RConnection openConn = con.forceOpen("wb")) { int length = object.getLength(); for (int i = 0; i < length; i++) { @@ -982,7 +956,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected RConnection getConnection(int what) { - controlVisibility(); BaseRConnection con = RContext.getInstance().stateRConnection.getConnection(what); if (con == null) { throw RError.error(this, RError.Message.NO_SUCH_CONNECTION, what); @@ -997,7 +970,6 @@ public abstract class ConnectionFunctions { @Specialization @TruffleBoundary protected RIntVector getAllConnections() { - controlVisibility(); return RContext.getInstance().stateRConnection.getAllConnections(); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Contributors.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Contributors.java index 79330a0373..ee5aa390fc 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Contributors.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Contributors.java @@ -44,7 +44,6 @@ public abstract class Contributors extends RBuiltinNode { @Specialization @TruffleBoundary protected Object contributors() { - controlVisibility(); try { StdConnections.getStdout().writeString(CONTRIBUTORS, true); } catch (IOException ex) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Crossprod.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Crossprod.java index 9b20ddde2e..1888cf82cd 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Crossprod.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Crossprod.java @@ -61,7 +61,6 @@ public abstract class Crossprod extends RBuiltinNode { @Specialization(guards = {"isMatrix(x)", "isMatrix(y)"}) protected RDoubleVector crossprod(RAbstractDoubleVector x, RAbstractDoubleVector y) { - controlVisibility(); ensureMatMult(); int xRows = x.getDimensions()[0]; int xCols = x.getDimensions()[1]; @@ -92,13 +91,11 @@ public abstract class Crossprod extends RBuiltinNode { @Specialization protected Object crossprod(RAbstractVector x, RAbstractVector y) { - controlVisibility(); return matMult(transpose(x), y); } @Specialization(guards = "isMatrix(x)") protected Object crossprodDoubleMatrix(RAbstractDoubleVector x, @SuppressWarnings("unused") RNull y) { - controlVisibility(); ensureMatMult(); int xRows = x.getDimensions()[0]; int xCols = x.getDimensions()[1]; @@ -107,7 +104,6 @@ public abstract class Crossprod extends RBuiltinNode { @Specialization protected Object crossprod(RAbstractVector x, @SuppressWarnings("unused") RNull y) { - controlVisibility(); return matMult(transpose(x), x); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumMax.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumMax.java index 5a7904ed46..55cc481f9e 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumMax.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumMax.java @@ -49,25 +49,21 @@ public abstract class CumMax extends RBuiltinNode { @Specialization protected double cummax(double arg) { - controlVisibility(); return arg; } @Specialization protected int cummax(int arg) { - controlVisibility(); return arg; } @Specialization protected Object cummax(String arg) { - controlVisibility(); return na.convertStringToDouble(arg); } @Specialization protected int cummax(byte arg) { - controlVisibility(); na.enable(arg); if (na.check(arg)) { return RRuntime.INT_NA; @@ -78,7 +74,6 @@ public abstract class CumMax extends RBuiltinNode { @Specialization protected RAbstractIntVector cummaxIntSequence(RIntSequence v, // @Cached("createBinaryProfile()") ConditionProfile negativeStrideProfile) { - controlVisibility(); if (negativeStrideProfile.profile(v.getStride() < 0)) { // all numbers are smaller than the first one return RDataFactory.createIntSequence(v.getStart(), 0, v.getLength()); @@ -89,7 +84,6 @@ public abstract class CumMax extends RBuiltinNode { @Specialization protected RDoubleVector cummax(RAbstractDoubleVector v) { - controlVisibility(); double[] cmaxV = new double[v.getLength()]; double max = v.getDataAt(0); cmaxV[0] = max; @@ -112,7 +106,6 @@ public abstract class CumMax extends RBuiltinNode { @Specialization(contains = "cummaxIntSequence") protected RIntVector cummax(RAbstractIntVector v) { - controlVisibility(); int[] cmaxV = new int[v.getLength()]; int max = v.getDataAt(0); cmaxV[0] = max; @@ -135,7 +128,6 @@ public abstract class CumMax extends RBuiltinNode { @Specialization protected RIntVector cummax(RAbstractLogicalVector v) { - controlVisibility(); int[] cmaxV = new int[v.getLength()]; int max = v.getDataAt(0); cmaxV[0] = max; @@ -158,7 +150,6 @@ public abstract class CumMax extends RBuiltinNode { @Specialization protected RDoubleVector cummax(RAbstractStringVector v) { - controlVisibility(); if (castDouble == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); castDouble = insert(CastDoubleNodeGen.create(false, false, false)); @@ -169,7 +160,6 @@ public abstract class CumMax extends RBuiltinNode { @Specialization @TruffleBoundary protected RComplexVector cummax(@SuppressWarnings("unused") RAbstractComplexVector v) { - controlVisibility(); throw RError.error(this, RError.Message.CUMMAX_UNDEFINED_FOR_COMPLEX); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumMin.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumMin.java index 1b29bd5f27..c5652b5ebf 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumMin.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumMin.java @@ -50,19 +50,16 @@ public abstract class CumMin extends RBuiltinNode { @Specialization protected double cummin(double arg) { - controlVisibility(); return arg; } @Specialization protected int cummin(int arg) { - controlVisibility(); return arg; } @Specialization protected int cummin(byte arg) { - controlVisibility(); na.enable(arg); if (na.check(arg)) { return RRuntime.INT_NA; @@ -72,14 +69,12 @@ public abstract class CumMin extends RBuiltinNode { @Specialization protected double cummin(String arg) { - controlVisibility(); return na.convertStringToDouble(arg); } @Specialization protected RAbstractIntVector cumminIntSequence(RIntSequence v, // @Cached("createBinaryProfile()") ConditionProfile negativeStrideProfile) { - controlVisibility(); if (negativeStrideProfile.profile(v.getStride() > 0)) { // all numbers are bigger than the first one return RDataFactory.createIntSequence(v.getStart(), 0, v.getLength()); @@ -90,7 +85,6 @@ public abstract class CumMin extends RBuiltinNode { @Specialization protected RDoubleVector cummin(RAbstractDoubleVector v) { - controlVisibility(); double[] cminV = new double[v.getLength()]; double min = v.getDataAt(0); cminV[0] = min; @@ -113,7 +107,6 @@ public abstract class CumMin extends RBuiltinNode { @Specialization(contains = "cumminIntSequence") protected RIntVector cummin(RAbstractIntVector v) { - controlVisibility(); int[] cminV = new int[v.getLength()]; int min = v.getDataAt(0); cminV[0] = min; @@ -136,7 +129,6 @@ public abstract class CumMin extends RBuiltinNode { @Specialization protected RIntVector cummin(RAbstractLogicalVector v) { - controlVisibility(); int[] cminV = new int[v.getLength()]; int min = v.getDataAt(0); cminV[0] = min; @@ -159,7 +151,6 @@ public abstract class CumMin extends RBuiltinNode { @Specialization protected RDoubleVector cummin(RAbstractStringVector v) { - controlVisibility(); if (castDouble == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); castDouble = insert(CastDoubleNodeGen.create(false, false, false)); @@ -170,7 +161,6 @@ public abstract class CumMin extends RBuiltinNode { @Specialization @TruffleBoundary protected RComplexVector cummin(@SuppressWarnings("unused") RAbstractComplexVector v) { - controlVisibility(); throw RError.error(this, RError.Message.CUMMIN_UNDEFINED_FOR_COMPLEX); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumProd.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumProd.java index 2c6794ebb0..c00effddff 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumProd.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumProd.java @@ -44,19 +44,16 @@ public abstract class CumProd extends RBuiltinNode { @Specialization protected int cumprod(int arg) { - controlVisibility(); return arg; } @Specialization protected double cumrpod(double arg) { - controlVisibility(); return arg; } @Specialization protected int cumprod(byte arg) { - controlVisibility(); na.enable(arg); if (na.check(arg)) { return RRuntime.INT_NA; @@ -66,7 +63,6 @@ public abstract class CumProd extends RBuiltinNode { @Specialization protected RIntVector cumprod(RAbstractIntVector arg) { - controlVisibility(); int[] array = new int[arg.getLength()]; na.enable(arg); int prev = 1; @@ -89,7 +85,6 @@ public abstract class CumProd extends RBuiltinNode { @Specialization protected RDoubleVector cumprod(RAbstractDoubleVector arg) { - controlVisibility(); double[] array = new double[arg.getLength()]; na.enable(arg); double prev = 1; @@ -112,7 +107,6 @@ public abstract class CumProd extends RBuiltinNode { @Specialization protected RIntVector cumprod(RAbstractLogicalVector arg) { - controlVisibility(); int[] array = new int[arg.getLength()]; na.enable(arg); int prev = 1; @@ -135,7 +129,6 @@ public abstract class CumProd extends RBuiltinNode { @Specialization protected RDoubleVector cumprod(RAbstractStringVector arg) { - controlVisibility(); double[] array = new double[arg.getLength()]; na.enable(arg); double prev = 1; @@ -155,7 +148,6 @@ public abstract class CumProd extends RBuiltinNode { @Specialization protected RComplexVector cumprod(RAbstractComplexVector arg) { - controlVisibility(); double[] array = new double[arg.getLength() * 2]; na.enable(arg); RComplex prev = RDataFactory.createComplex(1, 0); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumSum.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumSum.java index 3888b985cc..22c6d7aeae 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumSum.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/CumSum.java @@ -57,19 +57,16 @@ public abstract class CumSum extends RBuiltinNode { @Specialization protected double cumsum(double arg) { - controlVisibility(); return arg; } @Specialization protected int cumsum(int arg) { - controlVisibility(); return arg; } @Specialization protected int cumsum(byte arg) { - controlVisibility(); na.enable(arg); if (na.check(arg)) { return RRuntime.INT_NA; @@ -79,7 +76,6 @@ public abstract class CumSum extends RBuiltinNode { @Specialization protected RIntVector cumsum(RIntSequence arg) { - controlVisibility(); int[] res = new int[arg.getLength()]; int current = arg.getStart(); int prev = 0; @@ -101,7 +97,6 @@ public abstract class CumSum extends RBuiltinNode { @Specialization protected RDoubleVector cumsum(RAbstractDoubleVector arg) { - controlVisibility(); double[] res = new double[arg.getLength()]; double prev = 0.0; na.enable(true); @@ -121,7 +116,6 @@ public abstract class CumSum extends RBuiltinNode { @Specialization protected RIntVector cumsum(RAbstractIntVector arg) { - controlVisibility(); int[] res = new int[arg.getLength()]; int prev = 0; int i; @@ -144,7 +138,6 @@ public abstract class CumSum extends RBuiltinNode { @Specialization protected RIntVector cumsum(RAbstractLogicalVector arg) { - controlVisibility(); int[] res = new int[arg.getLength()]; int prev = 0; int i; @@ -164,7 +157,6 @@ public abstract class CumSum extends RBuiltinNode { @Specialization protected RDoubleVector cumsum(RAbstractStringVector arg) { - controlVisibility(); double[] res = new double[arg.getLength()]; double prev = 0.0; na.enable(true); @@ -185,7 +177,6 @@ public abstract class CumSum extends RBuiltinNode { @Specialization protected RComplexVector cumsum(RAbstractComplexVector arg) { - controlVisibility(); double[] res = new double[arg.getLength() * 2]; RComplex prev = RDataFactory.createComplex(0.0, 0.0); int i; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DPut.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DPut.java index a5c8923240..cac2f3f6fa 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DPut.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DPut.java @@ -50,7 +50,6 @@ public abstract class DPut extends RBuiltinNode { @Specialization @TruffleBoundary protected Object dput(Object x, RConnection file, int opts) { - controlVisibility(); String string = RDeparse.deparse(x, RDeparse.DEFAULT_Cutoff, true, opts, -1); try (RConnection openConn = file.forceOpen("wt")) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DebugFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DebugFunctions.java index 02e517b4a8..d05284297c 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DebugFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DebugFunctions.java @@ -66,7 +66,6 @@ public class DebugFunctions { @Specialization @TruffleBoundary protected RNull doDebug(RFunction fun, Object text, Object condition) { - controlVisibility(); doDebug(fun, text, condition, false); return RNull.instance; } @@ -86,7 +85,6 @@ public class DebugFunctions { @TruffleBoundary protected RNull debugonce(RFunction fun, Object text, Object condition) { // TODO implement - controlVisibility(); doDebug(fun, text, condition, true); return RNull.instance; } @@ -104,7 +102,6 @@ public class DebugFunctions { @Specialization @TruffleBoundary protected RNull undebug(RFunction func) { - controlVisibility(); if (!DebugHandling.undebug(func)) { throw RError.error(this, RError.Message.NOT_DEBUGGED); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DelayedAssign.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DelayedAssign.java index 807804c165..7e6ef1c1da 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DelayedAssign.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DelayedAssign.java @@ -43,7 +43,6 @@ public abstract class DelayedAssign extends RBuiltinNode { @Specialization protected Object doDelayedAssign(RAbstractStringVector nameVec, Object value, REnvironment evalEnv, REnvironment assignEnv) { - controlVisibility(); String name = nameVec.getDataAt(0); try { assignEnv.put(name, RDataFactory.createPromise(RASTUtils.createNodeForValue(value), evalEnv)); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Deparse.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Deparse.java index d9914efa4c..8a14c6143c 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Deparse.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Deparse.java @@ -40,7 +40,6 @@ public abstract class Deparse extends RBuiltinNode { @Specialization @TruffleBoundary protected RStringVector deparse(Object expr, int widthCutoffArg, RAbstractLogicalVector backtick, int control, int nlines) { - controlVisibility(); int widthCutoff = widthCutoffArg; if (widthCutoff == RRuntime.INT_NA || widthCutoff < RDeparse.MIN_Cutoff || widthCutoff > RDeparse.MAX_Cutoff) { RError.warning(this, RError.Message.DEPARSE_INVALID_CUTOFF); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Diag.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Diag.java index ed46a4b894..a1480bbfbf 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Diag.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Diag.java @@ -70,7 +70,6 @@ public abstract class Diag extends RBuiltinNode { @Specialization protected Object diag(@SuppressWarnings("unused") RNull x, int nrow, int ncol) { - controlVisibility(); checkParams(nrow, ncol); if (nrow == 0 && ncol == 0) { return RDataFactory.createDoubleVector(new double[]{}, true, new int[]{0, 0}); @@ -81,7 +80,6 @@ public abstract class Diag extends RBuiltinNode { @Specialization protected Object diag(RAbstractComplexVector x, int nrow, int ncol) { - controlVisibility(); checkParams(nrow, ncol); int mn = checkX(x, nrow, ncol); @@ -99,7 +97,6 @@ public abstract class Diag extends RBuiltinNode { @Specialization(guards = "!isRAbstractComplexVector(x)") protected Object diag(RAbstractVector x, int nrow, int ncol, // @Cached("create()") CastDoubleNode cast) { - controlVisibility(); checkParams(nrow, ncol); int mn = checkX(x, nrow, ncol); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Dim.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Dim.java index 5df319034c..81ec3bcbf6 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Dim.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Dim.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,6 @@ public abstract class Dim extends RBuiltinNode { @Specialization protected Object dim(RAbstractContainer container, // @Cached("createBinaryProfile()") ConditionProfile hasDimensionsProfile) { - controlVisibility(); if (hasDimensionsProfile.profile(container.hasDimensions())) { return RDataFactory.createIntVector(container.getDimensions(), RDataFactory.COMPLETE_VECTOR); } else { @@ -50,7 +49,6 @@ public abstract class Dim extends RBuiltinNode { @Specialization(guards = "!isRAbstractContainer(vector)") protected RNull dim(@SuppressWarnings("unused") Object vector) { - controlVisibility(); return RNull.instance; } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DimNames.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DimNames.java index 269a3a17a3..fa8fb47069 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DimNames.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DimNames.java @@ -42,13 +42,11 @@ public abstract class DimNames extends RBuiltinNode { @Specialization protected RNull getDimNames(@SuppressWarnings("unused") RNull operand) { - controlVisibility(); return RNull.instance; } @Specialization protected Object getDimNames(RAbstractContainer container) { - controlVisibility(); RList names = container.getDimNames(attrProfiles); return nullProfile.profile(names == null) ? RNull.instance : names; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Drop.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Drop.java index 3efa6cc572..b29da21936 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Drop.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Drop.java @@ -42,7 +42,6 @@ public abstract class Drop extends RBuiltinNode { @Specialization protected RAbstractVector doDrop(RAbstractVector x, // @Cached("createBinaryProfile()") ConditionProfile nullDimensions) { - controlVisibility(); int[] dims = x.getDimensions(); if (nullDimensions.profile(dims == null)) { return x; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DynLoadFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DynLoadFunctions.java index 106b043902..721b06ae46 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DynLoadFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DynLoadFunctions.java @@ -57,7 +57,6 @@ public class DynLoadFunctions { @Specialization @TruffleBoundary protected RList doDynLoad(RAbstractStringVector libVec, RAbstractLogicalVector localVec, byte now, @SuppressWarnings("unused") String unused) { - controlVisibility(); // Length checked by GnuR if (libVec.getLength() > 1) { throw RError.error(this, RError.Message.TYPE_EXPECTED, RType.Character.getName()); @@ -86,7 +85,6 @@ public class DynLoadFunctions { @Specialization @TruffleBoundary protected RNull doDynunload(RAbstractStringVector lib) { - controlVisibility(); try { DLL.unload(lib.getDataAt(0)); } catch (DLLException ex) { @@ -101,7 +99,6 @@ public class DynLoadFunctions { @Specialization @TruffleBoundary protected RList doGetLoadedDLLs() { - controlVisibility(); ArrayList<DLLInfo> dlls = DLL.getLoadedDLLs(); String[] names = new String[dlls.size()]; Object[] data = new Object[names.length]; @@ -122,7 +119,6 @@ public class DynLoadFunctions { @Specialization @TruffleBoundary protected byte isLoaded(RAbstractStringVector symbol, RAbstractStringVector packageName, RAbstractStringVector typeVec) { - controlVisibility(); String type = typeVec.getDataAt(0); NativeSymbolType nst = null; switch (type) { @@ -152,7 +148,6 @@ public class DynLoadFunctions { @Specialization @TruffleBoundary protected Object getSymbolInfo(RAbstractStringVector symbolVec, String packageName, byte withReg) { - controlVisibility(); String symbol = symbolVec.getDataAt(0); DLL.RegisteredNativeSymbol rns = DLL.RegisteredNativeSymbol.any(); long f = DLL.findSymbol(RRuntime.asString(symbol), packageName, rns); @@ -166,7 +161,6 @@ public class DynLoadFunctions { @Specialization(guards = "isDLLInfo(externalPtr)") @TruffleBoundary protected Object getSymbolInfo(RAbstractStringVector symbolVec, RExternalPtr externalPtr, byte withReg) { - controlVisibility(); DLL.DLLInfo dllInfo = DLL.getDLLInfoForId((int) externalPtr.getAddr()); if (dllInfo == null) { throw RError.error(this, RError.Message.REQUIRES_NAME_DLLINFO); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/EnvFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/EnvFunctions.java index c22a2dcbbc..4d1c8a39cd 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/EnvFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/EnvFunctions.java @@ -100,7 +100,6 @@ public class EnvFunctions { @Specialization protected REnvironment asEnvironment(REnvironment env) { - controlVisibility(); return env; } @@ -115,7 +114,6 @@ public class EnvFunctions { } private REnvironment asEnvironmentInt(VirtualFrame frame, int pos) { - controlVisibility(); if (pos == -1) { Frame callerFrame = Utils.getCallerFrame(frame, FrameAccess.MATERIALIZE); if (callerFrame == null) { @@ -140,7 +138,6 @@ public class EnvFunctions { @Specialization protected REnvironment asEnvironment(RAbstractStringVector nameVec) { - controlVisibility(); String name = nameVec.getDataAt(0); String[] searchPath = REnvironment.searchPath(); for (String e : searchPath) { @@ -189,7 +186,6 @@ public class EnvFunctions { @Specialization protected REnvironment emptyenv() { - controlVisibility(); return REnvironment.emptyEnv(); } } @@ -199,7 +195,6 @@ public class EnvFunctions { @Specialization protected Object globalenv() { - controlVisibility(); return REnvironment.globalEnv(); } } @@ -212,7 +207,6 @@ public class EnvFunctions { @Specialization protected Object baseenv() { - controlVisibility(); return REnvironment.baseEnv(); } } @@ -271,7 +265,6 @@ public class EnvFunctions { @Specialization protected REnvironment parentenv(REnvironment env) { - controlVisibility(); if (env == REnvironment.emptyEnv()) { errorProfile.enter(); throw RError.error(this, RError.Message.EMPTY_NO_PARENT); @@ -286,7 +279,6 @@ public class EnvFunctions { @Specialization @TruffleBoundary protected REnvironment setParentenv(REnvironment env, REnvironment parent) { - controlVisibility(); if (env == REnvironment.emptyEnv()) { throw RError.error(this, RError.Message.CANNOT_SET_PARENT); } @@ -300,7 +292,6 @@ public class EnvFunctions { @Specialization protected byte isEnvironment(Object env) { - controlVisibility(); return env instanceof REnvironment ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE; } } @@ -312,7 +303,6 @@ public class EnvFunctions { protected Object environment(VirtualFrame frame, @SuppressWarnings("unused") RNull fun, // @Cached("new()") GetCallerFrameNode callerFrame, // @Cached("new()") PromiseDeoptimizeFrameNode deoptFrameNode) { - controlVisibility(); MaterializedFrame matFrame = callerFrame.execute(frame); deoptFrameNode.deoptimizeFrame(matFrame); return REnvironment.frameToEnvironment(matFrame); @@ -325,7 +315,6 @@ public class EnvFunctions { protected Object environment(RFunction fun, // @Cached("createBinaryProfile()") ConditionProfile noEnvProfile, // @Cached("createBinaryProfile()") ConditionProfile createProfile) { - controlVisibility(); Frame enclosing = fun.getEnclosingFrame(); if (noEnvProfile.profile(enclosing == null)) { return RNull.instance; @@ -340,14 +329,12 @@ public class EnvFunctions { @Specialization(guards = "isRFormula(formula)") protected Object environment(RLanguage formula, // @Cached("create()") RAttributeProfiles attrProfiles) { - controlVisibility(); return formula.getAttr(attrProfiles, RRuntime.DOT_ENVIRONMENT); } @Specialization(guards = {"!isRNull(fun)", "!isRFunction(fun)", "!isRFormula(fun)"}) protected Object environment(@SuppressWarnings("unused") Object fun) { // Not an error according to GnuR - controlVisibility(); return RNull.instance; } } @@ -402,13 +389,11 @@ public class EnvFunctions { @Specialization protected String environmentName(REnvironment env) { - controlVisibility(); return env.getName(); } @Specialization(guards = "!isREnvironment(env)") protected String environmentName(@SuppressWarnings("unused") Object env) { - controlVisibility(); // Not an error according to GnuR return ""; } @@ -425,7 +410,6 @@ public class EnvFunctions { @Specialization @TruffleBoundary protected REnvironment newEnv(byte hash, REnvironment parent, int size) { - controlVisibility(); REnvironment env = RDataFactory.createNewEnv(null, RRuntime.fromLogical(hash), size); RArguments.initializeEnclosingFrame(env.getFrame(), parent.getFrame()); return env; @@ -445,7 +429,6 @@ public class EnvFunctions { @Specialization protected Object lockEnvironment(REnvironment env, byte bindings) { - controlVisibility(); env.lock(bindings == RRuntime.LOGICAL_TRUE); return RNull.instance; } @@ -455,7 +438,6 @@ public class EnvFunctions { public abstract static class EnvironmentIsLocked extends RBuiltinNode { @Specialization protected Object lockEnvironment(REnvironment env) { - controlVisibility(); return RDataFactory.createLogicalVectorFromScalar(env.isLocked()); } } @@ -473,7 +455,6 @@ public class EnvFunctions { public abstract static class LockBinding extends RBuiltinNode { @Specialization protected Object lockBinding(RSymbol sym, REnvironment env) { - controlVisibility(); env.lockBinding(sym.getName()); return RNull.instance; } @@ -488,7 +469,6 @@ public class EnvFunctions { public abstract static class UnlockBinding extends RBuiltinNode { @Specialization protected RNull unlockBinding(RSymbol sym, REnvironment env) { - controlVisibility(); env.unlockBinding(sym.getName()); return RNull.instance; } @@ -503,7 +483,6 @@ public class EnvFunctions { public abstract static class BindingIsLocked extends RBuiltinNode { @Specialization protected Object bindingIsLocked(RSymbol sym, REnvironment env) { - controlVisibility(); return RDataFactory.createLogicalVectorFromScalar(env.bindingIsLocked(sym.getName())); } @@ -519,7 +498,6 @@ public class EnvFunctions { @Specialization protected Object makeActiveBinding(Object sym, Object fun, Object env) { // TODO implement - controlVisibility(); throw RError.nyi(this, "makeActiveBinding"); } } @@ -530,7 +508,6 @@ public class EnvFunctions { @Specialization protected Object bindingIsActive(Object sym, Object fun, Object env) { // TODO implement - controlVisibility(); throw RError.nyi(this, "bindingIsActive"); } } @@ -552,7 +529,6 @@ public class EnvFunctions { protected RList envToListAllNames(VirtualFrame frame, REnvironment env, RAbstractLogicalVector allNamesVec, RAbstractLogicalVector sortedVec) { // according to the docs it is expected to be slow as it creates a copy of environment // objects - controlVisibility(); boolean allNames = allNamesVec.getLength() == 0 || allNamesVec.getDataAt(0) == RRuntime.LOGICAL_FALSE ? false : true; boolean sorted = sortedVec.getLength() == 0 || sortedVec.getDataAt(0) == RRuntime.LOGICAL_FALSE ? false : true; RStringVector keys = envls(env, allNames, sorted); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/EvalFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/EvalFunctions.java index e07bb7d7a8..9fbbb769a1 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/EvalFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/EvalFunctions.java @@ -105,7 +105,6 @@ public class EvalFunctions { @Specialization protected Object doEval(VirtualFrame frame, Object expr, Object envir, REnvironment enclos, // @Cached("createCast()") EvalEnvCast envCast) { - controlVisibility(); return doEvalBody(RArguments.getDepth(frame) + 1, expr, envCast.execute(envir, enclos)); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Exists.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Exists.java index 3a8ac49920..7bf781d8d0 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Exists.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Exists.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,7 +48,6 @@ public abstract class Exists extends RBuiltinNode { @TruffleBoundary protected byte existsStringEnv(RAbstractStringVector nameVec, REnvironment env, String mode, byte inherits) { String name = nameVec.getDataAt(0); - controlVisibility(); RType modeType = typeFromMode.execute(mode); if (inherits == RRuntime.LOGICAL_FALSE) { Object obj = env.get(name); 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 ef57b8d804..f4c96efec8 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 @@ -203,7 +203,6 @@ public class FileFunctions { @Specialization @TruffleBoundary protected Object doFileCreate(RAbstractStringVector vec, byte showWarnings) { - controlVisibility(); byte[] status = new byte[vec.getLength()]; for (int i = 0; i < status.length; i++) { String path = vec.getDataAt(i); @@ -228,7 +227,6 @@ public class FileFunctions { @Fallback @TruffleBoundary protected Object doFileCreate(@SuppressWarnings("unused") Object x, @SuppressWarnings("unused") Object y) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "file"); } } @@ -266,7 +264,6 @@ public class FileFunctions { * * TODO implement extras_cols=FALSE */ - controlVisibility(); int vecLength = vec.getLength(); Object[] data = new Object[NAMES.length]; boolean[] complete = new boolean[NAMES.length]; @@ -439,14 +436,12 @@ public class FileFunctions { @Specialization @TruffleBoundary protected Object doFileLink(RAbstractStringVector vecFrom, RAbstractStringVector vecTo) { - controlVisibility(); return doFileLink(vecFrom, vecTo, false); } @Fallback @TruffleBoundary protected Object doFileLink(@SuppressWarnings("unused") Object from, @SuppressWarnings("unused") Object to) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "file"); } } @@ -456,14 +451,12 @@ public class FileFunctions { @Specialization @TruffleBoundary protected Object doFileSymLink(RAbstractStringVector vecFrom, RAbstractStringVector vecTo) { - controlVisibility(); return doFileLink(vecFrom, vecTo, true); } @Fallback @TruffleBoundary protected Object doFileSymLink(@SuppressWarnings("unused") Object from, @SuppressWarnings("unused") Object to) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "file"); } } @@ -474,7 +467,6 @@ public class FileFunctions { @Specialization @TruffleBoundary protected Object doFileRemove(RAbstractStringVector vec) { - controlVisibility(); byte[] status = new byte[vec.getLength()]; for (int i = 0; i < status.length; i++) { String path = vec.getDataAt(i); @@ -495,7 +487,6 @@ public class FileFunctions { @Fallback @TruffleBoundary protected Object doFileRemove(@SuppressWarnings("unused") Object x) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "file"); } } @@ -505,7 +496,6 @@ public class FileFunctions { @Specialization @TruffleBoundary protected Object doFileRename(RAbstractStringVector vecFrom, RAbstractStringVector vecTo) { - controlVisibility(); int len = vecFrom.getLength(); if (len != vecTo.getLength()) { throw RError.error(this, RError.Message.FROM_TO_DIFFERENT); @@ -532,7 +522,6 @@ public class FileFunctions { @Fallback @TruffleBoundary protected Object doFileRename(@SuppressWarnings("unused") Object from, @SuppressWarnings("unused") Object to) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "file"); } } @@ -543,7 +532,6 @@ public class FileFunctions { @Specialization @TruffleBoundary protected Object doFileExists(RAbstractStringVector vec) { - controlVisibility(); byte[] status = new byte[vec.getLength()]; for (int i = 0; i < status.length; i++) { String path = vec.getDataAt(i); @@ -560,7 +548,6 @@ public class FileFunctions { @Fallback protected Object doFileExists(@SuppressWarnings("unused") Object vec) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "file"); } } @@ -596,7 +583,6 @@ public class FileFunctions { } private RStringVector doListFilesBody(RAbstractStringVector vec, String patternString, byte allFilesL, byte fullNamesL, byte recursiveL, byte ignoreCaseL, byte includeDirsL, byte noDotDotL) { - controlVisibility(); boolean allFiles = RRuntime.fromLogical(allFilesL); boolean fullNames = RRuntime.fromLogical(fullNamesL); boolean recursive = RRuntime.fromLogical(recursiveL); @@ -1116,7 +1102,6 @@ public class FileFunctions { @Specialization @TruffleBoundary protected byte dirCreate(RAbstractStringVector pathVec, byte showWarnings, byte recursive, RIntVector octMode) { - controlVisibility(); boolean ok = true; if (pathVec.getLength() != 1) { throw RError.error(this, RError.Message.INVALID_ARGUMENT, "path"); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Formals.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Formals.java index dc106414d9..129d5bcc6f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Formals.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Formals.java @@ -44,13 +44,11 @@ public abstract class Formals extends RBuiltinNode { protected Object formalsCached(RFunction fun, // @Cached("fun") RFunction cachedFunction, // @Cached("createFormals(fun)") Object formals) { - controlVisibility(); return formals; } @Specialization(contains = "formalsCached") protected Object formals(RFunction fun) { - controlVisibility(); return createFormals(fun); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/FrameFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/FrameFunctions.java index e5ea02653d..42a88d7a35 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/FrameFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/FrameFunctions.java @@ -191,7 +191,6 @@ public class FrameFunctions { /* * sys.call preserves provided names but does not create them, unlike match.call. */ - controlVisibility(); Frame cframe = getFrame(frame, which); if (RArguments.getFunction(cframe) == null) { return RNull.instance; @@ -240,7 +239,6 @@ public class FrameFunctions { * definition==null in the standard (default) case, in which case we get the RFunction * from the calling frame */ - controlVisibility(); RLanguage call = checkCall(callObj); if (expandDotsL == RRuntime.LOGICAL_NA) { throw RError.error(this, RError.Message.INVALID_ARGUMENT, "expand.dots"); @@ -395,7 +393,6 @@ public class FrameFunctions { @Specialization @SuppressWarnings("unused") protected RLanguage matchCall(Object definition, Object call, Object expandDots, Object envir) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_OR_UNIMPLEMENTED_ARGUMENTS); } @@ -419,7 +416,6 @@ public class FrameFunctions { public abstract static class SysNFrame extends FrameDepthHelper { @Specialization protected int sysNFrame(VirtualFrame frame) { - controlVisibility(); return getEffectiveDepth(frame) - 1; } } @@ -441,7 +437,6 @@ public class FrameFunctions { @Specialization protected REnvironment sysFrame(VirtualFrame frame, int which) { - controlVisibility(); REnvironment result; if (zeroProfile.profile(which == 0)) { result = REnvironment.globalEnv(); @@ -470,7 +465,6 @@ public class FrameFunctions { @Specialization protected Object sysFrames(VirtualFrame frame) { - controlVisibility(); int depth = getEffectiveDepth(frame); if (depth == 1) { return RNull.instance; @@ -506,7 +500,6 @@ public class FrameFunctions { @Specialization protected Object sysCalls(VirtualFrame frame) { - controlVisibility(); int depth = getEffectiveDepth(frame); if (depth == 1) { return RNull.instance; @@ -549,7 +542,6 @@ public class FrameFunctions { @Specialization protected int sysParent(VirtualFrame frame, int n) { - controlVisibility(); int p = getEffectiveDepth(frame) - n - 1; return p < 0 ? 0 : p; } @@ -572,7 +564,6 @@ public class FrameFunctions { @Specialization protected Object sysFunction(VirtualFrame frame, int which) { - controlVisibility(); // N.B. Despite the spec, n==0 is treated as the current function Frame callerFrame = getFrame(frame, which); RFunction func = RArguments.getFunction(callerFrame); @@ -599,7 +590,6 @@ public class FrameFunctions { @Specialization protected RIntVector sysParents(VirtualFrame frame) { - controlVisibility(); int d = getEffectiveDepth(frame) - 1; int[] data = new int[d]; for (int i = 0; i < d; i++) { @@ -631,7 +621,6 @@ public class FrameFunctions { @Specialization protected REnvironment parentFrame(VirtualFrame frame, int n) { - controlVisibility(); if (n <= 0) { errorProfile.enter(); throw RError.error(this, RError.Message.INVALID_VALUE, "n"); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Gc.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Gc.java index 05c1b0a03c..6de029a68e 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Gc.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Gc.java @@ -40,7 +40,6 @@ public abstract class Gc extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected RDoubleVector gc(RAbstractLogicalVector verbose, RAbstractLogicalVector reset) { - controlVisibility(); // manually triggering gc in Java is typically not a terribly good idea so we don't do it // here at all diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetClass.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetClass.java index f3e7393cf9..268d2d8dc8 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetClass.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetClass.java @@ -26,7 +26,6 @@ public abstract class GetClass extends RBuiltinNode { @Specialization protected RAbstractStringVector getClass(Object x) { - controlVisibility(); return classHierarchy.execute(x); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetFunctions.java index f69af929c4..9d91ca94ce 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetFunctions.java @@ -131,14 +131,12 @@ public class GetFunctions { @Specialization(guards = "!isInherits(inherits)") protected Object getNonInherit(VirtualFrame frame, RAbstractStringVector xv, REnvironment envir, String mode, @SuppressWarnings("unused") byte inherits) { - controlVisibility(); RType modeType = typeFromMode.execute(mode); return getAndCheck(frame, xv, envir, modeType, true); } @Specialization(guards = "isInherits(inherits)") protected Object getInherit(VirtualFrame frame, RAbstractStringVector xv, REnvironment envir, String mode, @SuppressWarnings("unused") byte inherits) { - controlVisibility(); Object result = getInherits(frame, xv, envir, mode, true); return result; } @@ -148,7 +146,6 @@ public class GetFunctions { public abstract static class Get0 extends Adapter { @Specialization(guards = "!isInherits(inherits)") protected Object get0NonInherit(VirtualFrame frame, RAbstractStringVector xv, REnvironment envir, String mode, @SuppressWarnings("unused") byte inherits, Object ifnotfound) { - controlVisibility(); RType modeType = typeFromMode.execute(mode); Object result = getAndCheck(frame, xv, envir, modeType, false); if (result == null) { @@ -159,7 +156,6 @@ public class GetFunctions { @Specialization(guards = "isInherits(inherits)") protected Object get0Inherit(VirtualFrame frame, RAbstractStringVector xv, REnvironment envir, String mode, @SuppressWarnings("unused") byte inherits, Object ifnotfound) { - controlVisibility(); Object result = getInherits(frame, xv, envir, mode, false); if (result == null) { result = ifnotfound; @@ -229,7 +225,6 @@ public class GetFunctions { @Specialization(guards = "!isInherits(inherits)") protected RList mgetNonInherit(VirtualFrame frame, RAbstractStringVector xv, REnvironment env, RAbstractStringVector mode, RList ifNotFound, @SuppressWarnings("unused") byte inherits) { - controlVisibility(); State state = checkArgs(xv, mode, ifNotFound); for (int i = 0; i < state.svLength; i++) { String x = state.checkNA(xv.getDataAt(i)); @@ -247,7 +242,6 @@ public class GetFunctions { @Specialization(guards = "isInherits(inherits)") protected RList mgetInherit(VirtualFrame frame, RAbstractStringVector xv, REnvironment envir, RAbstractStringVector mode, RList ifNotFound, @SuppressWarnings("unused") byte inherits) { - controlVisibility(); State state = checkArgs(xv, mode, ifNotFound); for (int i = 0; i < state.svLength; i++) { String x = state.checkNA(xv.getDataAt(i)); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetOldClass.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetOldClass.java index 1629ea1e36..439ae310b4 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetOldClass.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GetOldClass.java @@ -43,7 +43,6 @@ public abstract class GetOldClass extends RBuiltinNode { @Specialization protected Object getOldClass(RAbstractContainer arg) { - controlVisibility(); if (isObjectProfile.profile(arg.isObject(attrProfiles))) { return arg.getClassHierarchy(); } else { @@ -53,13 +52,11 @@ public abstract class GetOldClass extends RBuiltinNode { @Specialization protected Object getOldClass(@SuppressWarnings("unused") RFunction arg) { - controlVisibility(); return RNull.instance; } @Specialization protected Object getOldClass(@SuppressWarnings("unused") RNull arg) { - controlVisibility(); return RNull.instance; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Getwd.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Getwd.java index 3dbe064d46..511962dfb6 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Getwd.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Getwd.java @@ -37,7 +37,6 @@ public abstract class Getwd extends RBuiltinNode { @Specialization @TruffleBoundary protected Object getwd() { - controlVisibility(); String result = RFFIFactory.getRFFI().getBaseRFFI().getwd(); return RDataFactory.createStringVector(result); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GrepFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GrepFunctions.java index 9b1582f1a0..c8c6f1c527 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GrepFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/GrepFunctions.java @@ -159,7 +159,6 @@ public class GrepFunctions { private abstract static class GrepAdapter extends CommonCodeAdapter { protected Object doGrep(RAbstractStringVector patternArgVec, RAbstractStringVector vector, byte ignoreCaseLogical, byte valueLogical, byte perlLogical, byte fixedLogical, @SuppressWarnings("unused") byte useBytes, byte invertLogical, boolean grepl) { - controlVisibility(); boolean value = RRuntime.fromLogical(valueLogical); boolean invert = RRuntime.fromLogical(invertLogical); boolean perl = RRuntime.fromLogical(perlLogical); @@ -547,7 +546,6 @@ public class GrepFunctions { @TruffleBoundary protected RStringVector subRegexp(RAbstractStringVector patternArgVec, RAbstractStringVector replacementVec, RAbstractStringVector x, byte ignoreCaseLogical, byte perlLogical, byte fixedLogical, byte useBytes) { - controlVisibility(); return doSub(patternArgVec, replacementVec, x, ignoreCaseLogical, perlLogical, fixedLogical, useBytes, false); } } @@ -559,7 +557,6 @@ public class GrepFunctions { @TruffleBoundary protected RStringVector gsub(RAbstractStringVector patternArgVec, RAbstractStringVector replacementVec, RAbstractStringVector x, byte ignoreCaseLogical, byte perlLogical, byte fixedLogical, byte useBytes) { - controlVisibility(); return doSub(patternArgVec, replacementVec, x, ignoreCaseLogical, perlLogical, fixedLogical, useBytes, true); } } @@ -570,7 +567,6 @@ public class GrepFunctions { @Specialization @TruffleBoundary protected Object regexp(RAbstractStringVector patternArg, RAbstractStringVector vector, byte ignoreCaseL, byte perlL, byte fixedL, byte useBytesL) { - controlVisibility(); checkExtraArgs(RRuntime.LOGICAL_FALSE, perlL, RRuntime.LOGICAL_FALSE, useBytesL, RRuntime.LOGICAL_FALSE); boolean ignoreCase = RRuntime.fromLogical(ignoreCaseL); String pattern = RegExp.checkPreDefinedClasses(patternArg.getDataAt(0)); @@ -618,7 +614,6 @@ public class GrepFunctions { @TruffleBoundary @Override protected Object regexp(RAbstractStringVector patternArg, RAbstractStringVector vector, byte ignoreCaseL, byte perlL, byte fixedL, byte useBytesL) { - controlVisibility(); checkExtraArgs(RRuntime.LOGICAL_FALSE, perlL, fixedL, useBytesL, RRuntime.LOGICAL_FALSE); boolean ignoreCase = RRuntime.fromLogical(ignoreCaseL); String pattern = RegExp.checkPreDefinedClasses(patternArg.getDataAt(0)); @@ -647,7 +642,6 @@ public class GrepFunctions { @TruffleBoundary protected Object aGrep(RAbstractStringVector patternArg, RAbstractStringVector vector, byte ignoreCase, byte value, RIntVector costs, RDoubleVector bounds, byte useBytes, byte fixed) { // TODO implement completely; this is a very basic implementation for fixed=TRUE only. - controlVisibility(); checkExtraArgs(ignoreCase, RRuntime.LOGICAL_FALSE, RRuntime.LOGICAL_FALSE, useBytes, RRuntime.LOGICAL_FALSE); valueCheck(value); checkNotImplemented(!RRuntime.fromLogical(fixed), "fixed", false); @@ -752,7 +746,6 @@ public class GrepFunctions { @TruffleBoundary protected Object aGrep(RAbstractStringVector patternArg, RAbstractStringVector vector, byte ignoreCase, RIntVector costs, RDoubleVector bounds, byte useBytes, byte fixed) { // TODO implement properly, this only supports strict equality! - controlVisibility(); checkExtraArgs(ignoreCase, RRuntime.LOGICAL_FALSE, RRuntime.LOGICAL_FALSE, useBytes, RRuntime.LOGICAL_FALSE); byte[] data = new byte[vector.getLength()]; String pattern = patternArg.getDataAt(0); @@ -771,7 +764,6 @@ public class GrepFunctions { @Specialization @TruffleBoundary protected RList split(RAbstractStringVector x, RAbstractStringVector splitArg, byte fixedLogical, byte perlLogical, @SuppressWarnings("unused") byte useBytes) { - controlVisibility(); boolean fixed = RRuntime.fromLogical(fixedLogical); boolean perl = checkPerlFixed(RRuntime.fromLogical(perlLogical), fixed); RStringVector[] result = new RStringVector[x.getLength()]; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java index f389970a5c..89d027fb88 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java @@ -102,7 +102,6 @@ public class HiddenInternalFunctions { @Specialization @TruffleBoundary protected RNull doMakeLazy(RAbstractStringVector names, RList values, RLanguage expr, REnvironment eenv, REnvironment aenv) { - controlVisibility(); initEval(); for (int i = 0; i < names.getLength(); i++) { String name = names.getDataAt(i); @@ -143,7 +142,6 @@ public class HiddenInternalFunctions { @Specialization @TruffleBoundary protected RNull importIntoEnv(REnvironment impEnv, RAbstractStringVector impNames, REnvironment expEnv, RAbstractStringVector expNames) { - controlVisibility(); int length = impNames.getLength(); if (length != expNames.getLength()) { throw RError.error(this, Message.IMP_EXP_NAMES_MATCH); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Identical.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Identical.java index da961f5fe5..9c86d76106 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Identical.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Identical.java @@ -105,45 +105,35 @@ public abstract class Identical extends RBuiltinNode { @SuppressWarnings("unused") @Specialization(guards = "isRNull(x) || isRNull(y)") protected byte doInternalIdenticalNull(Object x, Object y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return x == y ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE; } @SuppressWarnings("unused") @Specialization(guards = "isRMissing(x) || isRMissing(y)") protected byte doInternalIdenticalMissing(Object x, Object y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return x == y ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE; } @SuppressWarnings("unused") @Specialization protected byte doInternalIdentical(byte x, byte y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return x == y ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE; } @SuppressWarnings("unused") @Specialization protected byte doInternalIdentical(String x, String y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return x.equals(y) ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE; } @SuppressWarnings("unused") @Specialization protected byte doInternalIdentical(double x, double y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); boolean truth = numEq ? x == y : Double.doubleToRawLongBits(x) == Double.doubleToRawLongBits(y); return truth ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE; } @@ -177,27 +167,21 @@ public abstract class Identical extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected byte doInternalIdentical(RAbstractLogicalVector x, REnvironment y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return RRuntime.LOGICAL_FALSE; } @SuppressWarnings("unused") @Specialization protected byte doInternalIdentical(REnvironment x, RAbstractLogicalVector y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return RRuntime.LOGICAL_FALSE; } @SuppressWarnings("unused") @Specialization protected byte doInternalIdentical(REnvironment x, REnvironment y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); // reference equality for environments return x == y ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE; } @@ -205,9 +189,7 @@ public abstract class Identical extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected byte doInternalIdentical(RSymbol x, RSymbol y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); assert x.getName() == x.getName().intern() && y.getName() == y.getName().intern(); return x.getName() == y.getName() ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE; } @@ -215,9 +197,7 @@ public abstract class Identical extends RBuiltinNode { @Specialization @TruffleBoundary protected byte doInternalIdentical(RLanguage x, RLanguage y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); if (x == y) { return RRuntime.LOGICAL_TRUE; } @@ -232,17 +212,13 @@ public abstract class Identical extends RBuiltinNode { @SuppressWarnings("unused") @Specialization byte doInternalIdentical(RFunction x, RFunction y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return RRuntime.asLogical(x == y); } @Specialization(guards = "!vectorsLists(x, y)") protected byte doInternalIdenticalGeneric(RAbstractVector x, RAbstractVector y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); if (vecLengthProfile.profile(x.getLength() != y.getLength())) { return RRuntime.LOGICAL_FALSE; } else { @@ -257,9 +233,7 @@ public abstract class Identical extends RBuiltinNode { @Specialization protected byte doInternalIdenticalGeneric(RList x, RList y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); if (x.getLength() != y.getLength()) { return RRuntime.LOGICAL_FALSE; } @@ -275,35 +249,27 @@ public abstract class Identical extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected byte doInternalIdenticalGeneric(RFunction x, RAbstractContainer y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return RRuntime.LOGICAL_FALSE; } @SuppressWarnings("unused") @Specialization protected byte doInternalIdenticalGeneric(RLanguage x, RAbstractContainer y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return RRuntime.LOGICAL_FALSE; } @SuppressWarnings("unused") @Specialization protected byte doInternalIdenticalGeneric(RAbstractContainer x, RFunction y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return RRuntime.LOGICAL_FALSE; } @Specialization protected byte doInternalIdenticalGeneric(RS4Object x, RS4Object y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); if (x.isS4() != y.isS4()) { return RRuntime.LOGICAL_FALSE; } @@ -313,17 +279,13 @@ public abstract class Identical extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected byte doInternalIdenticalGeneric(RExternalPtr x, RExternalPtr y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return RRuntime.asLogical(x.getAddr() == y.getAddr()); } @Specialization protected byte doInternalIdenticalGeneric(RPairList x, RPairList y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); if (identicalRecursive(x.car(), y.car(), numEq, singleNA, attribAsSet, ignoreBytecode, ignoreEnvironment) == RRuntime.LOGICAL_FALSE) { return RRuntime.LOGICAL_FALSE; } @@ -375,18 +337,14 @@ public abstract class Identical extends RBuiltinNode { @Specialization protected byte doInternalIdenticalGeneric(RExpression x, RExpression y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); return doInternalIdenticalGeneric(x.getList(), y.getList(), numEq, singleNA, attribAsSet, ignoreBytecode, ignoreEnvironment); } @SuppressWarnings("unused") @Fallback protected byte doInternalIdenticalWrongTypes(Object x, Object y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (!recursive) { - controlVisibility(); - } + updateVisibility(); if (x.getClass() != y.getClass()) { return RRuntime.LOGICAL_FALSE; } else { @@ -394,6 +352,15 @@ public abstract class Identical extends RBuiltinNode { } } + /** + * Common visibility related code that should be invoked in each specialization. + */ + private void updateVisibility() { + // this is the original code, + // TODO: what difference did it make, why is GnuR 'identical' visibility set to 'force ON' + // if (!recursive) setVisibility() + } + protected boolean vectorsLists(RAbstractVector x, RAbstractVector y) { return x instanceof RList && y instanceof RList; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IntToBits.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IntToBits.java index 1e3d728682..9364b83fa9 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IntToBits.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IntToBits.java @@ -42,13 +42,11 @@ public abstract class IntToBits extends RBuiltinNode { @Specialization protected RAbstractRawVector intToBits(@SuppressWarnings("unused") RNull x) { - controlVisibility(); return RDataFactory.createEmptyRawVector(); } @Specialization protected RAbstractRawVector intToBits(RAbstractIntVector x) { - controlVisibility(); byte[] result = new byte[32 * x.getLength()]; int pos = 0; for (int j = 0; j < x.getLength(); j++) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Interactive.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Interactive.java index 0c102c32d7..9a70126cbe 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Interactive.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Interactive.java @@ -33,7 +33,6 @@ import com.oracle.truffle.r.runtime.context.RContext; public abstract class Interactive extends RBuiltinNode { @Specialization protected byte interactive() { - controlVisibility(); return RRuntime.asLogical(RContext.getInstance().isInteractive()); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Internal.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Internal.java index 7a587e3652..9efe984d50 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Internal.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Internal.java @@ -75,7 +75,6 @@ public abstract class Internal extends RBuiltinNode { @Specialization protected Object doInternal(VirtualFrame frame, RPromise x) { - controlVisibility(); if (builtinCallNode == null) { RNode call = (RNode) x.getRep(); RNode operand = (RNode) RASTUtils.unwrap(call); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Invisible.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Invisible.java index b6cd29f07b..f4aa641168 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Invisible.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Invisible.java @@ -40,7 +40,6 @@ public abstract class Invisible extends RBuiltinNode { @Specialization protected Object doInvisible(Object o) { - controlVisibility(); return o; } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsATTY.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsATTY.java index bd5de1cf15..6e0ce9cde5 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsATTY.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsATTY.java @@ -37,13 +37,11 @@ public abstract class IsATTY extends RBuiltinNode { @Specialization protected byte isATTY(RConnection con) { - controlVisibility(); return RRuntime.asLogical(con instanceof StdConnection); } @Specialization(guards = "!isRConnection(con)") protected byte isATTYNonConnection(Object con) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsFiniteFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsFiniteFunctions.java index 9e84c08cf0..d16c24e13b 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsFiniteFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsFiniteFunctions.java @@ -80,7 +80,6 @@ public class IsFiniteFunctions { @Fallback protected Object doIsFiniteOther(Object x) { - controlVisibility(); if (typeofNode == null) { typeofNode = insert(TypeofNodeGen.create()); } @@ -89,14 +88,12 @@ public class IsFiniteFunctions { } protected RLogicalVector doFunConstant(RAbstractVector x, byte value) { - controlVisibility(); byte[] b = new byte[x.getLength()]; Arrays.fill(b, value); return RDataFactory.createLogicalVector(b, RDataFactory.COMPLETE_VECTOR); } protected RLogicalVector doFunDouble(RAbstractDoubleVector x, DoublePredicate fun) { - controlVisibility(); byte[] b = new byte[x.getLength()]; for (int i = 0; i < b.length; i++) { b[i] = RRuntime.asLogical(fun.test(x.getDataAt(i))); @@ -105,7 +102,6 @@ public class IsFiniteFunctions { } protected RLogicalVector doFunLogical(RAbstractLogicalVector x, LogicalPredicate fun) { - controlVisibility(); byte[] b = new byte[x.getLength()]; for (int i = 0; i < b.length; i++) { b[i] = RRuntime.asLogical(fun.test(x.getDataAt(i))); @@ -114,7 +110,6 @@ public class IsFiniteFunctions { } protected RLogicalVector doFunInt(RAbstractIntVector x, IntPredicate fun) { - controlVisibility(); byte[] b = new byte[x.getLength()]; for (int i = 0; i < b.length; i++) { b[i] = RRuntime.asLogical(fun.test(x.getDataAt(i))); @@ -123,7 +118,6 @@ public class IsFiniteFunctions { } protected RLogicalVector doFunComplex(RAbstractComplexVector x, ComplexPredicate fun) { - controlVisibility(); byte[] b = new byte[x.getLength()]; for (int i = 0; i < b.length; i++) { b[i] = RRuntime.asLogical(fun.test(x.getDataAt(i))); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsMethodsDispatchOn.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsMethodsDispatchOn.java index 570421eac2..10a33b1bb4 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsMethodsDispatchOn.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsMethodsDispatchOn.java @@ -36,7 +36,6 @@ public abstract class IsMethodsDispatchOn extends RBuiltinNode { @Specialization protected byte doIsMethodsDispatchOn() { - controlVisibility(); return RRuntime.asLogical(RContext.getInstance().isMethodTableDispatchOn()); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsNA.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsNA.java index 57df3b43b4..42461ac110 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsNA.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsNA.java @@ -66,13 +66,11 @@ public abstract class IsNA extends RBuiltinNode { @Specialization protected byte isNA(int value) { - controlVisibility(); return RRuntime.asLogical(RRuntime.isNA(value)); } @Specialization protected RLogicalVector isNA(RAbstractIntVector vector) { - controlVisibility(); byte[] resultVector = new byte[vector.getLength()]; for (int i = 0; i < vector.getLength(); i++) { resultVector[i] = RRuntime.asLogical(RRuntime.isNA(vector.getDataAt(i))); @@ -82,13 +80,11 @@ public abstract class IsNA extends RBuiltinNode { @Specialization protected byte isNA(double value) { - controlVisibility(); return RRuntime.asLogical(RRuntime.isNAorNaN(value)); } @Specialization protected RLogicalVector isNA(RAbstractDoubleVector vector) { - controlVisibility(); byte[] resultVector = new byte[vector.getLength()]; for (int i = 0; i < vector.getLength(); i++) { resultVector[i] = RRuntime.asLogical(RRuntime.isNAorNaN(vector.getDataAt(i))); @@ -98,7 +94,6 @@ public abstract class IsNA extends RBuiltinNode { @Specialization protected RLogicalVector isNA(RComplexVector vector) { - controlVisibility(); byte[] resultVector = new byte[vector.getLength()]; for (int i = 0; i < vector.getLength(); i++) { RComplex complex = vector.getDataAt(i); @@ -109,13 +104,11 @@ public abstract class IsNA extends RBuiltinNode { @Specialization protected byte isNA(String value) { - controlVisibility(); return RRuntime.asLogical(RRuntime.isNA(value)); } @Specialization protected RLogicalVector isNA(RStringVector vector) { - controlVisibility(); byte[] resultVector = new byte[vector.getLength()]; for (int i = 0; i < vector.getLength(); i++) { resultVector[i] = RRuntime.asLogical(RRuntime.isNA(vector.getDataAt(i))); @@ -125,7 +118,6 @@ public abstract class IsNA extends RBuiltinNode { @Specialization protected RLogicalVector isNA(RList list) { - controlVisibility(); byte[] resultVector = new byte[list.getLength()]; for (int i = 0; i < list.getLength(); i++) { Object result = isNARecursive(list.getDataAt(i)); @@ -152,13 +144,11 @@ public abstract class IsNA extends RBuiltinNode { @Specialization protected byte isNA(byte value) { - controlVisibility(); return RRuntime.asLogical(RRuntime.isNA(value)); } @Specialization protected RLogicalVector isNA(RLogicalVector vector) { - controlVisibility(); byte[] resultVector = new byte[vector.getLength()]; for (int i = 0; i < vector.getLength(); i++) { resultVector[i] = (RRuntime.isNA(vector.getDataAt(i)) ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE); @@ -168,19 +158,16 @@ public abstract class IsNA extends RBuiltinNode { @Specialization protected byte isNA(RComplex value) { - controlVisibility(); return RRuntime.asLogical(RRuntime.isNA(value)); } @Specialization protected byte isNA(@SuppressWarnings("unused") RRaw value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } @Specialization protected RLogicalVector isNA(RRawVector vector) { - controlVisibility(); byte[] resultVector = new byte[vector.getLength()]; for (int i = 0; i < vector.getLength(); i++) { resultVector[i] = RRuntime.LOGICAL_FALSE; @@ -190,21 +177,18 @@ public abstract class IsNA extends RBuiltinNode { @Specialization protected RLogicalVector isNA(RNull value) { - controlVisibility(); RError.warning(this, RError.Message.IS_NA_TO_NON_VECTOR, value.getRType().getName()); return RDataFactory.createEmptyLogicalVector(); } @Specialization protected byte isNA(RLanguage value) { - controlVisibility(); RError.warning(this, RError.Message.IS_NA_TO_NON_VECTOR, value.getRType().getName()); return RRuntime.LOGICAL_FALSE; } @Specialization protected byte isNA(RFunction value) { - controlVisibility(); RError.warning(this, RError.Message.IS_NA_TO_NON_VECTOR, value.getRType().getName()); return RRuntime.LOGICAL_FALSE; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsTypeFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsTypeFunctions.java index 411d3d030f..974f03a544 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsTypeFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsTypeFunctions.java @@ -77,7 +77,6 @@ public class IsTypeFunctions { @Specialization protected byte isType(RMissing value) throws RError { - controlVisibility(); throw missingError(); } } @@ -89,13 +88,11 @@ public class IsTypeFunctions { @Specialization protected byte isType(RAbstractVector vector) { - controlVisibility(); return RRuntime.asLogical(vector.isArray()); } @Specialization(guards = {"!isRMissing(value)", "!isRAbstractVector(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -105,19 +102,16 @@ public class IsTypeFunctions { @Specialization protected byte isRecursive(RNull arg) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } @Specialization(guards = "!isListVector(arg)") protected byte isRecursive(RAbstractVector arg) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } @Specialization protected byte isRecursive(RList arg) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -127,7 +121,6 @@ public class IsTypeFunctions { @Fallback protected byte isRecursiveFallback(Object value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } } @@ -139,13 +132,11 @@ public class IsTypeFunctions { @Specialization protected byte isAtomic(RNull arg) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Specialization(guards = "!isRList(arg)") protected byte isAtomic(RAbstractVector arg) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -160,7 +151,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isRNull(value)", "!isFactor(value)", "!isNonListVector(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -175,7 +165,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isRLanguage(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -185,7 +174,6 @@ public class IsTypeFunctions { @Specialization protected byte isType(RAbstractStringVector value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -195,7 +183,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isAnyCharacter(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -205,7 +192,6 @@ public class IsTypeFunctions { @Specialization protected byte isType(RAbstractComplexVector value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -215,7 +201,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isAnyComplex(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -225,7 +210,6 @@ public class IsTypeFunctions { @Specialization protected byte isType(RAbstractDoubleVector value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -235,7 +219,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isAnyDouble(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -250,7 +233,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isRExpression(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -265,7 +247,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isRFunction(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -275,7 +256,6 @@ public class IsTypeFunctions { @Specialization protected byte isType(RAbstractIntVector value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -285,7 +265,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isAnyInteger(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -309,7 +288,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isRSymbol(value)", "!isRExpression(value)", "!isRLanguage(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -323,19 +301,16 @@ public class IsTypeFunctions { @Specialization protected byte isType(RList value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Specialization protected byte isType(RPairList pl) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Specialization(guards = {"!isRMissing(value)", "!isRList(value)", "!isRPairList(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -345,7 +320,6 @@ public class IsTypeFunctions { @Specialization protected byte isType(RAbstractLogicalVector value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -355,7 +329,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isAnyLogical(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -367,13 +340,11 @@ public class IsTypeFunctions { @Specialization protected byte isType(RAbstractVector vector) { - controlVisibility(); return RRuntime.asLogical(isMatrixProfile.profile(vector.isMatrix())); } @Specialization(guards = {"!isRMissing(value)", "!isRAbstractVector(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -383,13 +354,11 @@ public class IsTypeFunctions { @Specialization protected byte isType(RSymbol value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Specialization(guards = {"!isRMissing(value)", "!isRSymbol(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -399,19 +368,16 @@ public class IsTypeFunctions { @Specialization(guards = "!isFactor(value)") protected byte isType(RAbstractIntVector value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Specialization(guards = "isFactor(value)") protected byte isTypeFactor(RAbstractIntVector value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } @Specialization protected byte isType(RAbstractDoubleVector value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -421,7 +387,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isAnyNumeric(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } @@ -437,13 +402,11 @@ public class IsTypeFunctions { @Specialization protected byte isType(RNull value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Specialization(guards = {"!isRMissing(value)", "!isRNull(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -464,13 +427,11 @@ public class IsTypeFunctions { @Specialization protected byte isObject(RAttributable arg) { - controlVisibility(); return arg.isObject(attrProfiles) ? RRuntime.LOGICAL_TRUE : RRuntime.LOGICAL_FALSE; } @Specialization(guards = {"!isRMissing(value)", "!isRAttributable(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -479,19 +440,16 @@ public class IsTypeFunctions { public abstract static class IsPairList extends MissingAdapter { @Specialization protected byte isType(RNull value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Specialization protected byte isType(RPairList value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Specialization(guards = {"!isRMissing(value)", "!isRNull(value)", "!isRPairList(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -501,7 +459,6 @@ public class IsTypeFunctions { @Specialization protected byte isType(RAbstractRawVector value) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @@ -511,7 +468,6 @@ public class IsTypeFunctions { @Specialization(guards = {"!isRMissing(value)", "!isAnyRaw(value)"}) protected byte isType(Object value) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } @@ -529,13 +485,11 @@ public class IsTypeFunctions { @Specialization protected byte isVector(RMissing value, String mode) { - controlVisibility(); throw missingError(); } @Specialization protected byte isVector(RAbstractVector x, String mode) { - controlVisibility(); if (!namesOnlyOrNoAttr(x) || !modeIsAnyOrMatches(x, mode)) { return RRuntime.LOGICAL_FALSE; } else { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsUnsorted.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsUnsorted.java index 49dfdbd7bf..ca91a45af5 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsUnsorted.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/IsUnsorted.java @@ -43,7 +43,6 @@ public abstract class IsUnsorted extends RBuiltinNode { @Specialization protected byte isUnsorted(RAbstractDoubleVector x, @SuppressWarnings("unused") byte strictly) { - controlVisibility(); double last = x.getDataAt(0); for (int k = 1; k < x.getLength(); k++) { double current = x.getDataAt(k); @@ -57,7 +56,6 @@ public abstract class IsUnsorted extends RBuiltinNode { @Specialization protected byte isUnsorted(RAbstractIntVector x, @SuppressWarnings("unused") byte strictly) { - controlVisibility(); int last = x.getDataAt(0); for (int k = 1; k < x.getLength(); k++) { int current = x.getDataAt(k); @@ -71,7 +69,6 @@ public abstract class IsUnsorted extends RBuiltinNode { @Specialization protected byte isUnsorted(RAbstractStringVector x, @SuppressWarnings("unused") byte strictly) { - controlVisibility(); String last = x.getDataAt(0); for (int k = 1; k < x.getLength(); k++) { String current = x.getDataAt(k); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java index 307ae4ca36..ee9c293263 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java @@ -70,7 +70,6 @@ public class LaFunctions { @Specialization protected Object doRg(RDoubleVector matrix, byte onlyValues) { - controlVisibility(); if (!matrix.isMatrix()) { errorProfile.enter(); throw RError.error(this, RError.Message.MUST_BE_SQUARE_NUMERIC, "x"); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Lapply.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Lapply.java index 2138140102..ea0226b0cc 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Lapply.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Lapply.java @@ -72,7 +72,6 @@ public abstract class Lapply extends RBuiltinNode { protected Object lapply(VirtualFrame frame, RAbstractVector vec, RFunction fun) { Object[] result = lapply.execute(frame, vec, fun); // set here else it gets overridden by the iterator evaluation - controlVisibility(); return RDataFactory.createList(result, vec.getNames(attrProfiles)); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Length.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Length.java index 1006d36612..cee6a6cf72 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Length.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Length.java @@ -38,7 +38,6 @@ public abstract class Length extends RBuiltinNode { @Specialization protected int getLength(VirtualFrame frame, Object vector, @Cached("create()") RLengthNode lengthNode) { - controlVisibility(); return lengthNode.executeInteger(frame, vector); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/License.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/License.java index e3e9a04340..20f706f38a 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/License.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/License.java @@ -42,7 +42,6 @@ public abstract class License extends RBuiltinNode { @Specialization @TruffleBoundary protected Object license() { - controlVisibility(); try { StdConnections.getStdout().writeString(RRuntime.LICENSE, true); } catch (IOException ex) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ListBuiltin.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ListBuiltin.java index 934c97cd1c..d432025c7e 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ListBuiltin.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ListBuiltin.java @@ -92,7 +92,6 @@ public abstract class ListBuiltin extends RBuiltinNode { @SuppressWarnings("unused") @Cached("args.getSignature()") ArgumentsSignature cachedSignature, // @Cached("argNameVector(cachedSignature)") RStringVector cachedArgNames) { Object[] argArray = args.getArguments(); - controlVisibility(); for (int i = 0; i < cachedLength; i++) { if (valueProfiles[i] == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); @@ -106,7 +105,6 @@ public abstract class ListBuiltin extends RBuiltinNode { @Specialization(guards = "!args.isEmpty()") protected RList list(RArgsValuesAndNames args) { Object[] argArray = args.getArguments(); - controlVisibility(); for (int i = 0; i < argArray.length; i++) { shareListElement(argArray[i]); } @@ -120,13 +118,11 @@ public abstract class ListBuiltin extends RBuiltinNode { @Specialization protected RList listMissing(@SuppressWarnings("unused") RMissing missing) { - controlVisibility(); return RDataFactory.createList(new Object[]{}); } @Specialization(guards = {"!isRArgsValuesAndNames(value)", "!isRMissing(value)"}) protected RList listSingleElement(Object value) { - controlVisibility(); shareListElement(value); if (suppliedSignatureArgNames == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LoadSaveFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LoadSaveFunctions.java index 4efe672398..12e973353d 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LoadSaveFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LoadSaveFunctions.java @@ -56,7 +56,6 @@ public class LoadSaveFunctions { @Specialization @TruffleBoundary protected RStringVector load(RConnection con, REnvironment envir, @SuppressWarnings("unused") RAbstractLogicalVector verbose) { - controlVisibility(); try (RConnection openConn = con.forceOpen("r")) { String s = openConn.readChar(5, true); if (s.equals("RDA2\n") || s.equals("RDB2\n") || s.equals("RDX2\n")) { @@ -116,7 +115,6 @@ public class LoadSaveFunctions { @Specialization @TruffleBoundary protected RStringVector load(RAbstractStringVector fileVec, @SuppressWarnings("unused") REnvironment envir) { - controlVisibility(); String path = Utils.tildeExpand(fileVec.getDataAt(0)); try (BufferedInputStream bs = new BufferedInputStream(new FileInputStream(path))) { int magic = readMagic(bs); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LocaleFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LocaleFunctions.java index 267342fc54..49ecf5d8f3 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LocaleFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LocaleFunctions.java @@ -47,7 +47,6 @@ public class LocaleFunctions { @Specialization @TruffleBoundary protected Object getLocale(RAbstractIntVector categoryVec) { - controlVisibility(); // TODO implement all: for now just return not available (NULL) int category = categoryVec.getDataAt(0); switch (category) { @@ -82,7 +81,6 @@ public class LocaleFunctions { @Specialization @TruffleBoundary protected Object setLocale(@SuppressWarnings("unused") RAbstractIntVector categoryVec, RAbstractStringVector locale) { - controlVisibility(); // TODO implement properly!! return locale; } @@ -90,7 +88,6 @@ public class LocaleFunctions { @Specialization @TruffleBoundary protected Object setLocale(@SuppressWarnings("unused") RAbstractIntVector categoryVec, RNull locale) { - controlVisibility(); // TODO implement properly!! return locale; } @@ -101,7 +98,6 @@ public class LocaleFunctions { @Specialization @TruffleBoundary protected Object localeconv() { - controlVisibility(); RError.nyi(this, "localeconv"); return RNull.instance; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LogFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LogFunctions.java index a8de5fd7fe..29cb07a12b 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LogFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LogFunctions.java @@ -59,25 +59,21 @@ public class LogFunctions { @SuppressWarnings("unused") @Specialization protected RNull log(RNull x, RNull base) { - controlVisibility(); throw RError.error(this, RError.Message.NON_NUMERIC_ARGUMENT_FUNCTION); } @Specialization protected double log(int x, double base) { - controlVisibility(); return logb(x, base); } @Specialization protected double log(double x, double base) { - controlVisibility(); return logb(x, base); } @Specialization protected RDoubleVector log(RIntVector vector, double base) { - controlVisibility(); double[] resultVector = new double[vector.getLength()]; for (int i = 0; i < vector.getLength(); i++) { int inputValue = vector.getDataAt(i); @@ -92,7 +88,6 @@ public class LogFunctions { @Specialization protected RDoubleVector log(RDoubleVector vector, double base) { - controlVisibility(); double[] doubleVector = new double[vector.getLength()]; for (int i = 0; i < vector.getLength(); i++) { double value = vector.getDataAt(i); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Ls.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Ls.java index be33bcd600..c4af62535b 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Ls.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Ls.java @@ -38,7 +38,6 @@ public abstract class Ls extends RBuiltinNode { @Specialization @TruffleBoundary protected RStringVector ls(REnvironment envir, byte allNames, byte sorted) { - controlVisibility(); return envir.ls(RRuntime.fromLogical(allNames), null, RRuntime.fromLogical(sorted)); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/MakeUnique.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/MakeUnique.java index 408ed860e3..38e577403b 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/MakeUnique.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/MakeUnique.java @@ -45,7 +45,6 @@ public abstract class MakeUnique extends RBuiltinNode { @Specialization protected RAbstractStringVector makeUnique(RAbstractStringVector names, String sep) { - controlVisibility(); if (namesProfile.profile(names.getLength() == 0 || names.getLength() == 1)) { return names; } else { @@ -99,14 +98,12 @@ public abstract class MakeUnique extends RBuiltinNode { @SuppressWarnings("unused") @Specialization(guards = "!sepIsString(sep)") protected RAbstractStringVector makeUniqueWrongSep(RAbstractStringVector names, RAbstractVector sep) { - controlVisibility(); throw RError.error(this, RError.Message.MUST_BE_STRING, "sep"); } @SuppressWarnings("unused") @Specialization(guards = "!namesIsStringVector(names)") protected RAbstractStringVector makeUnique(RAbstractVector names, Object sep) { - controlVisibility(); throw RError.error(this, RError.Message.NOT_CHARACTER_VECTOR, "names"); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Mapply.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Mapply.java index da4a543e88..20610124fb 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Mapply.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Mapply.java @@ -85,7 +85,6 @@ public abstract class Mapply extends RBuiltinNode { protected Object mApply(VirtualFrame frame, RFunction fun, RList dots, RList moreArgs) { Object[] result = mapply.execute(frame, dots, fun, moreArgs); // set here else it gets overridden by the iterator evaluation - controlVisibility(); return RDataFactory.createList(result); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/MatMult.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/MatMult.java index 5336e7f009..dd3c4e2fe5 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/MatMult.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/MatMult.java @@ -76,7 +76,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "bothZeroDim(a, b)") protected RDoubleVector both0Dim(RAbstractDoubleVector a, RAbstractDoubleVector b) { - controlVisibility(); int r = b.getDimensions()[1]; int c = a.getDimensions()[0]; RDoubleVector result = RDataFactory.createDoubleVector(r * c); @@ -86,14 +85,12 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "hasZeroDim(a)") protected RAbstractVector left0Dim(RAbstractVector a, RAbstractVector b) { - controlVisibility(); int[] dim = a.getDimensions()[0] == 0 ? new int[]{0, b.getDimensions()[1]} : new int[]{b.getDimensions()[0], 0}; return a.copyWithNewDimensions(dim); } @Specialization(guards = "hasZeroDim(b)") protected RAbstractVector right0Dim(RAbstractVector a, RAbstractVector b) { - controlVisibility(); int[] dim = b.getDimensions()[0] == 0 ? new int[]{0, a.getDimensions()[1]} : new int[]{a.getDimensions()[0], 0}; return b.copyWithNewDimensions(dim); } @@ -124,7 +121,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "matmat(a, b)") protected RDoubleVector matmatmult(RAbstractDoubleVector a, RAbstractDoubleVector b) { - controlVisibility(); int[] aDimensions = a.getDimensions(); int[] bDimensions = b.getDimensions(); return doubleMatrixMultiply(a, b, aDimensions[0], aDimensions[1], bDimensions[0], bDimensions[1]); @@ -244,7 +240,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "vecvec(a, b)") protected RDoubleVector vecvecmult(RAbstractDoubleVector a, RAbstractDoubleVector b) { - controlVisibility(); if (a.getLength() != b.getLength()) { errorProfile.enter(); throw RError.error(this, RError.Message.NON_CONFORMABLE_ARGS); @@ -265,7 +260,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "matvec(a, b)") protected RDoubleVector matvecmult(RAbstractDoubleVector a, RAbstractDoubleVector b) { - controlVisibility(); int aRows = a.getDimensions()[0]; int aCols = a.getDimensions()[1]; int bRows; @@ -282,7 +276,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "vecmat(a, b)") protected RDoubleVector vecmatmult(RAbstractDoubleVector a, RAbstractDoubleVector b) { - controlVisibility(); int bRows = b.getDimensions()[0]; int bCols = b.getDimensions()[1]; int aRows; @@ -301,7 +294,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "matmat(a, b)") protected RComplexVector matmatmult(RAbstractComplexVector a, RAbstractComplexVector b) { - controlVisibility(); final int aCols = a.getDimensions()[1]; final int bRows = b.getDimensions()[0]; if (aCols != bRows) { @@ -330,7 +322,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "vecvec(a, b)") protected RComplexVector vecvecmult(RAbstractComplexVector a, RAbstractComplexVector b) { - controlVisibility(); if (a.getLength() != b.getLength()) { errorProfile.enter(); throw RError.error(this, RError.Message.NON_CONFORMABLE_ARGS); @@ -347,7 +338,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "matvec(a, b)") protected RComplexVector matvecmult(RAbstractComplexVector a, RAbstractComplexVector b) { - controlVisibility(); final int aCols = a.getDimensions()[1]; final int aRows = a.getDimensions()[0]; if (aCols != 1 && aCols != b.getLength()) { @@ -384,7 +374,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "vecmat(a, b)") protected RComplexVector vecmatmult(RAbstractComplexVector a, RAbstractComplexVector b) { - controlVisibility(); final int bRows = b.getDimensions()[0]; final int bCols = b.getDimensions()[1]; if (bRows != 1 && bRows != a.getLength()) { @@ -423,7 +412,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "matmat(a, b)") protected RIntVector matmatmult(RAbstractIntVector a, RAbstractIntVector b) { - controlVisibility(); final int aCols = a.getDimensions()[1]; final int bRows = b.getDimensions()[0]; if (aCols != bRows) { @@ -450,7 +438,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "vecvec(a, b)") protected RIntVector vecvecmult(RAbstractIntVector a, RAbstractIntVector b) { - controlVisibility(); if (a.getLength() != b.getLength()) { errorProfile.enter(); throw RError.error(this, RError.Message.NON_CONFORMABLE_ARGS); @@ -466,7 +453,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "matvec(a, b)") protected RIntVector matvecmult(RAbstractIntVector a, RAbstractIntVector b) { - controlVisibility(); final int aCols = a.getDimensions()[1]; final int aRows = a.getDimensions()[0]; if (aCols != 1 && aCols != b.getLength()) { @@ -501,7 +487,6 @@ public abstract class MatMult extends RBuiltinNode { @Specialization(guards = "vecmat(a, b)") protected RIntVector vecmatmult(RAbstractIntVector a, RAbstractIntVector b) { - controlVisibility(); final int bCols = b.getDimensions()[1]; final int bRows = b.getDimensions()[0]; if (bRows != 1 && bRows != a.getLength()) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java index 4ad15a8179..42fcb9b513 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java @@ -137,7 +137,6 @@ public abstract class Match extends RBuiltinNode { @Specialization protected RIntVector match(RAbstractIntVector x, RAbstractIntVector table, RAbstractIntVector nomatchVec, @SuppressWarnings("unused") Object incomparables) { - controlVisibility(); int nomatch = nomatchVec.getLength() == 0 ? RRuntime.INT_NA : nomatchVec.getDataAt(0); int[] result = initResult(x.getLength(), nomatch); boolean matchAll = true; @@ -174,7 +173,6 @@ public abstract class Match extends RBuiltinNode { @Specialization protected RIntVector match(RAbstractDoubleVector x, RAbstractIntVector table, RAbstractIntVector nomatchVec, @SuppressWarnings("unused") Object incomparables) { - controlVisibility(); int nomatch = nomatchVec.getLength() == 0 ? RRuntime.INT_NA : nomatchVec.getDataAt(0); int[] result = initResult(x.getLength(), nomatch); boolean matchAll = true; @@ -211,7 +209,6 @@ public abstract class Match extends RBuiltinNode { @Specialization protected RIntVector match(RAbstractIntVector x, RAbstractDoubleVector table, RAbstractIntVector nomatchVec, @SuppressWarnings("unused") Object incomparables) { - controlVisibility(); int nomatch = nomatchVec.getLength() == 0 ? RRuntime.INT_NA : nomatchVec.getDataAt(0); int[] result = initResult(x.getLength(), nomatch); boolean matchAll = true; @@ -255,7 +252,6 @@ public abstract class Match extends RBuiltinNode { @Specialization protected RIntVector match(RAbstractDoubleVector x, RAbstractDoubleVector table, RAbstractIntVector nomatchVec, @SuppressWarnings("unused") Object incomparables) { - controlVisibility(); int nomatch = nomatchVec.getLength() == 0 ? RRuntime.INT_NA : nomatchVec.getDataAt(0); int[] result = initResult(x.getLength(), nomatch); boolean matchAll = true; @@ -292,7 +288,6 @@ public abstract class Match extends RBuiltinNode { @Specialization protected RIntVector match(RAbstractIntVector x, RAbstractLogicalVector table, RAbstractIntVector nomatchVec, @SuppressWarnings("unused") Object incomparables) { - controlVisibility(); int nomatch = nomatchVec.getLength() == 0 ? RRuntime.INT_NA : nomatchVec.getDataAt(0); int[] result = initResult(x.getLength(), nomatch); boolean matchAll = true; @@ -328,7 +323,6 @@ public abstract class Match extends RBuiltinNode { @Cached("create()") NAProfile naProfile, // @Cached("create()") BranchProfile foundProfile, // @Cached("create()") BranchProfile notFoundProfile) { - controlVisibility(); String element = x.getDataAt(0); int length = table.getLength(); if (naProfile.isNA(element)) { @@ -353,7 +347,6 @@ public abstract class Match extends RBuiltinNode { @Specialization protected RIntVector match(RAbstractStringVector x, RAbstractStringVector table, RAbstractIntVector nomatchVec, @SuppressWarnings("unused") Object incomparables) { - controlVisibility(); int nomatch = nomatchVec.getLength() == 0 ? RRuntime.INT_NA : nomatchVec.getDataAt(0); int[] result = initResult(x.getLength(), nomatch); boolean matchAll = true; @@ -408,7 +401,6 @@ public abstract class Match extends RBuiltinNode { @Specialization protected RIntVector match(RAbstractLogicalVector x, RAbstractLogicalVector table, RAbstractIntVector nomatchVec, @SuppressWarnings("unused") Object incomparables) { - controlVisibility(); int nomatch = nomatchVec.getLength() == 0 ? RRuntime.INT_NA : nomatchVec.getDataAt(0); int[] result = initResult(x.getLength(), nomatch); boolean matchAll = true; @@ -440,7 +432,6 @@ public abstract class Match extends RBuiltinNode { @Specialization(guards = "!isStringVectorTable(table)") protected RIntVector match(RAbstractStringVector x, RAbstractVector table, RAbstractIntVector nomatchVec, @SuppressWarnings("unused") Object incomparables) { - controlVisibility(); int nomatch = nomatchVec.getLength() == 0 ? RRuntime.INT_NA : nomatchVec.getDataAt(0); int[] result = initResult(x.getLength(), nomatch); boolean matchAll = true; @@ -463,7 +454,6 @@ public abstract class Match extends RBuiltinNode { @Specialization protected RIntVector match(RAbstractComplexVector x, RAbstractComplexVector table, RAbstractIntVector nomatchVec, @SuppressWarnings("unused") Object incomparables) { - controlVisibility(); int nomatch = nomatchVec.getLength() == 0 ? RRuntime.INT_NA : nomatchVec.getDataAt(0); int[] result = initResult(x.getLength(), nomatch); boolean matchAll = true; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Matrix.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Matrix.java index 610f85989d..8c97318673 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Matrix.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Matrix.java @@ -70,7 +70,6 @@ public abstract class Matrix extends RBuiltinNode { @Specialization(guards = "!isTrue(byrow)") @SuppressWarnings("unused") protected RAbstractVector matrixbc(RAbstractVector data, int nrow, int ncol, byte byrow, RNull dimnames, byte missingNr, byte missingNc) { - controlVisibility(); int[] dim = computeDimByCol(data.getLength(), nrow, ncol, missingNr, missingNc); if (empty.profile(data.getLength() == 0)) { if (isList.profile(data instanceof RList)) { @@ -104,14 +103,12 @@ public abstract class Matrix extends RBuiltinNode { res = data.copyResizedWithDimensions(dim, false); res = updateDimNames(res, dimnames); } - controlVisibility(); return res; } @Specialization(guards = "isTrue(byrow)") @SuppressWarnings("unused") protected RAbstractVector matrixbr(RAbstractVector data, int nrow, int ncol, byte byrow, RNull dimnames, byte missingNr, byte missingNc) { - controlVisibility(); int[] dim = computeDimByRow(data.getLength(), nrow, ncol, missingNr, missingNc); if (transpose == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); @@ -154,7 +151,6 @@ public abstract class Matrix extends RBuiltinNode { res = (RVector) transpose.execute(data.copyResizedWithDimensions(dim, false)); res = updateDimNames(res, dimnames); } - controlVisibility(); return res; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Mean.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Mean.java index 6089d1efca..3314ec6f9f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Mean.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Mean.java @@ -47,7 +47,6 @@ public abstract class Mean extends RBuiltinNode { @Specialization protected double mean(RAbstractDoubleVector x) { - controlVisibility(); if (x.getLength() == 0) { emptyProfile.enter(); return Double.NaN; @@ -61,7 +60,6 @@ public abstract class Mean extends RBuiltinNode { @Specialization protected double mean(RAbstractIntVector x) { - controlVisibility(); if (x.getLength() == 0) { emptyProfile.enter(); return Double.NaN; @@ -75,7 +73,6 @@ public abstract class Mean extends RBuiltinNode { @Specialization protected double mean(RAbstractLogicalVector x) { - controlVisibility(); if (x.getLength() == 0) { emptyProfile.enter(); return Double.NaN; @@ -89,7 +86,6 @@ public abstract class Mean extends RBuiltinNode { @Specialization protected RComplex mean(RAbstractComplexVector x) { - controlVisibility(); if (x.getLength() == 0) { emptyProfile.enter(); return RDataFactory.createComplex(Double.NaN, Double.NaN); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Missing.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Missing.java index 7667d196be..d4d5ebfbe9 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Missing.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Missing.java @@ -154,7 +154,6 @@ public abstract class Missing extends RBuiltinNode { @Specialization protected byte missing(VirtualFrame frame, RPromise promise) { - controlVisibility(); if (repCache == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); repCache = insert(createRepCache(0)); @@ -165,13 +164,11 @@ public abstract class Missing extends RBuiltinNode { @Specialization protected byte missing(@SuppressWarnings("unused") RMissing obj) { - controlVisibility(); return RRuntime.LOGICAL_TRUE; } @Fallback protected byte missing(@SuppressWarnings("unused") Object obj) { - controlVisibility(); return RRuntime.LOGICAL_FALSE; } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NChar.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NChar.java index 9fb021ee9d..d4e2b90a0d 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NChar.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NChar.java @@ -73,49 +73,42 @@ public abstract class NChar extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected RIntVector nchar(RNull value, String type, byte allowNA, byte keepNA) { - controlVisibility(); return RDataFactory.createEmptyIntVector(); } @SuppressWarnings("unused") @Specialization protected int nchar(int value, String type, byte allowNA, byte keepNA) { - controlVisibility(); return coerceContent(value).length(); } @SuppressWarnings("unused") @Specialization protected int nchar(double value, String type, byte allowNA, byte keepNA) { - controlVisibility(); return coerceContent(value).length(); } @SuppressWarnings("unused") @Specialization protected int nchar(byte value, String type, byte allowNA, byte keepNA) { - controlVisibility(); return coerceContent(value).length(); } @SuppressWarnings("unused") @Specialization(guards = "vector.getLength() == 0") protected RIntVector ncharL0(RAbstractStringVector vector, String type, byte allowNA, byte keepNA) { - controlVisibility(); return RDataFactory.createEmptyIntVector(); } @SuppressWarnings("unused") @Specialization(guards = "vector.getLength() == 1") protected int ncharL1(RAbstractStringVector vector, String type, byte allowNA, byte keepNA) { - controlVisibility(); return vector.getDataAt(0).length(); } @SuppressWarnings("unused") @Specialization(guards = "vector.getLength() > 1") protected RIntVector nchar(RAbstractStringVector vector, String type, byte allowNA, byte keepNA) { - controlVisibility(); int len = vector.getLength(); int[] result = new int[len]; for (int i = 0; i < len; i++) { @@ -127,7 +120,6 @@ public abstract class NChar extends RBuiltinNode { @SuppressWarnings("unused") @Fallback protected RIntVector nchar(Object obj, Object type, Object allowNA, Object keepNA) { - controlVisibility(); if (factorInheritsCheck == null) { CompilerDirectives.transferToInterpreter(); factorInheritsCheck = insert(new InheritsCheckNode(RRuntime.CLASS_FACTOR)); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NZChar.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NZChar.java index 49181da7bf..69a5311f65 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NZChar.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NZChar.java @@ -62,31 +62,26 @@ public abstract class NZChar extends RBuiltinNode { @Specialization protected RLogicalVector rev(@SuppressWarnings("unused") RNull value) { - controlVisibility(); return RDataFactory.createEmptyLogicalVector(); } @Specialization protected byte rev(int value) { - controlVisibility(); return isNonZeroLength(coerceContent(value)); } @Specialization protected byte rev(double value) { - controlVisibility(); return isNonZeroLength(coerceContent(value)); } @Specialization protected byte rev(byte value) { - controlVisibility(); return isNonZeroLength(coerceContent(value)); } @Specialization protected RLogicalVector rev(RStringVector vector) { - controlVisibility(); int len = vector.getLength(); byte[] result = new byte[len]; for (int i = 0; i < len; i++) { @@ -97,7 +92,6 @@ public abstract class NZChar extends RBuiltinNode { @Specialization protected RLogicalVector rev(RAbstractVector vector) { - controlVisibility(); int len = vector.getLength(); byte[] result = new byte[len]; for (int i = 0; i < len; i++) { 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 64d7c1dbfa..f3a801971b 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 @@ -43,7 +43,6 @@ public abstract class Names extends RBuiltinNode { @Specialization protected Object getNames(RAbstractContainer container) { - controlVisibility(); if (hasNames.profile(container.getNames(attrProfiles) != null)) { return container.getNames(attrProfiles); } else { @@ -54,13 +53,11 @@ public abstract class Names extends RBuiltinNode { @Specialization @TruffleBoundary protected Object getNames(REnvironment env) { - controlVisibility(); return env.ls(true, null, false); } @Fallback protected RNull getNames(@SuppressWarnings("unused") Object operand) { - controlVisibility(); return RNull.instance; } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NamespaceFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NamespaceFunctions.java index a0afca1494..2a89a3f590 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NamespaceFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NamespaceFunctions.java @@ -40,7 +40,6 @@ public class NamespaceFunctions { public abstract static class GetRegisteredNamespace extends RBuiltinNode { @Specialization protected Object doGetRegisteredNamespace(RAbstractStringVector name) { - controlVisibility(); Object result = REnvironment.getRegisteredNamespace(name.getDataAt(0)); if (result == null) { return RNull.instance; @@ -51,7 +50,6 @@ public class NamespaceFunctions { @Specialization protected Object doGetRegisteredNamespace(RSymbol name) { - controlVisibility(); Object result = REnvironment.getRegisteredNamespace(name.getName()); if (result == null) { return RNull.instance; @@ -65,7 +63,6 @@ public class NamespaceFunctions { public abstract static class IsRegisteredNamespace extends RBuiltinNode { @Specialization protected byte doIsRegisteredNamespace(RAbstractStringVector name) { - controlVisibility(); Object result = REnvironment.getRegisteredNamespace(name.getDataAt(0)); if (result == null) { return RRuntime.LOGICAL_FALSE; @@ -76,7 +73,6 @@ public class NamespaceFunctions { @Specialization protected Object doIsRegisteredNamespace(RSymbol name) { - controlVisibility(); Object result = REnvironment.getRegisteredNamespace(name.getName()); if (result == null) { return RRuntime.LOGICAL_FALSE; @@ -90,7 +86,6 @@ public class NamespaceFunctions { public abstract static class IsNamespaceEnv extends RBuiltinNode { @Specialization protected byte doIsNamespaceEnv(REnvironment env) { - controlVisibility(); return RRuntime.asLogical(env.isNamespaceEnv()); } } @@ -99,7 +94,6 @@ public class NamespaceFunctions { public abstract static class GetNamespaceRegistry extends RBuiltinNode { @Specialization protected REnvironment doGetNamespaceRegistry() { - controlVisibility(); return REnvironment.getNamespaceRegistry(); } } @@ -108,7 +102,6 @@ public class NamespaceFunctions { public abstract static class RegisterNamespace extends RBuiltinNode { @Specialization protected RNull registerNamespace(String name, REnvironment env) { - controlVisibility(); if (REnvironment.registerNamespace(name, env) == null) { throw RError.error(this, RError.Message.NS_ALREADY_REG); } @@ -120,14 +113,12 @@ public class NamespaceFunctions { public abstract static class UnregisterNamespace extends RBuiltinNode { @Specialization protected RNull unregisterNamespace(RAbstractStringVector name) { - controlVisibility(); doUnregisterNamespace(name.getDataAt(0)); return RNull.instance; } @Specialization protected Object unregisterNamespace(RSymbol name) { - controlVisibility(); doUnregisterNamespace(name.getName()); return RNull.instance; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NormalizePath.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NormalizePath.java index 8550009309..f179481dc1 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NormalizePath.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/NormalizePath.java @@ -50,7 +50,6 @@ public abstract class NormalizePath extends RBuiltinNode { @Specialization @TruffleBoundary protected RStringVector doNormalizePath(RAbstractStringVector pathVec, @SuppressWarnings("unused") String winslash, byte mustWork) { - controlVisibility(); String[] results = new String[pathVec.getLength()]; FileSystem fileSystem = FileSystems.getDefault(); for (int i = 0; i < results.length; i++) { @@ -88,7 +87,6 @@ public abstract class NormalizePath extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected Object doNormalizePath(Object path, Object winslash, Object mustWork) { - controlVisibility(); throw RError.error(this, RError.Message.WRONG_TYPE); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OnExit.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OnExit.java index 27651c37d7..4154d779aa 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OnExit.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OnExit.java @@ -71,7 +71,6 @@ public abstract class OnExit extends RBuiltinNode { @Specialization protected Object onExit(VirtualFrame frame, RPromise expr, byte add) { - controlVisibility(); if (na.isNA(add)) { throw RError.error(this, RError.Message.INVALID_ARGUMENT, "add"); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OptionsFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OptionsFunctions.java index 34b9ceeeb3..7349f82ac2 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OptionsFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OptionsFunctions.java @@ -64,7 +64,6 @@ public class OptionsFunctions { @Specialization @TruffleBoundary protected RList options(@SuppressWarnings("unused") RMissing x) { - controlVisibility(); Set<Map.Entry<String, Object>> optionSettings = RContext.getInstance().stateROptions.getValues(); Object[] data = new Object[optionSettings.size()]; String[] names = new String[data.length]; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Parse.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Parse.java index 5df55c8e7e..ef35ff7e37 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Parse.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Parse.java @@ -117,7 +117,6 @@ public abstract class Parse extends RBuiltinNode { @Specialization protected Object parse(RConnection conn, Object n, Object text, RAbstractStringVector prompt, Object srcFile, RAbstractStringVector encoding) { - controlVisibility(); int nAsInt; if (n != RNull.instance) { nAsInt = castInt(n); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Paste.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Paste.java index 99a8555a62..0059367e2f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Paste.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Paste.java @@ -96,7 +96,6 @@ public abstract class Paste extends RBuiltinNode { @Specialization protected RStringVector pasteList(RList values, String sep, @SuppressWarnings("unused") RNull collapse) { - controlVisibility(); int length = lengthProfile.profile(values.getLength()); if (hasNonNullElements(values, length)) { String[] result = pasteListElements(values, sep, length); @@ -109,7 +108,6 @@ public abstract class Paste extends RBuiltinNode { @Specialization(guards = "!isRNull(collapse)") protected String pasteList(RList values, String sep, Object collapse, // @Cached("createBinaryProfile()") ConditionProfile collapseIsVectorProfile) { - controlVisibility(); int length = lengthProfile.profile(values.getLength()); if (hasNonNullElements(values, length)) { String[] result = pasteListElements(values, sep, length); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Paste0.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Paste0.java index e34812cc49..a2a0c12003 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Paste0.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Paste0.java @@ -49,7 +49,6 @@ public abstract class Paste0 extends RBuiltinNode { @Specialization protected Object paste0(RList values, Object collapse) { - controlVisibility(); return paste(values, collapse); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/PathExpand.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/PathExpand.java index c18653ce23..9c326079e9 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/PathExpand.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/PathExpand.java @@ -39,7 +39,6 @@ public abstract class PathExpand extends RBuiltinNode { @Specialization @TruffleBoundary protected Object doPathExpand(RAbstractStringVector vec) { - controlVisibility(); String[] results = new String[vec.getLength()]; for (int i = 0; i < results.length; i++) { String path = Utils.tildeExpand(vec.getDataAt(i), true); @@ -51,7 +50,6 @@ public abstract class PathExpand extends RBuiltinNode { @Specialization @TruffleBoundary protected Object doPathExpandGeneric(@SuppressWarnings("unused") Object path) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "path"); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/PrintFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/PrintFunctions.java index 79cd16876d..1fcfbb4519 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/PrintFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/PrintFunctions.java @@ -33,7 +33,6 @@ import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.r.nodes.access.variables.ReadVariableNode; import com.oracle.truffle.r.nodes.builtin.CastBuilder; import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; -import com.oracle.truffle.r.nodes.builtin.RInvisibleBuiltinNode; import com.oracle.truffle.r.nodes.builtin.base.printer.PrintParameters; import com.oracle.truffle.r.nodes.builtin.base.printer.ValuePrinterNode; import com.oracle.truffle.r.nodes.builtin.base.printer.ValuePrinterNodeGen; @@ -82,7 +81,6 @@ public class PrintFunctions { @Specialization(guards = "!isS4(o)") protected Object printDefault(Object o, Object digits, boolean quote, Object naPrint, Object printGap, boolean right, Object max, boolean useSource, boolean noOpt) { valuePrinter.executeString(o, digits, quote, naPrint, printGap, right, max, useSource, noOpt); - controlVisibility(); return o; } @@ -112,7 +110,6 @@ public class PrintFunctions { @Specialization protected RFunction printFunction(RFunction x, byte useSource, RArgsValuesAndNames extra) { valuePrinter.executeString(x, PrintParameters.DEFAULT_DIGITS, true, RString.valueOf(RRuntime.STRING_NA), 1, false, PrintParameters.getDeafultMaxPrint(), true, false); - controlVisibility(); return x; } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ProcTime.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ProcTime.java index b3ae75afa3..73ad80badc 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ProcTime.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ProcTime.java @@ -46,7 +46,6 @@ public abstract class ProcTime extends RBuiltinNode { @Specialization @TruffleBoundary protected RDoubleVector procTime() { - controlVisibility(); double[] data = new double[5]; Engine.Timings timings = RContext.getEngine().getTimings(); long nowInNanos = timings.elapsedTimeInNanos(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Prod.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Prod.java index 9c495dd8c5..26adccf1fb 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Prod.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Prod.java @@ -51,7 +51,6 @@ public abstract class Prod extends RBuiltinNode { @Specialization protected double prod(RAbstractDoubleVector x) { - controlVisibility(); double product = x.getDataAt(0); for (int k = 1; k < x.getLength(); k++) { product = prod.op(product, x.getDataAt(k)); @@ -61,7 +60,6 @@ public abstract class Prod extends RBuiltinNode { @Specialization protected double prod(RAbstractIntVector x) { - controlVisibility(); double product = x.getDataAt(0); for (int k = 1; k < x.getLength(); k++) { product = prod.op(product, x.getDataAt(k)); @@ -71,7 +69,6 @@ public abstract class Prod extends RBuiltinNode { @Specialization protected double prod(RAbstractLogicalVector x) { - controlVisibility(); double product = x.getDataAt(0); for (int k = 1; k < x.getLength(); k++) { product = prod.op(product, x.getDataAt(k)); @@ -81,7 +78,6 @@ public abstract class Prod extends RBuiltinNode { @Specialization protected RComplex prod(RAbstractComplexVector x) { - controlVisibility(); RComplex product = x.getDataAt(0); for (int k = 1; k < x.getLength(); k++) { RComplex a = x.getDataAt(k); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Quit.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Quit.java index 8edef98dc4..f0767b59c7 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Quit.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Quit.java @@ -49,7 +49,6 @@ public abstract class Quit extends RBuiltinNode { @Specialization @TruffleBoundary protected Object doQuit(String saveArg, int status, byte runLast) { - controlVisibility(); if (BrowserInteractNode.inBrowser()) { RError.warning(this, RError.Message.BROWSER_QUIT); return null; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Quote.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Quote.java index 00ecbf1b2b..6a8e2b2c5b 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Quote.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Quote.java @@ -55,7 +55,6 @@ public abstract class Quote extends RBuiltinNode { @Specialization protected Object doQuote(RPromise expr) { - controlVisibility(); // GnuR creates symbols for simple variables and actual values for constants RNode node = (RNode) expr.getRep(); RNode unode = (RNode) RASTUtils.unwrap(node); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RNGFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RNGFunctions.java index f7fcb85280..c78e633464 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RNGFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RNGFunctions.java @@ -44,7 +44,6 @@ public class RNGFunctions { @SuppressWarnings("unused") @Specialization protected RNull setSeed(double seed, RNull kind, RNull normKind) { - controlVisibility(); doSetSeed((int) seed, RRNG.NO_KIND_CHANGE, RRNG.NO_KIND_CHANGE); return RNull.instance; } @@ -52,7 +51,6 @@ public class RNGFunctions { @SuppressWarnings("unused") @Specialization protected RNull setSeed(double seed, RAbstractIntVector kind, RNull normKind) { - controlVisibility(); doSetSeed((int) seed, kind.getDataAt(0), RRNG.NO_KIND_CHANGE); return RNull.instance; } @@ -60,7 +58,6 @@ public class RNGFunctions { @SuppressWarnings("unused") @Specialization protected RNull setSeed(RNull seed, RNull kind, RNull normKind) { - controlVisibility(); doSetSeed(RRNG.RESET_SEED, RRNG.NO_KIND_CHANGE, RRNG.NO_KIND_CHANGE); return RNull.instance; } @@ -68,7 +65,6 @@ public class RNGFunctions { @SuppressWarnings("unused") @Specialization protected RNull setSeed(byte seed, RNull kind, RNull normKind) { - controlVisibility(); CompilerDirectives.transferToInterpreter(); throw RError.error(this, RError.Message.SEED_NOT_VALID_INT); } @@ -91,7 +87,6 @@ public class RNGFunctions { @Specialization protected RIntVector doRNGkind(Object kind, Object normKind) { - controlVisibility(); RIntVector result = getCurrent(); int kindChange = checkType(kind, "kind"); int normKindChange = checkType(normKind, "normkind"); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RVersion.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RVersion.java index 819ed4914a..5136330489 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RVersion.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RVersion.java @@ -37,7 +37,6 @@ public abstract class RVersion extends RBuiltinNode { @Specialization @TruffleBoundary protected Object doRVersion() { - controlVisibility(); return RDataFactory.createList(RVersionInfo.listValues(), RDataFactory.createStringVector(RVersionInfo.listNames(), RDataFactory.COMPLETE_VECTOR)); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ReadREnviron.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ReadREnviron.java index 1261310b7f..45a89d44c7 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ReadREnviron.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ReadREnviron.java @@ -45,7 +45,6 @@ public abstract class ReadREnviron extends RBuiltinNode { @Specialization(guards = "lengthOneCVector(vec)") @TruffleBoundary protected Object doReadEnviron(RAbstractStringVector vec) { - controlVisibility(); String path = Utils.tildeExpand(vec.getDataAt(0)); byte result = RRuntime.LOGICAL_TRUE; try { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RepeatInternal.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RepeatInternal.java index 26290f0312..49a53c7f08 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RepeatInternal.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RepeatInternal.java @@ -70,7 +70,6 @@ public abstract class RepeatInternal extends RBuiltinNode { private <ValueT extends RAbstractVector, ResultT extends ValueT, ArrayT> ResultT repInt(ValueT value, RAbstractIntVector times, IntFunction<ArrayT> arrayConstructor, ArrayUpdateFunction<ValueT, ArrayT> arrayUpdate, CreateResultFunction<ResultT, ArrayT> createResult) { - controlVisibility(); ArrayT result; int timesLength = times.getLength(); int valueLength = value.getLength(); @@ -136,7 +135,6 @@ public abstract class RepeatInternal extends RBuiltinNode { @Specialization protected RList repList(RList value, int times) { - controlVisibility(); int oldLength = value.getLength(); int length = value.getLength() * times; Object[] array = new Object[length]; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RepeatLength.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RepeatLength.java index 7363d91d35..f53dea1c44 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RepeatLength.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RepeatLength.java @@ -45,7 +45,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization @SuppressWarnings("unused") protected RNull repLen(RNull value, int length) { - controlVisibility(); return RNull.instance; } @@ -54,7 +53,6 @@ public abstract class RepeatLength extends RBuiltinNode { // @Specialization protected RRawVector repLen(RRaw value, int length) { - controlVisibility(); byte[] array = new byte[length]; Arrays.fill(array, value.getValue()); return RDataFactory.createRawVector(array); @@ -62,7 +60,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RIntVector repLen(int value, int length) { - controlVisibility(); int[] array = new int[length]; Arrays.fill(array, length); return RDataFactory.createIntVector(array, !RRuntime.isNA(value)); @@ -70,7 +67,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RDoubleVector repLen(double value, int length) { - controlVisibility(); double[] array = new double[length]; Arrays.fill(array, value); return RDataFactory.createDoubleVector(array, !RRuntime.isNA(value)); @@ -78,7 +74,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RStringVector repLen(String value, int length) { - controlVisibility(); String[] array = new String[length]; Arrays.fill(array, value); return RDataFactory.createStringVector(array, !RRuntime.isNA(value)); @@ -86,7 +81,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RComplexVector repLen(RComplex value, int length) { - controlVisibility(); int complexLength = length * 2; double[] array = new double[complexLength]; for (int i = 0; i < complexLength; i += 2) { @@ -98,7 +92,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RLogicalVector repLen(byte value, int length) { - controlVisibility(); byte[] array = new byte[length]; Arrays.fill(array, value); return RDataFactory.createLogicalVector(array, value != RRuntime.LOGICAL_NA); @@ -109,7 +102,6 @@ public abstract class RepeatLength extends RBuiltinNode { // @Specialization protected RIntVector repLen(RAbstractIntVector value, int length) { - controlVisibility(); int[] array = new int[length]; for (int i = 0, j = 0; i < length; i++, j = Utils.incMod(j, value.getLength())) { array[i] = value.getDataAt(j); @@ -119,7 +111,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RDoubleVector repLen(RDoubleVector value, int length) { - controlVisibility(); double[] array = new double[length]; for (int i = 0, j = 0; i < length; i++, j = Utils.incMod(j, value.getLength())) { array[i] = value.getDataAt(j); @@ -129,7 +120,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RStringVector repLen(RStringVector vectorToRepeat, int length) { - controlVisibility(); String[] result = new String[length]; int vectorToRepeatLength = vectorToRepeat.getLength(); for (int i = 0; i < length; i++) { @@ -140,7 +130,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RRawVector repLen(RRawVector value, int length) { - controlVisibility(); byte[] array = new byte[length]; for (int i = 0, j = 0; i < length; i++, j = Utils.incMod(j, value.getLength())) { array[i] = value.getDataAt(j).getValue(); @@ -150,7 +139,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RComplexVector repLen(RComplexVector value, int length) { - controlVisibility(); final int resultLength = length * 2; double[] array = new double[resultLength]; for (int i = 0, j = 0; i < resultLength; i += 2, j = Utils.incMod(j, value.getLength())) { @@ -162,7 +150,6 @@ public abstract class RepeatLength extends RBuiltinNode { @Specialization protected RList repLen(RList list, int length) { - controlVisibility(); Object[] data = new Object[length]; for (int i = 0; i < length; i++) { data[i] = list.getDataAt(i % list.getLength()); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Return.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Return.java index 73ed1270ee..10b9a6dbf3 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Return.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Return.java @@ -76,7 +76,6 @@ public abstract class Return extends RBuiltinNode { @Specialization protected Object returnFunction(VirtualFrame frame, RPromise expr) { - controlVisibility(); // Evaluate the result Object value = initPromiseHelper().evaluate(frame, expr); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Rhome.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Rhome.java index 0c71364b2f..e4c97dd351 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Rhome.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Rhome.java @@ -39,7 +39,6 @@ public abstract class Rhome extends RBuiltinNode { @Specialization @TruffleBoundary protected String doRhome() { - controlVisibility(); return REnvVars.rHome(); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Rm.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Rm.java index 787d7d8ff6..fe2650e98b 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Rm.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Rm.java @@ -51,7 +51,6 @@ public abstract class Rm extends RBuiltinNode { @Specialization @SuppressWarnings("unused") protected Object rm(VirtualFrame frame, String name, RMissing envir, byte inherits) { - controlVisibility(); removeFromFrame(frame, name); return RNull.instance; } @@ -60,7 +59,6 @@ public abstract class Rm extends RBuiltinNode { @TruffleBoundary @SuppressWarnings("unused") protected Object rm(RAbstractStringVector list, REnvironment envir, byte inherits) { - controlVisibility(); try { for (int i = 0; i < list.getLength(); i++) { if (envir == REnvironment.globalEnv()) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Round.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Round.java index 4ff244c3d0..62cdc8b928 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Round.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Round.java @@ -66,35 +66,30 @@ public abstract class Round extends RBuiltinNode { @Specialization protected double round(int x, @SuppressWarnings("unused") int digits) { - controlVisibility(); check.enable(x); return check.check(x) ? RRuntime.DOUBLE_NA : x; } @Specialization protected double round(byte x, @SuppressWarnings("unused") int digits) { - controlVisibility(); check.enable(x); return check.check(x) ? RRuntime.DOUBLE_NA : x; } @Specialization(guards = "digits == 0") protected double round(double x, @SuppressWarnings("unused") int digits) { - controlVisibility(); check.enable(x); return check.check(x) ? RRuntime.DOUBLE_NA : roundOp.op(x); } @Specialization(guards = "digits != 0") protected double roundDigits(double x, int digits) { - controlVisibility(); check.enable(x); return check.check(x) ? RRuntime.DOUBLE_NA : roundOp.opd(x, digits); } @Specialization(guards = "digits == 0") protected RDoubleVector round(RAbstractDoubleVector x, int digits) { - controlVisibility(); double[] result = new double[x.getLength()]; check.enable(x); for (int i = 0; i < x.getLength(); i++) { @@ -108,7 +103,6 @@ public abstract class Round extends RBuiltinNode { @Specialization(guards = "digits != 0") protected RDoubleVector roundDigits(RAbstractDoubleVector x, int digits) { - controlVisibility(); double[] result = new double[x.getLength()]; check.enable(x); for (int i = 0; i < x.getLength(); i++) { @@ -122,21 +116,18 @@ public abstract class Round extends RBuiltinNode { @Specialization(guards = "digits == 0") protected RComplex round(RComplex x, @SuppressWarnings("unused") int digits) { - controlVisibility(); check.enable(x); return check.check(x) ? RComplex.createNA() : roundOp.op(x.getRealPart(), x.getImaginaryPart()); } @Specialization(guards = "digits != 0") protected RComplex roundDigits(RComplex x, int digits) { - controlVisibility(); check.enable(x); return check.check(x) ? RComplex.createNA() : roundOp.opd(x.getRealPart(), x.getImaginaryPart(), digits); } @Specialization(guards = "digits == 0") protected RComplexVector round(RAbstractComplexVector x, int digits) { - controlVisibility(); double[] result = new double[x.getLength() << 1]; check.enable(x); for (int i = 0; i < x.getLength(); i++) { @@ -153,7 +144,6 @@ public abstract class Round extends RBuiltinNode { @Specialization(guards = "digits != 0") protected RComplexVector roundDigits(RAbstractComplexVector x, int digits) { - controlVisibility(); double[] result = new double[x.getLength() << 1]; check.enable(x); for (int i = 0; i < x.getLength(); i++) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Row.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Row.java index ac113170cc..b27734df00 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Row.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Row.java @@ -29,7 +29,6 @@ public abstract class Row extends RBuiltinNode { @Specialization protected RIntVector col(RAbstractIntVector x) { - controlVisibility(); int nrows = x.getDataAt(0); int ncols = x.getDataAt(1); int[] result = new int[nrows * ncols]; @@ -44,7 +43,6 @@ public abstract class Row extends RBuiltinNode { @Specialization @TruffleBoundary protected RIntVector col(@SuppressWarnings("unused") RNull x) { - controlVisibility(); throw RError.error(this, RError.Message.MATRIX_LIKE_REQUIRED, "row"); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RowMeans.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RowMeans.java index 2947005cf8..967f32b5da 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RowMeans.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RowMeans.java @@ -42,7 +42,6 @@ public abstract class RowMeans extends RBuiltinNode { @Specialization(guards = "!isNaRm(naRm)") @TruffleBoundary protected RDoubleVector rowMeansNaRmFalse(RDoubleVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[rowNum]; boolean isComplete = true; na.enable(x); @@ -69,7 +68,6 @@ public abstract class RowMeans extends RBuiltinNode { @Specialization(guards = "isNaRm(naRm)") @TruffleBoundary protected RDoubleVector rowMeansNaRmTrue(RDoubleVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[rowNum]; boolean isComplete = true; na.enable(x); @@ -96,7 +94,6 @@ public abstract class RowMeans extends RBuiltinNode { @Specialization(guards = "!isNaRm(naRm)") @TruffleBoundary protected RDoubleVector rowMeansNaRmFalse(RLogicalVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[rowNum]; na.enable(x); nextRow: for (int i = 0; i < rowNum; i++) { @@ -117,7 +114,6 @@ public abstract class RowMeans extends RBuiltinNode { @Specialization(guards = "isNaRm(naRm)") @TruffleBoundary protected RDoubleVector rowMeansNaRmTrue(RLogicalVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[rowNum]; boolean isComplete = true; na.enable(x); @@ -144,7 +140,6 @@ public abstract class RowMeans extends RBuiltinNode { @Specialization(guards = "!isNaRm(naRm)") @TruffleBoundary protected RDoubleVector rowMeansNaRmFalse(RIntVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[rowNum]; na.enable(x); nextRow: for (int i = 0; i < rowNum; i++) { @@ -165,7 +160,6 @@ public abstract class RowMeans extends RBuiltinNode { @Specialization(guards = "isNaRm(naRm)") @TruffleBoundary protected RDoubleVector rowMeansNaRmTrue(RIntVector x, int rowNum, int colNum, @SuppressWarnings("unused") byte naRm) { - controlVisibility(); double[] result = new double[rowNum]; boolean isComplete = true; na.enable(x); @@ -192,7 +186,6 @@ public abstract class RowMeans extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected RDoubleVector rowMeans(RAbstractStringVector x, int rowNum, int colNum, byte naRm) { - controlVisibility(); CompilerDirectives.transferToInterpreter(); throw RError.error(this, RError.Message.X_NUMERIC); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RowSums.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RowSums.java index 95055c62f1..948f87db7f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RowSums.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/RowSums.java @@ -59,7 +59,6 @@ public abstract class RowSums extends RBuiltinNode { } private <T extends RAbstractVector> RDoubleVector performSums(T x, int rowNum, int colNum, byte naRm, GetFunction<T> get) { - controlVisibility(); reportWork(x.getLength()); double[] result = new double[rowNum]; final boolean rna = removeNA.profile(naRm == RRuntime.LOGICAL_TRUE); @@ -128,7 +127,6 @@ public abstract class RowSums extends RBuiltinNode { @Specialization @TruffleBoundary protected RDoubleVector rowSums(RAbstractStringVector x, int rowNum, int colNum, byte naRm) { - controlVisibility(); throw RError.error(this, RError.Message.X_NUMERIC); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/S3DispatchFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/S3DispatchFunctions.java index 72afd92f50..c1d1151657 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/S3DispatchFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/S3DispatchFunctions.java @@ -107,7 +107,6 @@ public abstract class S3DispatchFunctions extends RBuiltinNode { @Specialization protected Object execute(VirtualFrame frame, String generic, Object arg) { - controlVisibility(); Object dispatchedObject; if (argMissingProfile.profile(arg == RMissing.instance)) { @@ -199,7 +198,6 @@ public abstract class S3DispatchFunctions extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected Object nextMethod(VirtualFrame frame, String generic, Object obj, RArgsValuesAndNames args) { - controlVisibility(); MaterializedFrame genericCallFrame = getCallFrame(frame); MaterializedFrame genericDefFrame = getDefFrame(frame); String group = (String) rvnGroup.execute(frame); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Seq.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Seq.java index 01d37a4c83..b7e82fcee7 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Seq.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Seq.java @@ -44,7 +44,6 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractDoubleVector; import com.oracle.truffle.r.runtime.data.model.RAbstractIntVector; import com.oracle.truffle.r.runtime.data.model.RAbstractLogicalVector; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; -import com.oracle.truffle.r.runtime.nodes.RNode; import com.oracle.truffle.r.runtime.ops.na.NACheck; @RBuiltin(name = "seq.default", aliases = {"seq.int"}, kind = SUBSTITUTE, parameterNames = {"from", "to", "by", "length.out", "along.with"}) @@ -181,7 +180,6 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = "!startEmpty(start)") protected RIntSequence seqFromOneArg(RAbstractIntVector start, RMissing to, RMissing stride, RMissing lengthOut, RMissing alongWith) { validateParam(start.getDataAt(0), "to"); - controlVisibility(); // GNU R really does that (take the length of start to create a sequence) return RDataFactory.createIntSequence(1, 1, start.getLength()); } @@ -193,28 +191,24 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "!lengthZero(lengthOut)"}) protected RDoubleSequence seq(RAbstractIntVector start, RMissing to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createDoubleSequence(RRuntime.int2double(start.getDataAt(0)), 1, lengthOut); } @Specialization(guards = {"startLengthOne(start)", "!lengthZero(lengthOut)"}) protected RDoubleSequence seq(RAbstractIntVector start, RMissing to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createDoubleSequence(RRuntime.int2double(start.getDataAt(0)), 1, (int) Math.ceil(lengthOut)); } @Specialization(guards = {"startLengthOne(start)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractIntVector start, RMissing to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractIntVector start, RMissing to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createEmptyIntVector(); } @@ -223,13 +217,11 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "zero(start, to)"}) protected int seqZero(RAbstractIntVector start, RAbstractIntVector to, Object stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); return 0; } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RIntSequence seq(RAbstractIntVector start, RAbstractIntVector to, RMissing stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createIntSequence(start.getDataAt(0), ascending(start, to) ? 1 : -1, Math.abs(to.getDataAt(0) - start.getDataAt(0)) + 1); } @@ -237,55 +229,47 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RIntSequence seq(RAbstractIntVector start, RAbstractIntVector to, int stride, RMissing lengthOut, RMissing alongWith) { validateParams(start, to); - controlVisibility(); return RDataFactory.createIntSequence(start.getDataAt(0), stride, Math.abs((to.getDataAt(0) - start.getDataAt(0)) / stride) + 1); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RDoubleSequence seq(RAbstractIntVector start, RAbstractIntVector to, double stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createDoubleSequence(RRuntime.int2double(start.getDataAt(0)), stride, (int) (Math.abs((to.getDataAt(0) - start.getDataAt(0)) / stride)) + 1); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!lengthZero(lengthOut)"}) protected RIntVector seq(RAbstractIntVector start, RAbstractIntVector to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return getVectorWithComputedStride(start.getDataAt(0), to.getDataAt(0), RRuntime.int2double(lengthOut), ascending(start, to)); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!lengthZero(lengthOut)"}) protected RIntVector seq(RAbstractIntVector start, RAbstractIntVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return getVectorWithComputedStride(start.getDataAt(0), to.getDataAt(0), lengthOut, ascending(start, to)); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractIntVector start, RAbstractIntVector to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractIntVector start, RAbstractIntVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "lengthZeroAlong(alongWith)"}) protected RIntVector seq(RAbstractIntVector start, RMissing to, RMissing stride, Object lengthOut, RAbstractVector alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "!lengthZeroAlong(alongWith)"}) protected RDoubleSequence seqLengthZero(RAbstractIntVector start, RMissing to, RMissing stride, Object lengthOut, RAbstractVector alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createDoubleSequence(start.getDataAt(0), 1, alongWith.getLength()); } @@ -294,20 +278,17 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "zero(start, to)"}) protected int seqZero(RAbstractIntVector start, RAbstractDoubleVector to, Object stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); return 0; } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RIntSequence seq(RAbstractIntVector start, RAbstractDoubleVector to, RMissing stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createIntSequence(start.getDataAt(0), ascending(start, to) ? 1 : -1, (int) Math.abs(to.getDataAt(0) - start.getDataAt(0)) + 1); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RDoubleSequence seq(RAbstractIntVector start, RAbstractDoubleVector to, int stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); int length = (int) Math.abs(to.getDataAt(0) - start.getDataAt(0)) / stride; if (start.getDataAt(0) + length * stride == to.getDataAt(0)) { @@ -318,7 +299,6 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RDoubleSequence seq(RAbstractIntVector start, RAbstractDoubleVector to, double stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); int length = (int) (Math.abs(to.getDataAt(0) - start.getDataAt(0)) / stride); if (start.getDataAt(0) + length * stride == to.getDataAt(0)) { @@ -329,28 +309,24 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractIntVector start, RAbstractDoubleVector to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!lengthZero(lengthOut)"}) protected RDoubleVector seq(RAbstractIntVector start, RAbstractDoubleVector to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return getVectorWithComputedStride(RRuntime.int2double(start.getDataAt(0)), to.getDataAt(0), lengthOut, ascending(start, to)); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractIntVector start, RAbstractDoubleVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!lengthZero(lengthOut)"}) protected RDoubleVector seq(RAbstractIntVector start, RAbstractDoubleVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return getVectorWithComputedStride(RRuntime.int2double(start.getDataAt(0)), to.getDataAt(0), lengthOut, ascending(start, to)); } @@ -359,7 +335,6 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = "!startEmpty(start)") protected RDoubleSequence seqFromOneArg(RAbstractDoubleVector start, RMissing to, RMissing stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); // GNU R really does that (take the length of start to create a sequence) return RDataFactory.createDoubleSequence(1, 1, start.getLength()); @@ -372,42 +347,36 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "!lengthZero(lengthOut)"}) protected RDoubleSequence seqLengthZero(RAbstractDoubleVector start, RMissing to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createDoubleSequence(start.getDataAt(0), 1, lengthOut); } @Specialization(guards = {"startLengthOne(start)", "!lengthZero(lengthOut)"}) protected RDoubleSequence seqLengthZero(RAbstractDoubleVector start, RMissing to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createDoubleSequence(start.getDataAt(0), 1, (int) Math.ceil(lengthOut)); } @Specialization(guards = {"startLengthOne(start)", "lengthZero(lengthOut)"}) protected RIntVector seq(RAbstractDoubleVector start, RMissing to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "lengthZero(lengthOut)"}) protected RIntVector seq(RAbstractDoubleVector start, RMissing to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "lengthZeroAlong(alongWith)"}) protected RIntVector seq(RAbstractDoubleVector start, RMissing to, RMissing stride, Object lengthOut, RAbstractVector alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "!lengthZeroAlong(alongWith)"}) protected RDoubleSequence seqLengthZero(RAbstractDoubleVector start, RMissing to, RMissing stride, Object lengthOut, RAbstractVector alongWith) { - controlVisibility(); validateParam(start.getDataAt(0), "from"); return RDataFactory.createDoubleSequence(start.getDataAt(0), 1, alongWith.getLength()); } @@ -416,13 +385,11 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "zero(start, to)"}) protected int seqZero(RAbstractDoubleVector start, RAbstractIntVector to, Object stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); return 0; } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RAbstractVector seq(RAbstractDoubleVector start, RAbstractIntVector to, RMissing stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); if ((int) start.getDataAt(0) == start.getDataAt(0)) { return RDataFactory.createIntSequence((int) start.getDataAt(0), ascending(start, to) ? 1 : -1, (int) (Math.abs(to.getDataAt(0) - start.getDataAt(0)) + 1)); @@ -433,42 +400,36 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RDoubleSequence seq(RAbstractDoubleVector start, RAbstractIntVector to, int stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createDoubleSequence(start.getDataAt(0), stride, (int) Math.abs((to.getDataAt(0) - start.getDataAt(0)) / stride) + 1); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RDoubleSequence seq(RAbstractDoubleVector start, RAbstractIntVector to, double stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createDoubleSequence(start.getDataAt(0), stride, (int) Math.abs((to.getDataAt(0) - start.getDataAt(0)) / stride) + 1); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractDoubleVector start, RAbstractIntVector to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!lengthZero(lengthOut)"}) protected RDoubleVector seq(RAbstractDoubleVector start, RAbstractIntVector to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return getVectorWithComputedStride(start.getDataAt(0), RRuntime.int2double(to.getDataAt(0)), lengthOut, ascending(start, to)); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractDoubleVector start, RAbstractIntVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!lengthZero(lengthOut)"}) protected RDoubleVector seq(RAbstractDoubleVector start, RAbstractIntVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return getVectorWithComputedStride(start.getDataAt(0), RRuntime.int2double(to.getDataAt(0)), lengthOut, ascending(start, to)); } @@ -477,13 +438,11 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "zero(start, to)"}) protected double seq(RAbstractDoubleVector start, RAbstractDoubleVector to, Object stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); return 0; } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RAbstractVector seq(RAbstractDoubleVector start, RAbstractDoubleVector to, RMissing stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); if ((int) start.getDataAt(0) == start.getDataAt(0) && (int) to.getDataAt(0) == to.getDataAt(0)) { return RDataFactory.createIntSequence((int) start.getDataAt(0), ascending(start, to) ? 1 : -1, (int) (Math.abs(to.getDataAt(0) - start.getDataAt(0)) + 1)); @@ -494,42 +453,36 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RDoubleSequence seq(RAbstractDoubleVector start, RAbstractDoubleVector to, int stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createDoubleSequence(start.getDataAt(0), stride, (int) (Math.abs((to.getDataAt(0) - start.getDataAt(0)) / stride) + 1)); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!zero(start, to)"}) protected RDoubleSequence seq(RAbstractDoubleVector start, RAbstractDoubleVector to, double stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createDoubleSequence(start.getDataAt(0), stride, (int) (Math.abs((to.getDataAt(0) - start.getDataAt(0)) / stride) + 1)); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!lengthZero(lengthOut)"}) protected RDoubleVector seq(RAbstractDoubleVector start, RAbstractDoubleVector to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return getVectorWithComputedStride(start.getDataAt(0), to.getDataAt(0), RRuntime.int2double(lengthOut), ascending(start, to)); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractDoubleVector start, RAbstractDoubleVector to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "!lengthZero(lengthOut)"}) protected RDoubleVector seq(RAbstractDoubleVector start, RAbstractDoubleVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return getVectorWithComputedStride(start.getDataAt(0), to.getDataAt(0), lengthOut, ascending(start, to)); } @Specialization(guards = {"startLengthOne(start)", "toLengthOne(to)", "lengthZero(lengthOut)"}) protected RIntVector seqLengthZero(RAbstractDoubleVector start, RAbstractDoubleVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParams(start, to); return RDataFactory.createEmptyIntVector(); } @@ -634,50 +587,42 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = "lengthZero(lengthOut)") protected RIntVector seqLengthZero(RMissing start, RMissing to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = "!lengthZero(lengthOut)") protected RIntSequence seq(RMissing start, RMissing to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); return RDataFactory.createIntSequence(1, 1, lengthOut); } @Specialization(guards = "lengthZero(lengthOut)") protected RIntVector seqLengthZero(RMissing start, RMissing to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = "!lengthZero(lengthOut)") protected RIntSequence seq(RMissing start, RMissing to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); return RDataFactory.createIntSequence(1, 1, (int) Math.ceil(lengthOut)); } @Specialization(guards = "lengthZeroAlong(alongWith)") protected RIntVector seqLengthZeroAlong(RMissing start, RMissing to, RMissing stride, Object lengthOut, RAbstractVector alongWith) { - controlVisibility(); return RDataFactory.createEmptyIntVector(); } @Specialization(guards = "!lengthZeroAlong(alongWith)") protected RIntSequence seq(RMissing start, RMissing to, RMissing stride, Object lengthOut, RAbstractVector alongWith) { - controlVisibility(); return RDataFactory.createIntSequence(1, 1, alongWith.getLength()); } @Specialization(guards = {"toLengthOne(to)", "positiveLengthOut(lengthOut)"}) protected RDoubleSequence seq(RMissing start, RAbstractIntVector to, RMissing stride, int lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(to.getDataAt(0), "to"); return RDataFactory.createDoubleSequence(to.getDataAt(0) - lengthOut + 1, 1, lengthOut); } @Specialization(guards = {"toLengthOne(to)", "positiveLengthOut(lengthOut)"}) protected RDoubleSequence seq(RMissing start, RAbstractIntVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(to.getDataAt(0), "to"); final int intLength = (int) Math.ceil(lengthOut); return RDataFactory.createDoubleSequence(to.getDataAt(0) - intLength + 1, 1, intLength); @@ -685,14 +630,12 @@ public abstract class Seq extends RBuiltinNode { @Specialization(guards = {"toLengthOne(to)", "positiveLengthOut(lengthOut)"}) protected RDoubleSequence seq(RMissing start, RAbstractDoubleVector to, RMissing stride, double lengthOut, RMissing alongWith) { - controlVisibility(); validateParam(to.getDataAt(0), "to"); return RDataFactory.createDoubleSequence(to.getDataAt(0) - lengthOut + 1, 1, (int) Math.ceil(lengthOut)); } @Specialization(guards = "toLengthOne(to)") protected Object seq(RMissing start, RAbstractVector to, Object stride, RMissing lengthOut, RMissing alongWith) { - controlVisibility(); return seqRecursive(1.0, to, stride, lengthOut, alongWith); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqAlong.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqAlong.java index b425b1fefd..0ad14b4b81 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqAlong.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqAlong.java @@ -40,7 +40,6 @@ public abstract class SeqAlong extends RBuiltinNode { @Specialization protected RIntSequence seq(VirtualFrame frame, Object value) { - controlVisibility(); return RDataFactory.createIntSequence(1, 1, length.executeInteger(frame, value)); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqLen.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqLen.java index 469b929d94..2f669612d1 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqLen.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqLen.java @@ -53,7 +53,6 @@ public abstract class SeqLen extends RBuiltinNode { throw RError.error(this, RError.Message.MUST_BE_COERCIBLE_INTEGER); } } - controlVisibility(); return RDataFactory.createIntSequence(1, 1, length.getDataAt(0)); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SerializeFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SerializeFunctions.java index c7736043f2..c7afe2281b 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SerializeFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SerializeFunctions.java @@ -46,7 +46,6 @@ public class SerializeFunctions { public abstract static class Adapter extends RBuiltinNode { @TruffleBoundary protected Object doUnserializeFromConnBase(RConnection conn, @SuppressWarnings("unused") REnvironment refhook) { - controlVisibility(); try (RConnection openConn = conn.forceOpen("rb")) { if (!openConn.canRead()) { throw RError.error(this, RError.Message.CONNECTION_NOT_OPEN_READ); @@ -60,14 +59,12 @@ public class SerializeFunctions { @TruffleBoundary protected Object doUnserializeFromRaw(RAbstractRawVector data, @SuppressWarnings("unused") REnvironment refhook) { - controlVisibility(); return RSerialize.unserialize(data); } @TruffleBoundary protected Object doSerializeToConnBase(Object object, RConnection conn, int type, @SuppressWarnings("unused") byte xdrLogical, @SuppressWarnings("unused") RNull version, @SuppressWarnings("unused") RNull refhook) { - controlVisibility(); // xdr is only relevant if ascii is false try (RConnection openConn = conn.forceOpen(type != RSerialize.XDR ? "wt" : "wb")) { if (!openConn.canWrite()) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Setwd.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Setwd.java index 0dabfcb2c1..f7eecbebc2 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Setwd.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Setwd.java @@ -41,7 +41,6 @@ public abstract class Setwd extends RBuiltinNode { @Specialization @TruffleBoundary protected Object setwd(RAbstractStringVector path) { - controlVisibility(); if (path.getLength() == 0) { throw RError.error(this, RError.Message.CHAR_ARGUMENT); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ShortRowNames.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ShortRowNames.java index b951b82727..25d30eb770 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ShortRowNames.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ShortRowNames.java @@ -59,7 +59,6 @@ public abstract class ShortRowNames extends RBuiltinNode { @Specialization protected Object getNames(Object originalOperand, RAbstractIntVector originalType) { - controlVisibility(); if (originalType.getLength() == 0) { errorProfile.enter(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Signif.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Signif.java index 745241b9a8..e686e2646a 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Signif.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Signif.java @@ -67,7 +67,6 @@ public abstract class Signif extends RBuiltinNode { @Specialization(guards = "digitsVec.getLength() == 1") protected RAbstractDoubleVector signif(RAbstractDoubleVector x, RAbstractIntVector digitsVec) { - controlVisibility(); int digits = digitsVec.getDataAt(0) <= 0 ? 1 : digitsVec.getDataAt(0); if (digits > 22) { identity.enter(); @@ -102,7 +101,6 @@ public abstract class Signif extends RBuiltinNode { @Specialization(guards = "digits.getLength() == 1") protected RAbstractIntVector roundDigits(RAbstractIntVector x, @SuppressWarnings("unused") RAbstractIntVector digits) { - controlVisibility(); return x; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SinkFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SinkFunctions.java index e166daa888..f4aeb23209 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SinkFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SinkFunctions.java @@ -49,7 +49,6 @@ public class SinkFunctions { } else { StdConnections.pushDivertOut(conn, RRuntime.fromLogical(closeOnExit)); } - controlVisibility(); return RNull.instance; } @@ -61,7 +60,6 @@ public class SinkFunctions { } catch (IOException ex) { throw RError.error(this, RError.Message.GENERIC, ex.getMessage()); } - controlVisibility(); return RNull.instance; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Sprintf.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Sprintf.java index 9e61fd29ee..21bbbae3be 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Sprintf.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Sprintf.java @@ -52,7 +52,6 @@ public abstract class Sprintf extends RBuiltinNode { @Specialization protected String sprintf(String fmt, @SuppressWarnings("unused") RMissing x) { - controlVisibility(); return fmt; } @@ -65,7 +64,6 @@ public abstract class Sprintf extends RBuiltinNode { @Specialization @TruffleBoundary protected String sprintf(String fmt, int x) { - controlVisibility(); return format(fmt, x); } @@ -78,14 +76,12 @@ public abstract class Sprintf extends RBuiltinNode { @Specialization(guards = "fmtLengthOne(fmt)") @TruffleBoundary protected String sprintf(RAbstractStringVector fmt, byte x) { - controlVisibility(); return format(fmt.getDataAt(0), x); } @Specialization @TruffleBoundary protected RStringVector sprintf(String fmt, RAbstractIntVector x) { - controlVisibility(); String[] r = new String[x.getLength()]; for (int k = 0; k < r.length; k++) { r[k] = format(fmt, x.getDataAt(k)); @@ -102,7 +98,6 @@ public abstract class Sprintf extends RBuiltinNode { @Specialization @TruffleBoundary protected String sprintf(String fmt, double x) { - controlVisibility(); char f = Character.toLowerCase(firstFormatChar(fmt)); if (f == 'x' || f == 'd') { if (Math.floor(x) == x) { @@ -122,7 +117,6 @@ public abstract class Sprintf extends RBuiltinNode { @Specialization @TruffleBoundary protected RStringVector sprintf(String fmt, RAbstractDoubleVector x) { - controlVisibility(); String[] r = new String[x.getLength()]; for (int k = 0; k < r.length; k++) { r[k] = sprintf(fmt, x.getDataAt(k)); @@ -139,7 +133,6 @@ public abstract class Sprintf extends RBuiltinNode { @Specialization @TruffleBoundary protected String sprintf(String fmt, String x) { - controlVisibility(); return format(fmt, x); } @@ -152,7 +145,6 @@ public abstract class Sprintf extends RBuiltinNode { @Specialization @TruffleBoundary protected RStringVector sprintf(String fmt, RAbstractStringVector x) { - controlVisibility(); String[] r = new String[x.getLength()]; for (int k = 0; k < r.length; k++) { r[k] = format(fmt, x.getDataAt(k)); @@ -203,7 +195,6 @@ public abstract class Sprintf extends RBuiltinNode { @Specialization(guards = "!oneElement(args)") @TruffleBoundary protected RStringVector sprintf(String fmt, RArgsValuesAndNames args) { - controlVisibility(); Object[] values = args.getArguments(); int maxLength = maxLengthAndConvertToScalar(values); if (maxLength == 0) { @@ -225,7 +216,6 @@ public abstract class Sprintf extends RBuiltinNode { @Specialization(guards = "oneElement(args)") protected Object sprintfOneElement(VirtualFrame frame, String fmt, RArgsValuesAndNames args) { - controlVisibility(); if (sprintfRecursive == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); sprintfRecursive = insert(SprintfNodeGen.create(null)); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/StandardGeneric.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/StandardGeneric.java index c9bf2eac78..a1e7b3c426 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/StandardGeneric.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/StandardGeneric.java @@ -71,7 +71,6 @@ public abstract class StandardGeneric extends RBuiltinNode { private final RAttributeProfiles attrProfiles = RAttributeProfiles.create(); private Object stdGenericInternal(VirtualFrame frame, RAbstractStringVector fVec, RFunction fdef) { - controlVisibility(); String fname = fVec.getDataAt(0); MaterializedFrame fnFrame = fdef.getEnclosingFrame(); REnvironment mtable = (REnvironment) readMTableFirst.execute(frame, fnFrame); @@ -161,13 +160,11 @@ public abstract class StandardGeneric extends RBuiltinNode { return fnObj; } } - controlVisibility(); throw RError.error(this, RError.Message.STD_GENERIC_WRONG_CALL, fname); } @Specialization protected Object stdGeneric(Object fVec, RAttributable fdef) { - controlVisibility(); if (!(fVec instanceof String || (fVec instanceof RAbstractStringVector && ((RAbstractStringVector) fVec).getLength() > 0))) { throw RError.error(this, RError.Message.GENERIC, "argument to 'standardGeneric' must be a non-empty character string"); } else { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Stop.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Stop.java index abac25642c..2a48b87c6c 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Stop.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Stop.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ public abstract class Stop extends RBuiltinNode { @Specialization protected Object stop(byte call, RAbstractStringVector msgVec) { - controlVisibility(); assert msgVec.getLength() == 1; CompilerDirectives.transferToInterpreter(); throw RError.stop(RRuntime.fromLogical(call), this, RError.Message.GENERIC, msgVec.getDataAt(0)); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Substitute.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Substitute.java index 5c36c8c94b..1a81321a5e 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Substitute.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Substitute.java @@ -69,19 +69,16 @@ public abstract class Substitute extends RBuiltinNode { @Specialization protected Object doSubstitute(VirtualFrame frame, RPromise expr, @SuppressWarnings("unused") RMissing envMissing) { - controlVisibility(); return doSubstituteWithEnv(frame, expr, null); } @Specialization protected Object doSubstitute(VirtualFrame frame, RPromise expr, REnvironment env) { - controlVisibility(); return doSubstituteWithEnv(frame, expr, env); } @Specialization protected Object doSubstitute(VirtualFrame frame, RPromise expr, RList list) { - controlVisibility(); return doSubstituteWithEnv(frame, expr, REnvironment.createFromList(attrProfiles, list, REnvironment.baseEnv())); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Substr.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Substr.java index 2599527b15..72eed00d2c 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Substr.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Substr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,6 @@ public abstract class Substr extends RBuiltinNode { @SuppressWarnings("unused") @Specialization(guards = "emptyArg(arg)") protected RStringVector substrEmptyArg(VirtualFrame frame, RAbstractStringVector arg, RAbstractIntVector start, RAbstractIntVector stop) { - controlVisibility(); return RDataFactory.createEmptyStringVector(); } @@ -62,7 +61,6 @@ public abstract class Substr extends RBuiltinNode { @Specialization(guards = {"!emptyArg(arg)", "!wrongParams(start, stop)"}) protected RStringVector substr(RAbstractStringVector arg, RAbstractIntVector start, RAbstractIntVector stop) { - controlVisibility(); String[] res = new String[arg.getLength()]; na.enable(arg); na.enable(start); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Switch.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Switch.java index 702a8f7f0a..92a0c13ca4 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Switch.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Switch.java @@ -56,7 +56,6 @@ public abstract class Switch extends RBuiltinNode { @Specialization protected Object doSwitch(VirtualFrame frame, RAbstractStringVector x, RArgsValuesAndNames optionalArgs) { - controlVisibility(); if (x.getLength() != 1) { throw RError.error(this, RError.Message.EXPR_NOT_LENGTH_ONE); } @@ -64,7 +63,6 @@ public abstract class Switch extends RBuiltinNode { } private Object doSwitchString(VirtualFrame frame, RAbstractStringVector x, RArgsValuesAndNames optionalArgs) { - controlVisibility(); Object[] optionalArgValues = optionalArgs.getArguments(); final String xStr = x.getDataAt(0); ArgumentsSignature signature = optionalArgs.getSignature(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SysFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SysFunctions.java index 8bc3135757..39ca4130be 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SysFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SysFunctions.java @@ -37,7 +37,6 @@ import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; import com.oracle.truffle.r.nodes.builtin.RBuiltinPackages; -import com.oracle.truffle.r.nodes.builtin.RInvisibleBuiltinNode; import com.oracle.truffle.r.runtime.RArguments; import com.oracle.truffle.r.runtime.RBuiltin; import com.oracle.truffle.r.runtime.REnvVars; @@ -64,7 +63,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected Object sysGetPid() { - controlVisibility(); int pid = RFFIFactory.getRFFI().getBaseRFFI().getpid(); return RDataFactory.createIntVectorFromScalar(pid); } @@ -77,7 +75,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected Object sysGetEnv(RAbstractStringVector x, RAbstractStringVector unset) { - controlVisibility(); Map<String, String> envMap = RContext.getInstance().stateREnvVars.getMap(); int len = x.getLength(); if (zeroLengthProfile.profile(len == 0)) { @@ -110,7 +107,6 @@ public class SysFunctions { @Specialization protected Object sysGetEnvGeneric(@SuppressWarnings("unused") Object x, @SuppressWarnings("unused") Object unset) { - controlVisibility(); CompilerDirectives.transferToInterpreter(); throw RError.error(this, RError.Message.WRONG_TYPE); } @@ -192,7 +188,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected Object sysSleep(double seconds) { - controlVisibility(); sleep(convertToMillis(seconds)); return RNull.instance; } @@ -200,7 +195,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected Object sysSleep(String secondsString) { - controlVisibility(); long millis = convertToMillis(checkValidString(secondsString)); sleep(millis); return RNull.instance; @@ -209,7 +203,6 @@ public class SysFunctions { @Specialization(guards = "lengthOne(secondsVector)") @TruffleBoundary protected Object sysSleep(RStringVector secondsVector) { - controlVisibility(); long millis = convertToMillis(checkValidString(secondsVector.getDataAt(0))); sleep(millis); return RNull.instance; @@ -222,7 +215,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected Object sysSleep(@SuppressWarnings("unused") Object arg) { - controlVisibility(); throw RError.error(this, RError.Message.INVALID_VALUE, "time"); } @@ -256,14 +248,12 @@ public class SysFunctions { @Specialization @TruffleBoundary protected Object sysReadlink(String path) { - controlVisibility(); return RDataFactory.createStringVector(doSysReadLink(path)); } @Specialization @TruffleBoundary protected Object sysReadlink(RStringVector vector) { - controlVisibility(); String[] paths = new String[vector.getLength()]; boolean complete = RDataFactory.COMPLETE_VECTOR; for (int i = 0; i < paths.length; i++) { @@ -296,7 +286,6 @@ public class SysFunctions { @Specialization protected Object sysReadlinkGeneric(@SuppressWarnings("unused") Object path) { - controlVisibility(); CompilerDirectives.transferToInterpreter(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "paths"); } @@ -308,7 +297,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected RLogicalVector sysChmod(RAbstractStringVector pathVec, RAbstractIntVector octmode, @SuppressWarnings("unused") byte useUmask) { - controlVisibility(); byte[] data = new byte[pathVec.getLength()]; for (int i = 0; i < data.length; i++) { String path = Utils.tildeExpand(pathVec.getDataAt(i)); @@ -329,7 +317,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected Object sysChmod(Object octmode) { - controlVisibility(); throw RError.nyi(this, "Sys.umask"); } } @@ -339,7 +326,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected double sysTime() { - controlVisibility(); return ((double) System.currentTimeMillis()) / 1000; } } @@ -352,7 +338,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected Object sysTime() { - controlVisibility(); UtsName utsname = RFFIFactory.getRFFI().getBaseRFFI().uname(); String[] data = new String[NAMES.length]; data[0] = utsname.sysname(); @@ -375,7 +360,6 @@ public class SysFunctions { @Specialization @TruffleBoundary protected Object sysGlob(RAbstractStringVector pathVec, @SuppressWarnings("unused") byte dirMask) { - controlVisibility(); ArrayList<String> matches = new ArrayList<>(); // Sys.glob closure already called path.expand for (int i = 0; i < pathVec.getLength(); i++) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Tabulate.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Tabulate.java index 829cc8dcc9..6323b0d490 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Tabulate.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Tabulate.java @@ -38,7 +38,6 @@ public abstract class Tabulate extends RBuiltinNode { @Specialization protected RIntVector tabulate(RAbstractIntVector bin, int nBins) { - controlVisibility(); if (RRuntime.isNA(nBins) || nBins < 0) { errorProfile.enter(); throw RError.error(this, RError.Message.INVALID_ARGUMENT, "nbin"); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TempDir.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TempDir.java index 075497373d..e0967508cf 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TempDir.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TempDir.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,6 @@ public abstract class TempDir extends RBuiltinNode { @Specialization protected Object tempdir() { - controlVisibility(); return TempPathName.tempDirPath(); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TempFile.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TempFile.java index 7913b2cc95..cd1126d330 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TempFile.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TempFile.java @@ -50,14 +50,12 @@ public abstract class TempFile extends RBuiltinNode { @Specialization(guards = "tempDir.getLength() == 1") @TruffleBoundary protected RStringVector tempfile(String pattern, RAbstractStringVector tempDir, String fileExt) { - controlVisibility(); return RDataFactory.createStringVector(TempPathName.createNonExistingFilePath(pattern, tempDir.getDataAt(0), fileExt)); } @Specialization @TruffleBoundary protected RStringVector tempfileGeneric(Object pattern, Object tempDir, Object fileExt) { - controlVisibility(); // Now we have RStringVectors of at least length 1 RStringVector[] argVecs = new RStringVector[]{checkVector(pattern, INVALID_PATTERN), checkVector(tempDir, INVALID_TEMPDIR), checkVector(fileExt, INVALID_FILEEXT)}; stringVectorsAmount = argVecs.length; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ToLowerOrUpper.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ToLowerOrUpper.java index 7af932f613..54dc75c3a5 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ToLowerOrUpper.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/ToLowerOrUpper.java @@ -71,7 +71,6 @@ public abstract class ToLowerOrUpper extends RBuiltinNode { @Specialization protected String toLower(String value, // @Cached("create()") NAProfile na) { - controlVisibility(); return na.isNA(value) ? RRuntime.STRING_NA : processElement(value); } @@ -80,7 +79,6 @@ public abstract class ToLowerOrUpper extends RBuiltinNode { @Cached("createCountingProfile()") LoopConditionProfile loopProfile, // @Cached("create()") NACheck na, // @Cached("create()") CopyOfRegAttributesNode copyAttributes) { - controlVisibility(); na.enable(vector); String[] stringVector = new String[vector.getLength()]; loopProfile.profileCounted(vector.getLength()); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TraceFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TraceFunctions.java index 27250f7e28..d6fd1e4e2d 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TraceFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TraceFunctions.java @@ -27,7 +27,6 @@ import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; -import com.oracle.truffle.r.nodes.builtin.RInvisibleBuiltinNode; import com.oracle.truffle.r.nodes.builtin.base.GetFunctionsFactory.GetNodeGen; import com.oracle.truffle.r.nodes.builtin.helpers.TraceHandling; import com.oracle.truffle.r.runtime.RBuiltin; @@ -66,7 +65,6 @@ public class TraceFunctions { @Specialization @TruffleBoundary protected RNull primTrace(RFunction func) { - controlVisibility(); if (!func.isBuiltin()) { TraceHandling.enableTrace(func); } else { @@ -87,7 +85,6 @@ public class TraceFunctions { @Specialization @TruffleBoundary protected RNull primUnTrace(RFunction func) { - controlVisibility(); if (!func.isBuiltin()) { TraceHandling.disableTrace(func); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java index 251a10c98e..3ee3407d91 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java @@ -44,32 +44,27 @@ public abstract class Transpose extends RBuiltinNode { @Specialization protected RNull transpose(RNull value) { - controlVisibility(); return value; } @Specialization protected int transpose(int value) { - controlVisibility(); return value; } @Specialization protected double transpose(double value) { - controlVisibility(); return value; } @Specialization protected byte transpose(byte value) { - controlVisibility(); return value; } @Specialization(guards = "isEmpty2D(vector)") @TruffleBoundary protected RAbstractVector transpose(RAbstractVector vector) { - controlVisibility(); int[] dim = vector.getDimensions(); return vector.copyWithNewDimensions(new int[]{dim[1], dim[0]}); } @@ -77,7 +72,6 @@ public abstract class Transpose extends RBuiltinNode { @Specialization(guards = "!isEmpty2D(vector)") @TruffleBoundary protected RIntVector transpose(RAbstractIntVector vector) { - controlVisibility(); return performAbstractIntVector(vector, vector.isMatrix() ? vector.getDimensions() : new int[]{vector.getLength(), 1}); } @@ -105,7 +99,6 @@ public abstract class Transpose extends RBuiltinNode { @Specialization(guards = "!isEmpty2D(vector)") @TruffleBoundary protected RDoubleVector transpose(RAbstractDoubleVector vector) { - controlVisibility(); return performAbstractDoubleVector(vector, vector.isMatrix() ? vector.getDimensions() : new int[]{vector.getLength(), 1}); } @@ -133,7 +126,6 @@ public abstract class Transpose extends RBuiltinNode { @Specialization(guards = "!isEmpty2D(vector)") @TruffleBoundary protected RStringVector transpose(RAbstractStringVector vector) { - controlVisibility(); return performAbstractStringVector(vector, vector.isMatrix() ? vector.getDimensions() : new int[]{vector.getLength(), 1}); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TrigExpFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TrigExpFunctions.java index 60e290e5d8..2a3a6db54e 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TrigExpFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/TrigExpFunctions.java @@ -101,7 +101,6 @@ public class TrigExpFunctions { @Specialization protected byte isType(@SuppressWarnings("unused") RMissing value) { - controlVisibility(); CompilerDirectives.transferToInterpreter(); throw RError.error(this, RError.Message.ARGUMENTS_PASSED_0_1, getRBuiltin().name()); } @@ -130,14 +129,12 @@ public class TrigExpFunctions { @Specialization protected double trigOp(int x) { - controlVisibility(); na.enable(x); return doFunInt(x); } @Specialization protected double trigOp(double x) { - controlVisibility(); na.enable(x); return doFunDouble(x); } @@ -145,7 +142,6 @@ public class TrigExpFunctions { @Specialization protected RAbstractVector trigOp(RIntVector vector, // @Cached("createCountingProfile()") LoopConditionProfile profile) { - controlVisibility(); int length = vector.getLength(); double[] resultVector = new double[length]; reportWork(length); @@ -160,7 +156,6 @@ public class TrigExpFunctions { @Specialization protected RAbstractVector trigOp(RDoubleVector vector, // @Cached("createCountingProfile()") LoopConditionProfile profile) { - controlVisibility(); int length = vector.getLength(); double[] resultVector = new double[length]; reportWork(length); @@ -635,7 +630,6 @@ public class TrigExpFunctions { private RDoubleVector doFun(int length, IntDoubleFunction yFun, IntDoubleFunction xFun, LoopConditionProfile profile) { - controlVisibility(); double[] resultVector = new double[length]; reportWork(length); profile.profileCounted(length); @@ -653,7 +647,6 @@ public class TrigExpFunctions { @Specialization protected double atan2(double y, double x) { - controlVisibility(); xNACheck.enable(x); yNACheck.enable(y); return doFunDouble(y, x); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UnClass.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UnClass.java index fab24553aa..0011dcfc0c 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UnClass.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UnClass.java @@ -33,7 +33,6 @@ public abstract class UnClass extends RBuiltinNode { @Specialization @TruffleBoundary protected Object unClass(RAbstractVector arg) { - controlVisibility(); if (arg.isObject(attrProfiles)) { objectProfile.enter(); RVector resultVector = arg.materialize(); @@ -49,7 +48,6 @@ public abstract class UnClass extends RBuiltinNode { @Specialization protected Object unClass(RLanguage arg) { - controlVisibility(); if (arg.getClassAttr(attrProfiles) != null) { objectProfile.enter(); RLanguage resultLang = arg; @@ -66,7 +64,6 @@ public abstract class UnClass extends RBuiltinNode { @Specialization protected Object unClass(RS4Object arg) { - controlVisibility(); if (arg.getClassAttr(attrProfiles) != null) { objectProfile.enter(); RS4Object resultS4 = arg; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Unlist.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Unlist.java index 5688b8da13..13ba5ddfb1 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Unlist.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Unlist.java @@ -141,28 +141,24 @@ public abstract class Unlist extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected RNull unlist(RNull vector, byte recursive, byte useNames) { - controlVisibility(); return RNull.instance; } @SuppressWarnings("unused") @Specialization(guards = "!isVectorList(vector)") protected RAbstractVector unlistVector(RAbstractVector vector, byte recursive, byte useNames) { - controlVisibility(); return vector; } @SuppressWarnings("unused") @Specialization(guards = "isEmpty(list)") protected RNull unlistEmptyList(VirtualFrame frame, RList list, byte recursive, byte useNames) { - controlVisibility(); return RNull.instance; } @SuppressWarnings("unused") @Specialization(guards = "isOneNull(list)") protected RNull unlistOneNullList(VirtualFrame frame, RList list, byte recursive, byte useNames) { - controlVisibility(); return RNull.instance; } @@ -170,7 +166,6 @@ public abstract class Unlist extends RBuiltinNode { // the slow path as well; ultimately we may consider (non-recursive) optimization @Specialization(guards = "!isEmpty(list)") protected Object unlistList(VirtualFrame frame, RList list, byte recursive, byte useNames) { - controlVisibility(); boolean isRecursive = RRuntime.fromLogical(recursive); boolean isUseNames = RRuntime.fromLogical(useNames); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateAttr.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateAttr.java index 8638329f94..08ff71f1f4 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateAttr.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateAttr.java @@ -121,7 +121,6 @@ public abstract class UpdateAttr extends RBuiltinNode { @Specialization protected RAbstractContainer updateAttr(RAbstractContainer container, String name, RNull value) { - controlVisibility(); String internedName = intern(name); RAbstractContainer result = (RAbstractContainer) container.getNonShared(); // the name is interned, so identity comparison is sufficient @@ -154,7 +153,6 @@ public abstract class UpdateAttr extends RBuiltinNode { @Specialization(guards = "!nullValue(value)") protected RAbstractContainer updateAttr(RAbstractContainer container, String name, Object value) { - controlVisibility(); String internedName = intern(name); RAbstractContainer result = (RAbstractContainer) container.getNonShared(); // the name is interned, so identity comparison is sufficient @@ -183,7 +181,6 @@ public abstract class UpdateAttr extends RBuiltinNode { @Specialization(guards = "!nullValue(value)") protected RAbstractContainer updateAttr(RAbstractVector vector, RStringVector name, Object value) { - controlVisibility(); return updateAttr(vector, name.getDataAt(0), value); } @@ -199,7 +196,6 @@ public abstract class UpdateAttr extends RBuiltinNode { @Fallback protected Object updateAttr(Object obj, Object name, Object value) { Object object = obj; - controlVisibility(); String sname = RRuntime.asString(name); if (sname == null) { errorProfile.enter(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateAttributes.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateAttributes.java index 8c72f29638..fddb6da6c2 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateAttributes.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateAttributes.java @@ -98,7 +98,6 @@ public abstract class UpdateAttributes extends RBuiltinNode { @Specialization protected RAbstractVector updateAttributes(RAbstractVector abstractVector, @SuppressWarnings("unused") RNull list) { - controlVisibility(); RAbstractVector resultVector = (RAbstractVector) abstractVector.getNonShared(); resultVector.resetAllAttributes(true); return resultVector; @@ -106,7 +105,6 @@ public abstract class UpdateAttributes extends RBuiltinNode { @Specialization protected RAbstractContainer updateAttributes(RAbstractContainer container, RList list) { - controlVisibility(); Object listNamesObject = list.getNames(attrProfiles); if (listNamesObject == null || listNamesObject == RNull.instance) { throw RError.error(this, RError.Message.ATTRIBUTES_NAMED); @@ -210,7 +208,6 @@ public abstract class UpdateAttributes extends RBuiltinNode { @Fallback @TruffleBoundary protected Object doOther(Object o, Object operand) { - controlVisibility(); Object obj = o; if (obj instanceof RShareable) { obj = ((RShareable) obj).getNonShared(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateClass.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateClass.java index 6db318145d..5d4e2384e0 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateClass.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateClass.java @@ -55,7 +55,6 @@ public abstract class UpdateClass extends RBuiltinNode { @Specialization(guards = "!isStringVector(className)") protected Object setClass(RAbstractContainer arg, RAbstractVector className) { - controlVisibility(); if (className.getLength() == 0) { return setClass(arg, RNull.instance); } @@ -74,7 +73,6 @@ public abstract class UpdateClass extends RBuiltinNode { @Specialization @TruffleBoundary protected Object setClass(RAbstractContainer arg, @SuppressWarnings("unused") RNull className) { - controlVisibility(); RAbstractContainer result = (RAbstractContainer) arg.getNonShared(); return result.setClassAttr(null); @@ -90,7 +88,6 @@ public abstract class UpdateClass extends RBuiltinNode { @Specialization(contains = "setClassCached") protected Object setClass(RAbstractContainer arg, String className, // @Cached("create()") TypeFromModeNode typeFromMode) { - controlVisibility(); RType mode = typeFromMode.execute(className); return setClassInternal(arg, className, mode); } @@ -137,77 +134,66 @@ public abstract class UpdateClass extends RBuiltinNode { @Specialization @TruffleBoundary protected Object setClass(RAbstractContainer arg, RStringVector className) { - controlVisibility(); RAbstractContainer result = (RAbstractContainer) arg.getNonShared(); return result.setClassAttr(className); } @Specialization protected Object setClass(RFunction arg, RAbstractStringVector className) { - controlVisibility(); arg.setClassAttr(className.materialize()); return arg; } @Specialization protected Object setClass(RFunction arg, @SuppressWarnings("unused") RNull className) { - controlVisibility(); arg.setClassAttr(null); return arg; } @Specialization protected Object setClass(REnvironment arg, RAbstractStringVector className) { - controlVisibility(); arg.setClassAttr(className.materialize()); return arg; } @Specialization protected Object setClass(REnvironment arg, @SuppressWarnings("unused") RNull className) { - controlVisibility(); arg.setClassAttr(null); return arg; } @Specialization protected Object setClass(RSymbol arg, RAbstractStringVector className) { - controlVisibility(); arg.setClassAttr(className.materialize()); return arg; } @Specialization protected Object setClass(RSymbol arg, @SuppressWarnings("unused") RNull className) { - controlVisibility(); arg.setClassAttr(null); return arg; } @Specialization protected Object setClass(RExternalPtr arg, RAbstractStringVector className) { - controlVisibility(); arg.setClassAttr(className.materialize()); return arg; } @Specialization protected Object setClass(RExternalPtr arg, @SuppressWarnings("unused") RNull className) { - controlVisibility(); arg.setClassAttr(null); return arg; } @Specialization protected Object setClass(RS4Object arg, RAbstractStringVector className) { - controlVisibility(); arg.setClassAttr(className.materialize()); return arg; } @Specialization protected Object setClass(RS4Object arg, @SuppressWarnings("unused") RNull className) { - controlVisibility(); arg.setClassAttr(null); return arg; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateDim.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateDim.java index be53db9585..b043d60791 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateDim.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateDim.java @@ -45,7 +45,6 @@ public abstract class UpdateDim extends RBuiltinNode { @Specialization protected RAbstractVector updateDim(RAbstractVector vector, @SuppressWarnings("unused") RNull dimensions) { - controlVisibility(); RVector result = ((RAbstractVector) reuse.execute(vector)).materialize(); result.resetDimensions(null); return result; @@ -54,7 +53,6 @@ public abstract class UpdateDim extends RBuiltinNode { @Specialization protected RAbstractVector updateDim(RAbstractVector vector, RAbstractVector dimensions, // @Cached("createPreserveNames()") CastIntegerNode castInteger) { - controlVisibility(); if (dimensions.getLength() == 0) { CompilerDirectives.transferToInterpreter(); throw RError.error(this, RError.Message.LENGTH_ZERO_DIM_INVALID); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateDimNames.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateDimNames.java index 7b6edaca03..d206d97a0c 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateDimNames.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateDimNames.java @@ -94,7 +94,6 @@ public abstract class UpdateDimNames extends RBuiltinNode { @Specialization protected RAbstractContainer updateDimnamesNull(RAbstractContainer container, @SuppressWarnings("unused") RNull list, // @Cached("create(DIMNAMES_ATTR_KEY)") RemoveAttributeNode remove) { - controlVisibility(); RAbstractContainer result = (RAbstractContainer) container.getNonShared(); if (isRVectorProfile.profile(container instanceof RVector)) { RVector vector = (RVector) container; @@ -117,7 +116,6 @@ public abstract class UpdateDimNames extends RBuiltinNode { @Specialization(guards = "list.getLength() > 0") protected RAbstractContainer updateDimnames(RAbstractContainer container, RList list, // @Cached("create(DIMNAMES_ATTR_KEY)") PutAttributeNode put) { - controlVisibility(); RAbstractContainer result = (RAbstractContainer) container.getNonShared(); setDimNames(result, convertToListOfStrings(list), put); return result; @@ -125,7 +123,6 @@ public abstract class UpdateDimNames extends RBuiltinNode { @Specialization(guards = "!isRList(c)") protected RAbstractContainer updateDimnamesError(@SuppressWarnings("unused") RAbstractContainer container, @SuppressWarnings("unused") Object c) { - controlVisibility(); CompilerDirectives.transferToInterpreter(); throw RError.error(this, RError.Message.DIMNAMES_LIST); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateLength.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateLength.java index 89b441726a..ed0d2d7737 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateLength.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateLength.java @@ -46,20 +46,17 @@ public abstract class UpdateLength extends RBuiltinNode { @SuppressWarnings("unused") @Specialization(guards = "isLengthOne(lengthVector)") protected RNull updateLength(RNull value, RAbstractIntVector lengthVector) { - controlVisibility(); return RNull.instance; } @Specialization(guards = "isLengthOne(lengthVector)") protected RAbstractContainer updateLength(RAbstractContainer container, RAbstractIntVector lengthVector) { - controlVisibility(); return container.resize(lengthVector.getDataAt(0)); } @SuppressWarnings("unused") @Specialization protected Object updateLengthError(Object vector, Object lengthVector) { - controlVisibility(); CompilerDirectives.transferToInterpreter(); throw RError.error(this, RError.Message.INVALID_UNNAMED_VALUE); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateLevels.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateLevels.java index 73cc6874ac..32326368e2 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateLevels.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateLevels.java @@ -42,7 +42,6 @@ public abstract class UpdateLevels extends RBuiltinNode { @Specialization protected RAbstractVector updateLevels(RAbstractVector vector, @SuppressWarnings("unused") RNull levels) { - controlVisibility(); RVector v = (RVector) vector.getNonShared(); v.removeAttr(attrProfiles, RRuntime.LEVELS_ATTR_KEY); return v; @@ -50,7 +49,6 @@ public abstract class UpdateLevels extends RBuiltinNode { @Specialization(guards = "levelsNotNull(levels)") protected RAbstractVector updateLevels(RAbstractVector vector, Object levels) { - controlVisibility(); RVector v = (RVector) vector.getNonShared(); v.setAttr(RRuntime.LEVELS_ATTR_KEY, castVector(levels)); return v; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateNames.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateNames.java index d413505a95..d6946e21ab 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateNames.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateNames.java @@ -55,7 +55,6 @@ public abstract class UpdateNames extends RBuiltinNode { @Specialization @TruffleBoundary protected RAbstractContainer updateNames(RAbstractContainer container, Object names) { - controlVisibility(); Object newNames = castString(names); if (newNames == RNull.instance) { RAbstractContainer result = (RAbstractContainer) container.getNonShared(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateOldClass.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateOldClass.java index 62295b373c..f8d823a843 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateOldClass.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateOldClass.java @@ -47,7 +47,6 @@ public abstract class UpdateOldClass extends RBuiltinNode { @Specialization(guards = "!isStringVector(className)") protected Object setOldClass(RAbstractContainer arg, RAbstractVector className) { - controlVisibility(); if (className.getLength() == 0) { return setOldClass(arg, RNull.instance); } @@ -72,7 +71,6 @@ public abstract class UpdateOldClass extends RBuiltinNode { @Specialization @TruffleBoundary protected Object setOldClass(RAbstractContainer arg, RStringVector className) { - controlVisibility(); RAbstractContainer result = (RAbstractContainer) arg.getNonShared(); return result.setClassAttr(className); } @@ -80,7 +78,6 @@ public abstract class UpdateOldClass extends RBuiltinNode { @Specialization @TruffleBoundary protected Object setOldClass(RAbstractContainer arg, @SuppressWarnings("unused") RNull className) { - controlVisibility(); RAbstractContainer result = (RAbstractContainer) arg.getNonShared(); return result.setClassAttr(null); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateStorageMode.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateStorageMode.java index 8c1d6e23ea..49436ca929 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateStorageMode.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateStorageMode.java @@ -48,7 +48,6 @@ public abstract class UpdateStorageMode extends RBuiltinNode { @Specialization protected Object update(Object x, String value) { - controlVisibility(); RType mode = typeFromMode.execute(value); if (mode == RType.DefunctReal || mode == RType.DefunctSingle) { errorProfile.enter(); @@ -120,7 +119,6 @@ public abstract class UpdateStorageMode extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected Object update(Object x, Object value) { - controlVisibility(); CompilerDirectives.transferToInterpreter(); throw RError.error(this, RError.Message.NULL_VALUE); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateSubstr.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateSubstr.java index eeebb27512..3db77f9f34 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateSubstr.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateSubstr.java @@ -89,7 +89,6 @@ public abstract class UpdateSubstr extends RBuiltinNode { @Specialization(guards = "emptyArg(arg)") @TruffleBoundary protected RStringVector substrEmptyArg(RAbstractStringVector arg, RAbstractIntVector start, RAbstractIntVector stop, Object value) { - controlVisibility(); return RDataFactory.createEmptyStringVector(); } @@ -118,7 +117,6 @@ public abstract class UpdateSubstr extends RBuiltinNode { @Specialization(guards = {"!emptyArg(arg)", "!wrongParams(start, stop)", "!wrongValue(value)"}) @TruffleBoundary protected RStringVector substr(RAbstractStringVector arg, RAbstractIntVector start, RAbstractIntVector stop, RAbstractStringVector value) { - controlVisibility(); int argLength = arg.getLength(); String[] res = new String[argLength]; na.enable(arg); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/VApply.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/VApply.java index f7af4bdaca..1ab569f1c1 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/VApply.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/VApply.java @@ -132,7 +132,6 @@ public abstract class VApply extends RBuiltinNode { protected Object vapply(VirtualFrame frame, RAbstractVector vec, RFunction fun, Object funValue, byte useNames) { RVector result = delegateToLapply(frame, vec, fun, funValue, useNames); // set here else it gets overridden by the iterator evaluation - controlVisibility(); return result; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Vector.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Vector.java index d4f3260a5d..e8e0fa598c 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Vector.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Vector.java @@ -59,14 +59,12 @@ public abstract class Vector extends RBuiltinNode { @SuppressWarnings("unused") @Specialization(guards = {"mode == cachedMode"}, limit = CACHED_MODES_LIMIT) RAbstractVector vectorCached(String mode, int length, @Cached("mode") String cachedMode, @Cached("modeToType(mode)") RType type) { - controlVisibility(); return type.create(length, false); } @Specialization(contains = "vectorCached") @TruffleBoundary protected RAbstractVector vector(String mode, int length) { - controlVisibility(); return modeToType(mode).create(length, false); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Warning.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Warning.java index 5c28c1ac3f..f917f0cf1d 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Warning.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Warning.java @@ -65,7 +65,6 @@ public abstract class Warning extends RBuiltinNode { boolean immediate = RRuntime.fromLogical(immediateL); boolean noBreakWarning = RRuntime.fromLogical(noBreakWarningL); RErrorHandling.warningcallInternal(call, message, immediate, noBreakWarning); - controlVisibility(); return message; } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/WhichFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/WhichFunctions.java index 51ed994477..3164c5df7f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/WhichFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/WhichFunctions.java @@ -55,7 +55,6 @@ public class WhichFunctions { @Specialization(guards = "!hasNames(x)") @TruffleBoundary protected RIntVector which(RAbstractLogicalVector x) { - controlVisibility(); ArrayList<Integer> w = new ArrayList<>(); for (int i = 0; i < x.getLength(); i++) { if (x.getDataAt(i) == RRuntime.LOGICAL_TRUE) { @@ -72,7 +71,6 @@ public class WhichFunctions { @Specialization(guards = "hasNames(x)") @TruffleBoundary protected RIntVector whichNames(RAbstractLogicalVector x) { - controlVisibility(); ArrayList<Integer> w = new ArrayList<>(); ArrayList<String> n = new ArrayList<>(); RStringVector oldNames = x.getNames(attrProfiles); @@ -108,7 +106,6 @@ public class WhichFunctions { @Specialization protected int which(RAbstractDoubleVector x) { - controlVisibility(); double max = x.getDataAt(0); int maxIndex = 0; for (int i = 0; i < x.getLength(); i++) { @@ -131,7 +128,6 @@ public class WhichFunctions { @Specialization protected int which(RAbstractDoubleVector x) { - controlVisibility(); double minimum = x.getDataAt(0); int minIndex = 0; for (int i = 0; i < x.getLength(); i++) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/WithVisible.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/WithVisible.java index 072c4f9a82..0a8b7ac8b1 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/WithVisible.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/WithVisible.java @@ -47,13 +47,11 @@ public abstract class WithVisible extends RBuiltinNode { Object[] data = new Object[]{x, RRuntime.asLogical(RContext.getInstance().isVisible())}; // Visibility is changed by the evaluation (else this code would not work), // so we have to force it back on. - controlVisibility(); return RDataFactory.createList(data, LISTNAMES); } @Specialization protected RList withVisible(@SuppressWarnings("unused") RMissing x) { - controlVisibility(); throw RError.error(this, Message.ARGUMENT_MISSING, "x"); } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/DotC.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/DotC.java index 66e5281456..6781cf35c6 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/DotC.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/DotC.java @@ -73,7 +73,6 @@ public abstract class DotC extends RBuiltinNode { @SuppressWarnings("unused") @Specialization protected RList c(VirtualFrame frame, RList symbol, RArgsValuesAndNames args, byte naok, byte dup, Object rPackage, RMissing encoding) { - controlVisibility(); long address = getAddressFromSymbolInfo(frame, symbol); String name = getNameFromSymbolInfo(frame, symbol); return dispatch(this, address, name, naok, dup, args); @@ -83,7 +82,6 @@ public abstract class DotC extends RBuiltinNode { @Specialization protected RList c(RAbstractStringVector f, RArgsValuesAndNames args, byte naok, byte dup, Object rPackage, RMissing encoding, // @Cached("create()") BranchProfile errorProfile) { - controlVisibility(); String libName = null; if (!(rPackage instanceof RMissing)) { libName = RRuntime.asString(rPackage); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/ForeignFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/ForeignFunctions.java index 95f579d6eb..bbbcfaff47 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/ForeignFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/ForeignFunctions.java @@ -228,21 +228,18 @@ public class ForeignFunctions { protected Object doExternal(RList f, RArgsValuesAndNames args, byte naok, byte dup, Object rPackage, RMissing encoding, // @Cached("f") RList cached, // @Cached("lookupBuiltin(f)") RExternalBuiltinNode builtin) { - controlVisibility(); return builtin.call(args); } @Specialization(guards = "lookupBuiltin(symbol) == null") protected RList c(VirtualFrame frame, RList symbol, RArgsValuesAndNames args, byte naok, byte dup, @SuppressWarnings("unused") Object rPackage, @SuppressWarnings("unused") RMissing encoding) { - controlVisibility(); return DotC.dispatch(this, getAddressFromSymbolInfo(frame, symbol), getNameFromSymbolInfo(frame, symbol), naok, dup, args); } @Specialization protected RList c(RAbstractStringVector f, RArgsValuesAndNames args, byte naok, byte dup, Object rPackage, @SuppressWarnings("unused") RMissing encoding, // @Cached("create()") BranchProfile errorProfile) { - controlVisibility(); String libName = checkPackageArg(rPackage, errorProfile); DLL.RegisteredNativeSymbol rns = new DLL.RegisteredNativeSymbol(DLL.NativeSymbolType.Fortran, null, null); long func = DLL.findSymbol(f.getDataAt(0), libName, rns); @@ -499,13 +496,11 @@ public class ForeignFunctions { protected Object doExternal(RList f, RArgsValuesAndNames args, RMissing packageName, // @Cached("f") RList cached, // @Cached("lookupBuiltin(f)") RExternalBuiltinNode builtin) { - controlVisibility(); return builtin.call(args); } @Specialization protected Object callNamedFunction(VirtualFrame frame, RList symbol, RArgsValuesAndNames args, @SuppressWarnings("unused") Object packageName) { - controlVisibility(); return RFFIFactory.getRFFI().getCallRFFI().invokeCall(getAddressFromSymbolInfo(frame, symbol), getNameFromSymbolInfo(frame, symbol), args.getArguments()); } @@ -516,7 +511,6 @@ public class ForeignFunctions { @Specialization protected Object callNamedFunctionWithPackage(String name, RArgsValuesAndNames args, String packageName) { - controlVisibility(); DLL.RegisteredNativeSymbol rns = new DLL.RegisteredNativeSymbol(DLL.NativeSymbolType.Call, null, null); long func = DLL.findSymbol(name, packageName, rns); if (func == DLL.SYMBOL_NOT_FOUND) { @@ -582,7 +576,6 @@ public class ForeignFunctions { protected Object doExternal(RList f, RArgsValuesAndNames args, RMissing packageName, // @Cached("f") RList cached, // @Cached("lookupBuiltin(f)") RExternalBuiltinNode builtin) { - controlVisibility(); return builtin.call(args); } @@ -600,7 +593,6 @@ public class ForeignFunctions { @Specialization protected Object callNamedFunctionWithPackage(String name, RArgsValuesAndNames args, String packageName) { - controlVisibility(); DLL.RegisteredNativeSymbol rns = new DLL.RegisteredNativeSymbol(DLL.NativeSymbolType.External, null, null); long func = DLL.findSymbol(name, packageName, rns); if (func == DLL.SYMBOL_NOT_FOUND) { @@ -652,7 +644,6 @@ public class ForeignFunctions { protected Object doExternal(RList f, RArgsValuesAndNames args, RMissing packageName, // @Cached("f") RList cached, // @Cached("lookupBuiltin(f)") RExternalBuiltinNode builtin) { - controlVisibility(); return builtin.call(args); } @@ -671,7 +662,6 @@ public class ForeignFunctions { @Specialization protected Object callNamedFunctionWithPackage(String name, RArgsValuesAndNames args, String packageName) { - controlVisibility(); DLL.RegisteredNativeSymbol rns = new DLL.RegisteredNativeSymbol(DLL.NativeSymbolType.External, null, null); long func = DLL.findSymbol(name, packageName, rns); if (func == DLL.SYMBOL_NOT_FOUND) { @@ -712,7 +702,6 @@ public class ForeignFunctions { protected Object doExternal(RList f, RArgsValuesAndNames args, RMissing packageName, // @Cached("f") RList cached, // @Cached("lookupBuiltin(f)") RExternalBuiltinNode builtin) { - controlVisibility(); return builtin.call(args); } @@ -730,7 +719,6 @@ public class ForeignFunctions { @Specialization protected Object callNamedFunctionWithPackage(String name, RArgsValuesAndNames args, String packageName) { - controlVisibility(); DLL.RegisteredNativeSymbol rns = new DLL.RegisteredNativeSymbol(DLL.NativeSymbolType.External, null, null); long func = DLL.findSymbol(name, packageName, rns); if (func == DLL.SYMBOL_NOT_FOUND) { @@ -770,7 +758,6 @@ public class ForeignFunctions { protected Object doExternal(RList f, RArgsValuesAndNames args, RMissing packageName, // @Cached("f") RList cached, // @Cached("lookupBuiltin(f)") RExternalBuiltinNode builtin) { - controlVisibility(); return builtin.call(args); } @@ -786,7 +773,6 @@ public class ForeignFunctions { @Specialization protected Object callNamedFunctionWithPackage(String name, RArgsValuesAndNames args, String packageName) { - controlVisibility(); DLL.RegisteredNativeSymbol rns = new DLL.RegisteredNativeSymbol(DLL.NativeSymbolType.Call, null, null); long func = DLL.findSymbol(name, packageName, rns); if (func == DLL.SYMBOL_NOT_FOUND) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRCallCounting.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRCallCounting.java index a6e677934d..4039faa429 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRCallCounting.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRCallCounting.java @@ -41,7 +41,6 @@ public class FastRCallCounting { @Specialization @TruffleBoundary protected RNull createCallCounter(RFunction function) { - controlVisibility(); if (!function.isBuiltin()) { REntryCounters.FunctionListener.installCounter(function); } @@ -60,7 +59,6 @@ public class FastRCallCounting { @Specialization @TruffleBoundary protected Object getCallCount(RFunction function) { - controlVisibility(); if (!function.isBuiltin()) { int entryCount = REntryCounters.FunctionListener.findCounter(function).getEnterCount(); if (entryCount < 0) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRContext.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRContext.java index 636e7ee4b0..5c541fd1cc 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRContext.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRContext.java @@ -66,7 +66,6 @@ public class FastRContext { @Specialization @TruffleBoundary protected int create(RAbstractStringVector args, RAbstractStringVector kindVec) { - controlVisibility(); try { RContext.ContextKind kind = RContext.ContextKind.valueOf(kindVec.getDataAt(0)); RCmdOptions options = RCmdOptions.parseArguments(Client.RSCRIPT, args.materialize().getDataCopy()); @@ -88,7 +87,6 @@ public class FastRContext { @Specialization @TruffleBoundary protected Object get() { - controlVisibility(); return RContext.getInstance(); } } @@ -120,7 +118,6 @@ public class FastRContext { @Specialization @TruffleBoundary protected RNull spawn(RAbstractIntVector contexts, RAbstractStringVector exprs) { - controlVisibility(); RContext.EvalThread[] threads = new RContext.EvalThread[contexts.getLength()]; for (int i = 0; i < threads.length; i++) { ContextInfo info = checkContext(contexts.getDataAt(i), this); @@ -143,7 +140,6 @@ public class FastRContext { public abstract static class Join extends RBuiltinNode { @Specialization protected RNull eval(RAbstractIntVector contexts) { - controlVisibility(); try { for (int i = 0; i < contexts.getLength(); i++) { Thread thread = RContext.EvalThread.threads.get(contexts.getDataAt(i)); @@ -179,7 +175,6 @@ public class FastRContext { @Specialization @TruffleBoundary protected Object eval(RAbstractIntVector contexts, RAbstractStringVector exprs, byte par) { - controlVisibility(); Object[] results = new Object[contexts.getLength()]; if (RRuntime.fromLogical(par)) { RContext.EvalThread[] threads = new RContext.EvalThread[contexts.getLength()]; @@ -255,7 +250,6 @@ public class FastRContext { @Specialization(guards = "key.getLength() == 1") @TruffleBoundary protected int createChannel(RAbstractIntVector key) { - controlVisibility(); return RChannel.createChannel(key.getDataAt(0)); } @@ -270,7 +264,6 @@ public class FastRContext { @Specialization(guards = "key.getLength() == 1") @TruffleBoundary protected int getChannel(RAbstractIntVector key) { - controlVisibility(); return RChannel.getChannel(key.getDataAt(0)); } @@ -285,7 +278,6 @@ public class FastRContext { @Specialization(guards = "id.getLength() == 1") @TruffleBoundary protected RNull getChannel(RAbstractIntVector id) { - controlVisibility(); RChannel.closeChannel(id.getDataAt(0)); return RNull.instance; } @@ -301,7 +293,6 @@ public class FastRContext { @Specialization(guards = "id.getLength() == 1") @TruffleBoundary protected RNull send(RAbstractIntVector id, Object data) { - controlVisibility(); RChannel.send(id.getDataAt(0), data); return RNull.instance; } @@ -317,7 +308,6 @@ public class FastRContext { @Specialization(guards = "id.getLength() == 1") @TruffleBoundary protected Object receive(RAbstractIntVector id) { - controlVisibility(); return RChannel.receive(id.getDataAt(0)); } @@ -332,7 +322,6 @@ public class FastRContext { @Specialization(guards = "id.getLength() == 1") @TruffleBoundary protected Object poll(RAbstractIntVector id) { - controlVisibility(); return RChannel.poll(id.getDataAt(0)); } @@ -347,7 +336,6 @@ public class FastRContext { @Specialization @TruffleBoundary protected RList select(RList nodes) { - controlVisibility(); int ind = 0; int length = nodes.getLength(); while (true) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRDebug.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRDebug.java index cb464f0428..9f2010404f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRDebug.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRDebug.java @@ -25,7 +25,6 @@ package com.oracle.truffle.r.nodes.builtin.fastr; import com.oracle.truffle.api.dsl.Fallback; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; -import com.oracle.truffle.r.nodes.builtin.RInvisibleBuiltinNode; import com.oracle.truffle.r.runtime.FastROptions; import com.oracle.truffle.r.runtime.RBuiltin; import com.oracle.truffle.r.runtime.RBuiltinKind; @@ -38,7 +37,6 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector; public abstract class FastRDebug extends RBuiltinNode { @Specialization protected RNull debug(RAbstractStringVector vec) { - controlVisibility(); for (int i = 0; i < vec.getLength(); i++) { FastROptions.debugUpdate(vec.getDataAt(i)); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRFunctionTimer.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRFunctionTimer.java index 8ec10464d0..1a967545ba 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRFunctionTimer.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRFunctionTimer.java @@ -44,7 +44,6 @@ public class FastRFunctionTimer { @Specialization @TruffleBoundary protected RNull createFunctionTimer(RFunction function) { - controlVisibility(); if (!function.isBuiltin()) { RNodeTimer.StatementListener.installTimer(function); } @@ -68,7 +67,6 @@ public class FastRFunctionTimer { @Specialization @TruffleBoundary protected Object getFunctionTimer(RFunction function, RAbstractStringVector scale) { - controlVisibility(); if (!function.isBuiltin()) { long timeInfo = RNodeTimer.StatementListener.findTimer(function); if (timeInfo < 0) { diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRInspect.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRInspect.java index 0426c3f9e2..236507ea80 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRInspect.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRInspect.java @@ -37,7 +37,6 @@ import com.oracle.truffle.r.runtime.data.RNull; public abstract class FastRInspect extends RBuiltinNode { @Specialization public Object call(@SuppressWarnings("unused") RArgsValuesAndNames args) { - controlVisibility(); return RNull.instance; } } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRInterop.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRInterop.java index 59de301270..55e91496b0 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRInterop.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRInterop.java @@ -47,7 +47,6 @@ public class FastRInterop { @Specialization @TruffleBoundary protected Object interopEval(Object mimeType, Object source) { - controlVisibility(); Source sourceObject = Source.fromText(RRuntime.asString(source), Engine.EVAL_FUNCTION_NAME).withMimeType(RRuntime.asString(mimeType)); CallTarget callTarget; @@ -68,7 +67,6 @@ public class FastRInterop { @Specialization @TruffleBoundary protected Object debugSource(Object name, RTypedValue value) { - controlVisibility(); String stringName = RRuntime.asString(name); if (stringName == null) { throw RError.error(this, RError.Message.INVALID_ARG_TYPE, "name"); @@ -88,7 +86,6 @@ public class FastRInterop { @Specialization @TruffleBoundary protected Object debugSource(Object name) { - controlVisibility(); String stringName = RRuntime.asString(name); if (stringName == null) { throw RError.error(this, RError.Message.INVALID_ARG_TYPE, "name"); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRStackTrace.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRStackTrace.java index dc3b99f758..0d37d83331 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRStackTrace.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRStackTrace.java @@ -44,7 +44,6 @@ public abstract class FastRStackTrace extends RBuiltinNode { @Specialization protected RNull printStackTrace(byte printFrameContents) { - controlVisibility(); boolean printFrameSlots = printFrameContents == RRuntime.LOGICAL_TRUE; RContext.getInstance().getConsoleHandler().print(Utils.createStackTrace(printFrameSlots)); return RNull.instance; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRSyntaxTree.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRSyntaxTree.java index 90bcbb9776..4155314e9a 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRSyntaxTree.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRSyntaxTree.java @@ -77,7 +77,6 @@ public abstract class FastRSyntaxTree extends RBuiltinNode { @Specialization @TruffleBoundary protected RNull printTree(RFunction function, RAbstractStringVector visitMode, byte printSourceLogical, byte printTagsLogical) { - controlVisibility(); boolean printSource = RRuntime.fromLogical(printSourceLogical); boolean printTags = RRuntime.fromLogical(printTagsLogical); FunctionDefinitionNode root = (FunctionDefinitionNode) function.getTarget().getRootNode(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRThrowIt.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRThrowIt.java index 317acbf897..c4f432f763 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRThrowIt.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRThrowIt.java @@ -39,7 +39,6 @@ public abstract class FastRThrowIt extends RBuiltinNode { @Specialization @TruffleBoundary protected RNull throwit(RAbstractStringVector x) { - controlVisibility(); String name = x.getDataAt(0); switch (name) { case "AIX": diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRTrace.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRTrace.java index 6ae077d81d..57047bb927 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRTrace.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRTrace.java @@ -46,6 +46,8 @@ import com.oracle.truffle.r.runtime.RBuiltinKind; import com.oracle.truffle.r.runtime.RError; import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.RType; +import com.oracle.truffle.r.runtime.RVisibility; +import com.oracle.truffle.r.runtime.context.RContext; import com.oracle.truffle.r.runtime.data.RDataFactory; import com.oracle.truffle.r.runtime.data.RFunction; import com.oracle.truffle.r.runtime.data.RLanguage; @@ -104,7 +106,7 @@ public class FastRTrace { } - @RBuiltin(name = ".fastr.trace", kind = RBuiltinKind.PRIMITIVE, parameterNames = {"what", "tracer", "exit", "at", "print", "signature", "where"}) + @RBuiltin(name = ".fastr.trace", visibility = RVisibility.CUSTOM, kind = RBuiltinKind.PRIMITIVE, parameterNames = {"what", "tracer", "exit", "at", "print", "signature", "where"}) public abstract static class Trace extends Helper { @Child private TraceFunctions.PrimTrace primTrace; @@ -112,7 +114,6 @@ public class FastRTrace { @Specialization protected Object trace(VirtualFrame frame, Object whatObj, Object tracer, Object exit, Object at, Object printObj, Object signature, Object whereObj) { - controlVisibility(); Object what = whatObj; checkWhat(what); Object where = whereObj; @@ -126,27 +127,30 @@ public class FastRTrace { RFunction func = checkFunction(what); if (tracer == RMissing.instance && exit == RMissing.instance && at == RMissing.instance && printObj == RMissing.instance && signature == RMissing.instance) { - // simple case, nargs() == 1 + // simple case, nargs() == 1, corresponds to .primTrace that has invisible output if (primTrace == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); primTrace = insert(PrimTraceNodeGen.create(null)); } - return primTrace.execute(frame, func); - } else { - if (at != RMissing.instance) { - throw RError.nyi(this, "'at'"); - } - boolean print = true; - if (printObj != RMissing.instance) { - if (castLogical == null) { - CompilerDirectives.transferToInterpreterAndInvalidate(); - castLogical = insert(CastLogicalNodeGen.create(false, false, false)); - } - print = RRuntime.fromLogical((byte) castLogical.execute(printObj)); - } - complexCase(func, tracer, exit, at, print, signature); + + Object result = primTrace.execute(frame, func); + RContext.getInstance().setVisible(false); + return result; } + if (at != RMissing.instance) { + throw RError.nyi(this, "'at'"); + } + boolean print = true; + if (printObj != RMissing.instance) { + if (castLogical == null) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + castLogical = insert(CastLogicalNodeGen.create(false, false, false)); + } + print = RRuntime.fromLogical((byte) castLogical.execute(printObj)); + } + complexCase(func, tracer, exit, at, print, signature); + RContext.getInstance().setVisible(true); return func.toString(); } @@ -167,7 +171,7 @@ public class FastRTrace { } - @RBuiltin(name = ".fastr.untrace", kind = RBuiltinKind.PRIMITIVE, parameterNames = {"what", "signature", "where"}) + @RBuiltin(name = ".fastr.untrace", visibility = RVisibility.OFF, kind = RBuiltinKind.PRIMITIVE, parameterNames = {"what", "signature", "where"}) public abstract static class Untrace extends Helper { @Child private TraceFunctions.PrimUnTrace primUnTrace; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRTree.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRTree.java index f39c7a4a03..a3c1aa478d 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRTree.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRTree.java @@ -44,7 +44,6 @@ public abstract class FastRTree extends RBuiltinNode { @Specialization protected String printTree(RFunction function, byte verbose) { - controlVisibility(); RootNode root = function.getTarget().getRootNode(); String printedTree = verbose == RRuntime.LOGICAL_TRUE ? NodeUtil.printTreeToString(root) : NodeUtil.printCompactTreeToString(root); System.out.println(printedTree); diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/binary/ColonNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/binary/ColonNode.java index d85859b6e2..95a602ff91 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/binary/ColonNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/binary/ColonNode.java @@ -62,7 +62,6 @@ public abstract class ColonNode extends RBuiltinNode { @Specialization(guards = "left <= right") protected RIntSequence colonAscending(int left, int right) { - controlVisibility(); leftNA.enable(left); rightNA.enable(right); naCheck(leftNA.check(left) || rightNA.check(right)); @@ -71,7 +70,6 @@ public abstract class ColonNode extends RBuiltinNode { @Specialization(guards = "left > right") protected RIntSequence colonDescending(int left, int right) { - controlVisibility(); leftNA.enable(left); rightNA.enable(right); naCheck(leftNA.check(left) || rightNA.check(right)); @@ -80,7 +78,6 @@ public abstract class ColonNode extends RBuiltinNode { @Specialization(guards = "asDouble(left) <= right") protected RIntSequence colonAscending(int left, double right) { - controlVisibility(); leftNA.enable(left); naCheck(leftNA.check(left) || RRuntime.isNAorNaN(right)); return RDataFactory.createAscendingRange(left, (int) right); @@ -88,7 +85,6 @@ public abstract class ColonNode extends RBuiltinNode { @Specialization(guards = "asDouble(left) > right") protected RIntSequence colonDescending(int left, double right) { - controlVisibility(); leftNA.enable(left); naCheck(leftNA.check(left) || RRuntime.isNAorNaN(right)); return RDataFactory.createDescendingRange(left, (int) right); @@ -96,7 +92,6 @@ public abstract class ColonNode extends RBuiltinNode { @Specialization(guards = "left <= asDouble(right)") protected RDoubleSequence colonAscending(double left, int right) { - controlVisibility(); rightNA.enable(right); naCheck(RRuntime.isNAorNaN(left) || rightNA.check(right)); return RDataFactory.createAscendingRange(left, right); @@ -104,7 +99,6 @@ public abstract class ColonNode extends RBuiltinNode { @Specialization(guards = "left > asDouble(right)") protected RDoubleSequence colonDescending(double left, int right) { - controlVisibility(); rightNA.enable(right); naCheck(RRuntime.isNAorNaN(left) || rightNA.check(right)); return RDataFactory.createDescendingRange(left, right); @@ -112,14 +106,12 @@ public abstract class ColonNode extends RBuiltinNode { @Specialization(guards = "left <= right") protected RDoubleSequence colonAscending(double left, double right) { - controlVisibility(); naCheck(RRuntime.isNAorNaN(left) || RRuntime.isNAorNaN(right)); return RDataFactory.createAscendingRange(left, right); } @Specialization(guards = "left > right") protected RDoubleSequence colonDescending(double left, double right) { - controlVisibility(); naCheck(RRuntime.isNAorNaN(left) || RRuntime.isNAorNaN(right)); return RDataFactory.createDescendingRange(left, right); } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/VisibilityController.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/VisibilityController.java index 12f915588f..3c2de8b765 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/VisibilityController.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/VisibilityController.java @@ -43,21 +43,6 @@ public interface VisibilityController { return true; } - /** - * Set the global visibility flag according to the visibility property of the node implementing - * this interface. There is no need to ever override this method, but all node classes - * implementing the {@link VisibilityController} interface must call this method in each of - * their specializations or {@code execute()} methods. - * - * This call is not necessary in specializations or {@code execute()} methods that are - * guaranteed to always replace and execute, as is common in "unresolved" node implementations. - */ - default void controlVisibility() { - if (!FastROptions.IgnoreVisibility.getBooleanValue()) { - RContext.getInstance().setVisible(getVisibility()); - } - } - /** * Force the visibility to {@code state}. Useful for builtins where the visibility depends on * the result, e.g. {@code switch}. -- GitLab