diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/REmbedded.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/REmbedded.java index f38d6a838cd6592850bcadf0d0ca6b67662d81f9..1ef67f1de646cdc804ccaf2c2c5f2e2c2d7672ca 100644 --- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/REmbedded.java +++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/shell/REmbedded.java @@ -64,10 +64,10 @@ public class REmbedded { private static Context context; /** - * Creates the {@link Engine} and initializes it. Called from native code when FastR is embedded. - * Corresponds to FFI method {@code Rf_initialize_R}. N.B. This does not completely initialize FastR - * as we cannot do that until the embedding system has had a chance to adjust the - * {@link RStartParams}, which happens after this call returns. + * Creates the {@link Engine} and initializes it. Called from native code when FastR is + * embedded. Corresponds to FFI method {@code Rf_initialize_R}. N.B. This does not completely + * initialize FastR as we cannot do that until the embedding system has had a chance to adjust + * the {@link RStartParams}, which happens after this call returns. */ private static void initializeR(String[] args, boolean initMainLoop) { assert context == null; @@ -95,10 +95,10 @@ public class REmbedded { } /** - * Adjusts the values stored in {@link RStartParams}. Invoked from the native embedding code, i.e. - * not from a down-call, so the callbacks native array is not set-up properly. Moreover, this call - * is made during R initialization, so it not entirely clear if the FFI implementation has been - * fully initialized yet. + * Adjusts the values stored in {@link RStartParams}. Invoked from the native embedding code, + * i.e. not from a down-call, so the callbacks native array is not set-up properly. Moreover, + * this call is made during R initialization, so it not entirely clear if the FFI implementation + * has been fully initialized yet. */ @SuppressWarnings("unused") private static void setParams(boolean quietA, boolean slaveA, boolean interactiveA, boolean verboseA, boolean loadSiteFileA, @@ -110,9 +110,9 @@ public class REmbedded { } /** - * N.B. This expression cannot contain any R functions, e.g. "invisible", because at the time it is - * evaluated the R builtins have not been installed, see {@link #initializeR}. The suppression of - * printing is handled a a special case based on {@link Internal#INIT_EMBEDDED}. + * N.B. This expression cannot contain any R functions, e.g. "invisible", because at the time it + * is evaluated the R builtins have not been installed, see {@link #initializeR}. The + * suppression of printing is handled a a special case based on {@link Internal#INIT_EMBEDDED}. */ private static final Source INIT = Source.newBuilder("R", "1", "<embedded>").buildLiteral(); @@ -151,8 +151,9 @@ public class REmbedded { /** * Upcalled from embedded mode via JNI to (really) commit suicide. This provides the default - * implementation of the {@code R_Suicide} function in the {@code Rinterface} API. If an embeddee - * overrides it, it typically will save this value and invoke it after its own customization. + * implementation of the {@code R_Suicide} function in the {@code Rinterface} API. If an + * embeddee overrides it, it typically will save this value and invoke it after its own + * customization. */ @SuppressWarnings("unused") private static void R_Suicide(String msg) { diff --git a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/managed/Managed_DownCallNodeFactory.java b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/managed/Managed_DownCallNodeFactory.java index f2141a851ceeab75ffd2acef3efb666986e85a3e..5f952229b637ac62bd2a4ec1fb1a02db48bd5707 100644 --- a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/managed/Managed_DownCallNodeFactory.java +++ b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/managed/Managed_DownCallNodeFactory.java @@ -120,8 +120,9 @@ public final class Managed_DownCallNodeFactory extends DownCallNodeFactory { } /** - * Implements simplified version of the {@code mkdtemp} from {@code stdlib}. The reason why we do - * not use only Java version is that the real {@code mkdtemp} seems to be more reliable and secure. + * Implements simplified version of the {@code mkdtemp} from {@code stdlib}. The reason why we + * do not use only Java version is that the real {@code mkdtemp} seems to be more reliable and + * secure. */ private static final class Mkdtemp implements TruffleObject { private static final FileAttribute<Set<PosixFilePermission>> irwxuPermissions = PosixFilePermissions.asFileAttribute( @@ -175,8 +176,8 @@ public final class Managed_DownCallNodeFactory extends DownCallNodeFactory { } /** - * Gives the current working directory. For some reasons, this is not exactly equivalent to calling - * the C function, which manifests itself during codetools package installation. + * Gives the current working directory. For some reasons, this is not exactly equivalent to + * calling the C function, which manifests itself during codetools package installation. */ private static final class Getwd implements TruffleObject { @Override diff --git a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/nfi/TruffleNFI_Context.java b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/nfi/TruffleNFI_Context.java index 88e264d022a9200d569cbd3c677149590f27ca8f..d1e3aba0258a5e33e5114be04706cb544ae85252 100644 --- a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/nfi/TruffleNFI_Context.java +++ b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/nfi/TruffleNFI_Context.java @@ -105,9 +105,9 @@ final class TruffleNFI_Context extends RFFIContext { private RuntimeException lastException; /** - * Memory allocated using Rf_alloc, which should be reclaimed at every down-call exit. Note: this is - * less efficient than GNUR's version, we may need to implement it properly should the performance - * be a problem. + * Memory allocated using Rf_alloc, which should be reclaimed at every down-call exit. Note: + * this is less efficient than GNUR's version, we may need to implement it properly should the + * performance be a problem. */ public final ArrayList<Long> transientAllocations = new ArrayList<>(); diff --git a/com.oracle.truffle.r.launcher/src/com/oracle/truffle/r/launcher/RCmdOptions.java b/com.oracle.truffle.r.launcher/src/com/oracle/truffle/r/launcher/RCmdOptions.java index ae47a2ce3f87f5ad4231c981663d678c2c3dad53..f402d46bd91411a36d0dc25b14d08bc825acf36b 100644 --- a/com.oracle.truffle.r.launcher/src/com/oracle/truffle/r/launcher/RCmdOptions.java +++ b/com.oracle.truffle.r.launcher/src/com/oracle/truffle/r/launcher/RCmdOptions.java @@ -256,16 +256,16 @@ public final class RCmdOptions { } /** - * Parse the arguments from the standard R/Rscript command line syntax, setting the corresponding - * values. + * Parse the arguments from the standard R/Rscript command line syntax, setting the + * corresponding values. * * R supports {@code --arg=value} or {@code -arg value} for string-valued options. * - * The spec for {@code commandArgs()} states that it returns the executable by which R was invoked - * in element 0, which is consistent with the C {@code main} function, but defines the exact form to - * be platform independent. Java does not provide the executable (for obvious reasons) so we use - * "FastR". However, embedded mode does pass the executable in {@code args[0]} and we do not want to - * parse that! + * The spec for {@code commandArgs()} states that it returns the executable by which R was + * invoked in element 0, which is consistent with the C {@code main} function, but defines the + * exact form to be platform independent. Java does not provide the executable (for obvious + * reasons) so we use "FastR". However, embedded mode does pass the executable in + * {@code args[0]} and we do not want to parse that! */ public static RCmdOptions parseArguments(Client client, String[] args, boolean reparse) { EnumMap<RCmdOption, Object> options = new EnumMap<>(RCmdOption.class); diff --git a/com.oracle.truffle.r.launcher/src/com/oracle/truffle/r/launcher/RStartParams.java b/com.oracle.truffle.r.launcher/src/com/oracle/truffle/r/launcher/RStartParams.java index 8e105b3f70ec82a45fddda44eb816ba00b1b5c1b..3a3ac5765177fdb5a336ad9b9ee0c3ac136171d9 100644 --- a/com.oracle.truffle.r.launcher/src/com/oracle/truffle/r/launcher/RStartParams.java +++ b/com.oracle.truffle.r.launcher/src/com/oracle/truffle/r/launcher/RStartParams.java @@ -89,9 +89,9 @@ public class RStartParams { this.slave = options.getBoolean(SLAVE); /* - * GnuR behavior differs from the manual entry for {@code interactive} in that {@code --interactive} - * never applies to {@code -e/-f}, only to console input that has been redirected from a pipe/file - * etc. + * GnuR behavior differs from the manual entry for {@code interactive} in that {@code + * --interactive} never applies to {@code -e/-f}, only to console input that has been + * redirected from a pipe/file etc. */ String file = options.getString(FILE); List<String> expressions = options.getStringList(EXPR); diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/GridColorUtils.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/GridColorUtils.java index 9558c56840ffc009159cf58c23670e17ab3fec2a..1ac59d91f5c367e8593ba2aea1f043c045cdf8d0 100644 --- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/GridColorUtils.java +++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/GridColorUtils.java @@ -35,8 +35,8 @@ public final class GridColorUtils { } /** - * Converts given object into {@link GridColor}. The object may be a vector, in which case the index - * modulo its size is used to select element of that vector. + * Converts given object into {@link GridColor}. The object may be a vector, in which case the + * index modulo its size is used to select element of that vector. */ public static GridColor getColor(Object value, int index) { GridColor color = GridColorUtils.getPaletteColor(value, index); @@ -61,9 +61,10 @@ public final class GridColorUtils { } /** - * Converts the representation of color used within R, e.g. as value for {@code gpar(col='value')}, - * to our internal representation that grid device should understand. The acceptable color formats - * are: name of known color, HTML style hex value, and HTML style hex value including alpha. + * Converts the representation of color used within R, e.g. as value for + * {@code gpar(col='value')}, to our internal representation that grid device should understand. + * The acceptable color formats are: name of known color, HTML style hex value, and HTML style + * hex value including alpha. */ public static GridColor gridColorFromString(String value) { if (value.startsWith("#") && (value.length() == 7 || value.length() == 9)) { diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/Unit.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/Unit.java index e70b7b641f45d59eff769c0d28b7fd1e88fd3864..6a49ad98346cdbddb0f6f7df3f6f76c33fdd2d57 100644 --- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/Unit.java +++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/Unit.java @@ -426,16 +426,16 @@ public final class Unit { /** * Arithmetic unit objects can represent 'vectorized' expressions, e.g. - * {@code 3*c(unit(1,'cm'), unit(2,'mm'))}, in such case the 'length' is not simply the length of - * the underlying vector/list. + * {@code 3*c(unit(1,'cm'), unit(2,'mm'))}, in such case the 'length' is not simply the length + * of the underlying vector/list. */ public static int getLength(RAbstractContainer unit) { return UnitLengthVisitor.INSTANCE.visit(unit); } /** - * Returns {@code true} if the given unit object represents a unit without actual unit type, i.e. - * the unit type is {@link #NULL}. Such units are used internally for layouting, and the + * Returns {@code true} if the given unit object represents a unit without actual unit type, + * i.e. the unit type is {@link #NULL}. Such units are used internally for layouting, and the * interpretation is to take-up all the left space (evenly if there are more such units). */ public static boolean isRelativeUnit(GridContext ctx, Object unit, int index) { @@ -447,9 +447,9 @@ public final class Unit { } /** - * Used to discriminate between x axis, y axis, width, and height when doing unit conversions. The - * order should be the same as used in e.g. {@code L_convert}, which is 0 means x, 1 means y, 2 - * means width, 3 means height. + * Used to discriminate between x axis, y axis, width, and height when doing unit conversions. + * The order should be the same as used in e.g. {@code L_convert}, which is 0 means x, 1 means + * y, 2 means width, 3 means height. */ public enum AxisOrDimension { X, @@ -476,7 +476,8 @@ public final class Unit { /** * Wraps the data necessary for converting a unit to another unit. Note: {@code nullLMode} and * {@code nullAMode} is only used for converting 'NULL' units and is only explicitly set when - * calculating layout. When e.g. drawing or calculating bounds, both should have default zero value. + * calculating layout. When e.g. drawing or calculating bounds, both should have default zero + * value. */ public static final class UnitConversionContext { public final Size viewPortSize; @@ -638,8 +639,8 @@ public final class Unit { Object updatedGrob = ctx.evalInternalRFunction("grobConversionPreDraw", grob); /* - * The call to preDraw may have pushed viewports and/or enforced gpar settings, SO we need to - * re-establish the current viewport and gpar settings before evaluating the width unit. + * The call to preDraw may have pushed viewports and/or enforced gpar settings, SO we need + * to re-establish the current viewport and gpar settings before evaluating the width unit. */ currentVP = ctx.getGridState().getViewPort(); RList currentGP = ctx.getGridState().getGpar(); diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/device/awt/Graphics2DDevice.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/device/awt/Graphics2DDevice.java index 806ed306b251caef8c9a6d6e15b6d4524606b3ef..1a155c3c63e6f160e2b3ca42db5fc89515892153 100644 --- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/device/awt/Graphics2DDevice.java +++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/device/awt/Graphics2DDevice.java @@ -74,8 +74,8 @@ public class Graphics2DDevice implements GridDevice { * @param graphics Object that should be used for the drawing. * @param width Width of the drawing area in AWT units. * @param height Height of the drawing area in AWT units. - * @param graphicsIsExclusive If the graphics object is exclusively used for drawing only by this - * class, then it can optimize some things. + * @param graphicsIsExclusive If the graphics object is exclusively used for drawing only by + * this class, then it can optimize some things. */ public Graphics2DDevice(Graphics2D graphics, int width, int height, boolean graphicsIsExclusive) { setGraphics2D(graphics); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DoCall.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DoCall.java index 66c49f3c0a52f161265f6f622a32b9430d595d1d..289fadac02fa12812e51ce2975fe7fcd3d1c499d 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DoCall.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/DoCall.java @@ -141,8 +141,8 @@ public abstract class DoCall extends RBuiltinNode.Arg4 implements InternalRSynta } /** - * Because the underlying AST in {@link RExplicitCallNode} may cache frame slots, i.e. expect the - * {@link FrameDescriptor} to never change, we're caching this AST and also + * Because the underlying AST in {@link RExplicitCallNode} may cache frame slots, i.e. + * expect the {@link FrameDescriptor} to never change, we're caching this AST and also * {@link GetVisibilityNode} for each {@link FrameDescriptor} we encounter. */ @Specialization(guards = {"getFrameDescriptor(env) == fd"}, limit = "20") @@ -163,8 +163,8 @@ public abstract class DoCall extends RBuiltinNode.Arg4 implements InternalRSynta } /** - * Slow-path version avoids the problem by creating {@link RExplicitCallNode} for every call again - * and again and putting it behind truffle boundary to avoid deoptimization. + * Slow-path version avoids the problem by creating {@link RExplicitCallNode} for every call + * again and again and putting it behind truffle boundary to avoid deoptimization. */ @Specialization(replaces = "doFastPath") public Object doSlowPath(VirtualFrame virtualFrame, String funcName, RFunction func, RList argsAsList, boolean quote, REnvironment env, @@ -182,10 +182,10 @@ public abstract class DoCall extends RBuiltinNode.Arg4 implements InternalRSynta } /** - * The contract is that the function call will be evaluated in the given environment, but at the - * same time some primitives expect to see {@code do.call(foo, ...)} as the caller, so we create a - * frame the fakes caller, but otherwise delegates to the frame backing the explicitly given - * environment. + * The contract is that the function call will be evaluated in the given environment, but at + * the same time some primitives expect to see {@code do.call(foo, ...)} as the caller, so + * we create a frame the fakes caller, but otherwise delegates to the frame backing the + * explicitly given environment. */ private static MaterializedFrame getEvalFrame(VirtualFrame virtualFrame, MaterializedFrame envFrame) { return VirtualEvalFrame.create(envFrame, RArguments.getFunction(virtualFrame), RArguments.getCall(virtualFrame)); @@ -193,10 +193,11 @@ public abstract class DoCall extends RBuiltinNode.Arg4 implements InternalRSynta /** * If the call leads to actual call via - * {@link com.oracle.truffle.r.nodes.function.call.CallRFunctionNode}, which creates new frame and - * new set of arguments for it, then for this new arguments we explicitly provide a caller that - * looks like the function was called from the explicitly given environment (it will be its parent - * call), but at the same time its depth is one above the do.call function that actually invoked it. + * {@link com.oracle.truffle.r.nodes.function.call.CallRFunctionNode}, which creates new + * frame and new set of arguments for it, then for this new arguments we explicitly provide + * a caller that looks like the function was called from the explicitly given environment + * (it will be its parent call), but at the same time its depth is one above the do.call + * function that actually invoked it. * * @see RCaller * @see RArguments 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 40e244346f559d36e8638447cabec46183141d31..997d7590dafc7a474c8ff05d6608e850117faf32 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 @@ -136,12 +136,12 @@ public class FileFunctions { @TruffleBoundary protected RLogicalVector doFileAppend(RAbstractStringVector file1Vec, RAbstractStringVector file2Vec) { /* - * There are two simple (non-trivial) cases and one tricky 1. 1. Append one or more files to a - * single file (len1 == 1, len2 >= 1) 2. Append one file to one file for several files (len1 == - * len2) + * There are two simple (non-trivial) cases and one tricky 1. 1. Append one or more + * files to a single file (len1 == 1, len2 >= 1) 2. Append one file to one file for + * several files (len1 == len2) * - * The tricky case is when len1 > 1 && len2 > len1. E.g. f1,f2 <- g1,g2,g3 In this case, this is - * really f1,f2,f1 <- g1,g2,g3 + * The tricky case is when len1 > 1 && len2 > len1. E.g. f1,f2 <- g1,g2,g3 In this case, + * this is really f1,f2,f1 <- g1,g2,g3 */ int len1 = file1Vec.getLength(); @@ -277,14 +277,14 @@ public class FileFunctions { @TruffleBoundary protected RList doFileInfo(RAbstractStringVector vec, @SuppressWarnings("unused") Boolean extraCols) { /* - * Create a list, the elements of which are vectors of length vec.getLength() containing the - * information. The R closure that called the .Internal turns the result into a dataframe and sets - * the row.names attributes to the paths in vec. It also updates the mtime, ctime, atime fields - * using .POSIXct. + * Create a list, the elements of which are vectors of length vec.getLength() containing + * the information. The R closure that called the .Internal turns the result into a + * dataframe and sets the row.names attributes to the paths in vec. It also updates the + * mtime, ctime, atime fields using .POSIXct. * - * We try to use the JDK classes, even though they provide a more abstract interface than R. In - * particular there seems to be no way to get the uid/gid values. We might be better off justing - * using a native call. + * We try to use the JDK classes, even though they provide a more abstract interface + * than R. In particular there seems to be no way to get the uid/gid values. We might be + * better off justing using a native call. * * TODO implement extras_cols=FALSE */ @@ -616,8 +616,9 @@ public class FileFunctions { boolean includeDirs, boolean noDotDot) { /* - * Pattern in first element of vector, remaining elements are ignored (as per GnuR). N.B. The - * pattern matches file names not paths, which means we cannot just use the Java File path matcher. + * Pattern in first element of vector, remaining elements are ignored (as per GnuR). + * N.B. The pattern matches file names not paths, which means we cannot just use the + * Java File path matcher. */ String pattern = null; @@ -665,7 +666,8 @@ public class FileFunctions { files.add(file.toString()); } /* - * Annoyingly "." and ".." are never visited by Files.find, so we have to process them manually. + * Annoyingly "." and ".." are never visited by Files.find, so we have to + * process them manually. */ if (!noDotDot) { if (pattern == null || pattern.matcher(DOT).find()) { @@ -946,8 +948,8 @@ public class FileFunctions { // copy to existing files is skipped unless overWrite if (!Files.exists(toPath) || overwrite) { /* - * toB Be careful if toPath is a directory, if empty Java will replace it with a plain file, - * otherwise the copy will fail + * toB Be careful if toPath is a directory, if empty Java will + * replace it with a plain file, otherwise the copy will fail */ Files.copy(fromPath, toPath, copyOptions); status[i] = RRuntime.LOGICAL_TRUE; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Format.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Format.java index 3d23226e6a0ac14fc7c5b10fe79a0b7d20beeb95..cf1d6a731da2e7806d2c7effba057ddeec4eed87 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Format.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Format.java @@ -5,7 +5,7 @@ * * Copyright (c) 1995-2012, The R Core Team * Copyright (c) 2003, The R Foundation - * Copyright (c) 2014, 2017, Oracle and/or its affiliates + * Copyright (c) 2014, 2018, Oracle and/or its affiliates * * All rights reserved. */ 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 57731e227b22dd8f2276bab6d1ef293444526e7a..3ec9be5ccfee7e492d9ce5d8f13779eb1488f683 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 @@ -107,8 +107,8 @@ public class FrameFunctions { private final ConditionProfile currentFrameProfile = ConditionProfile.createBinaryProfile(); /** - * Determine the frame access mode of a subclass. The rule of thumb is that subclasses that only use - * the frame internally should not materialize it, i.e., they should use + * Determine the frame access mode of a subclass. The rule of thumb is that subclasses that + * only use the frame internally should not materialize it, i.e., they should use * {@link FrameAccess#READ_ONLY} or {@link FrameAccess#READ_WRITE}. */ private final FrameAccess access; @@ -218,12 +218,13 @@ public class FrameFunctions { * unlike, {@code sys.call}, the {@code call} argument can be provided by the caller. "..." is a * significant complication for two reasons: * <ol> - * <li>If {@code expand.dots} is {@code false} the "..." args are wrapped in a {@code pairlist}</li> - * <li>One of the args might itself be "..." in which case the values have to be retrieved from the - * environment associated with caller of the function containing {@code match.call}.</li> + * <li>If {@code expand.dots} is {@code false} the "..." args are wrapped in a {@code pairlist} + * </li> + * <li>One of the args might itself be "..." in which case the values have to be retrieved from + * the environment associated with caller of the function containing {@code match.call}.</li> * </ol> - * In summary, although the simple cases are indeed simple, there are many possible variants using - * "..." that make the code a lot more complex that it seems it ought to be. + * In summary, although the simple cases are indeed simple, there are many possible variants + * using "..." that make the code a lot more complex that it seems it ought to be. */ @RBuiltin(name = "match.call", kind = INTERNAL, parameterNames = {"definition", "call", "expand.dots", "envir"}, behavior = COMPLEX) public abstract static class MatchCall extends RBuiltinNode.Arg4 { @@ -241,8 +242,8 @@ public class FrameFunctions { @Specialization protected RLanguage matchCall(RFunction definition, Object callObj, byte expandDotsL, REnvironment env) { /* - * definition==null in the standard (default) case, in which case we get the RFunction from the - * calling frame + * definition==null in the standard (default) case, in which case we get the RFunction + * from the calling frame */ RLanguage call = checkCall(callObj); if (expandDotsL == RRuntime.LOGICAL_NA) { @@ -256,8 +257,9 @@ public class FrameFunctions { @TruffleBoundary private static RLanguage doMatchCall(MaterializedFrame cframe, RFunction definition, RLanguage call, boolean expandDots) { /* - * We have to ensure that all parameters are named, in the correct order, and deal with "...". This - * process has a lot in common with MatchArguments, which we use as a starting point + * We have to ensure that all parameters are named, in the correct order, and deal with + * "...". This process has a lot in common with MatchArguments, which we use as a + * starting point */ RCallNode callNode = (RCallNode) RASTUtils.unwrap(call.getRep()); CallArgumentsNode callArgs = callNode.createArguments(null, false, true); 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 6e3a30e828272d12eedca5addb15d1565ae57459..e890e3144ff0c462ea8529265ad33ea62f698ada 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 @@ -875,8 +875,8 @@ public abstract class Match extends RBuiltinNode.Arg4 { } /** - * Set the "complete" status. If {@code nomatch} is not NA (uncommon), then the result vector is - * always COMPLETE, otherwise it is INCOMPLETE unless everything matched. + * Set the "complete" status. If {@code nomatch} is not NA (uncommon), then the result + * vector is always COMPLETE, otherwise it is INCOMPLETE unless everything matched. */ private static boolean setCompleteState(boolean matchAll, int nomatch) { return nomatch != RRuntime.INT_NA || matchAll ? RDataFactory.COMPLETE_VECTOR : RDataFactory.INCOMPLETE_VECTOR; 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 a7e9cde29440df9768296811fb32020428499143..b36d37b4337ef084bfe0f07a1def52c089b4e6e9 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 @@ -90,16 +90,16 @@ public abstract class Substitute extends RBuiltinNode.Arg2 { /** * Handles all above specializations. Transforms an AST into another AST, with the appropriate - * substitutions. The incoming AST will either denote a symbol, constant or function call (because - * in R everything else is a call). So in general, both the input and output is a call( language - * element). E.g. {@link IfNode} is a special case because it is not (currently) represented as a - * function, as are several other nodes. + * substitutions. The incoming AST will either denote a symbol, constant or function call + * (because in R everything else is a call). So in general, both the input and output is a call( + * language element). E.g. {@link IfNode} is a special case because it is not (currently) + * represented as a function, as are several other nodes. * * @param expr * @param env {@code null} if the {@code env} argument was {@code RMissing} to avoid always * materializing the current frame. - * @return in general an {@link RLanguage} instance, but simple cases could be a constant value or - * {@link RSymbol} + * @return in general an {@link RLanguage} instance, but simple cases could be a constant value + * or {@link RSymbol} */ private Object doSubstituteWithEnv(RPromise expr, REnvironment env) { // In the global environment, substitute behaves like quote diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/SpecialsUtils.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/SpecialsUtils.java index 2c33de3bfaac366b52f5cfc13dec304215442be1..6b2a39bafc38b684e9f4fb0e21b0ede586215e6f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/SpecialsUtils.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/SpecialsUtils.java @@ -84,9 +84,9 @@ class SpecialsUtils { } /** - * Checks if the value is single element that can be put into a list or vector as is, because in the - * case of vectors on the LSH of update we take each element and put it into the RHS of the update - * function. + * Checks if the value is single element that can be put into a list or vector as is, + * because in the case of vectors on the LSH of update we take each element and put it into + * the RHS of the update function. */ protected static boolean isSingleElement(Object value) { return value instanceof Integer || value instanceof Double || value instanceof Byte || value instanceof String; @@ -132,10 +132,10 @@ class SpecialsUtils { int intValue = (int) value; if (intValue <= 0) { /* - * Conversion from double to an index differs in subscript and subset for values in the ]0..1[ range - * (subscript interprets 0.1 as 1, whereas subset treats it as 0). We avoid this special case by - * simply going to the more generic case for this range. Additionally, (int) Double.NaN is 0, which - * is also caught by this case. + * Conversion from double to an index differs in subscript and subset for values in + * the ]0..1[ range (subscript interprets 0.1 as 1, whereas subset treats it as 0). + * We avoid this special case by simply going to the more generic case for this + * range. Additionally, (int) Double.NaN is 0, which is also caught by this case. */ CompilerDirectives.transferToInterpreterAndInvalidate(); throw new IllegalArgumentException(); diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/Subscript.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/Subscript.java index c853bf84558ddd1f4807669b390891a4f2da839e..1739039806a89df95b8a87788ce695ce498f29dd 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/Subscript.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/Subscript.java @@ -274,8 +274,8 @@ public abstract class Subscript extends RBuiltinNode.Arg4 { @Specialization(guards = "!indexes.isEmpty()") protected Object get(Object x, RArgsValuesAndNames indexes, RAbstractLogicalVector exact, @SuppressWarnings("unused") Object drop) { /* - * "drop" is not actually used by this builtin, but it needs to be in the argument list (because the - * "drop" argument needs to be skipped). + * "drop" is not actually used by this builtin, but it needs to be in the argument list + * (because the "drop" argument needs to be skipped). */ return extractNode.apply(x, indexes.getArguments(), exact, RLogical.TRUE); } diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/helpers/TraceHandling.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/helpers/TraceHandling.java index fa5ff62e78280738348ec4e22fc14705f8d848b0..bdf06d0ff098aa05d5d622e729821934a8df48c3 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/helpers/TraceHandling.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/helpers/TraceHandling.java @@ -194,7 +194,8 @@ public class TraceHandling { } /** - * Event listener for the case where user provided an expression to be evaluated on function entry. + * Event listener for the case where user provided an expression to be evaluated on function + * entry. */ private static class TracerFunctionEntryEventListener extends TraceEventListener { private final RLanguage tracer; diff --git a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/CastUtils.java b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/CastUtils.java index 8c0f67061b15afcc38a8a3639cd1a4fcb9d1ae5c..953535858fce50d42021defe253daedfc1c8cb05 100644 --- a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/CastUtils.java +++ b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/CastUtils.java @@ -255,11 +255,13 @@ public class CastUtils { }; /** - * It transforms this type coverage into another one that would be returned in the situation when - * the source and the target type were either positive or negative, as determined by the - * <code>sourcePositive</code> and <code>targetPositive</code> arguments. + * It transforms this type coverage into another one that would be returned in the + * situation when the source and the target type were either positive or negative, as + * determined by the <code>sourcePositive</code> and <code>targetPositive</code> + * arguments. * <p> - * N.B. It is assumed that this coverage is obtained for the positive source anb target types. + * N.B. It is assumed that this coverage is obtained for the positive source anb target + * types. */ public abstract Coverage transpose(Type sourceType, Type targetType, boolean sourcePositive, boolean targetPositive); diff --git a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/UpperBoundsConjunction.java b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/UpperBoundsConjunction.java index 62461febb276a0df5ed08f7fe263f44035d34e99..0bc5eb6c0824aee060531e0f3a5e1bef6e8889af 100644 --- a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/UpperBoundsConjunction.java +++ b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/UpperBoundsConjunction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, 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 diff --git a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java index c7ebd9a4b45ef038c3fed69010417971c27dacab..86b4bf422bc7cf74cc1e1d5730a9b93245269742 100644 --- a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java +++ b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java @@ -307,8 +307,9 @@ class ChimneySweeping extends SingleBuiltinDiagnostics { } /** - * Checks whether the argument samples are correct by passing them to the argument's pipeline. The - * positive samples should pass without any error, while the negative ones should cause an error. + * Checks whether the argument samples are correct by passing them to the argument's pipeline. + * The positive samples should pass without any error, while the negative ones should cause an + * error. * * @param i */ diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java index bea8d310858437be10b4c926572d88b8a86a46b2..d14aeadf41029b784ae396b003383ab6f2b8771b 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java @@ -421,10 +421,11 @@ public final class SpecialAttributesFunctions { RPairList pl = x.getPairListInternal(); if (pairListProfile.profile(pl == null)) { /* - * "names" for a language object is a special case, that is applicable to calls and returns the - * names of the actual arguments, if any. E.g. f(x=1, 3) would return c("", "x", ""). GnuR defines - * it as returning the "tag" values on the pairlist that represents the call. Well, we don't have a - * pairlist, (we could get one by serializing the expression), so we do it by AST walking. + * "names" for a language object is a special case, that is applicable to calls and + * returns the names of the actual arguments, if any. E.g. f(x=1, 3) would return + * c("", "x", ""). GnuR defines it as returning the "tag" values on the pairlist + * that represents the call. Well, we don't have a pairlist, (we could get one by + * serializing the expression), so we do it by AST walking. */ RStringVector names = RContext.getRRuntimeASTAccess().getNames(x); return names; diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/EnvironmentNodes.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/EnvironmentNodes.java index c1c7c48766441c3e694f4b0c5d2ec82c425ea7ae..83c3fa54eb7bfd1b8d5169b65ecae031d265b556 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/EnvironmentNodes.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/EnvironmentNodes.java @@ -45,8 +45,8 @@ import com.oracle.truffle.r.runtime.nodes.RBaseNode; public final class EnvironmentNodes { /** - * Convert an {@link RList} to an {@link REnvironment}, which is needed in several builtins, e.g. - * {@code substitute}. + * Convert an {@link RList} to an {@link REnvironment}, which is needed in several builtins, + * e.g. {@code substitute}. */ public abstract static class RList2EnvNode extends RBaseNode { private final boolean ignoreMissingNames; diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/casts/Filter.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/casts/Filter.java index 337b56f08e1dee53ede2433113e49a02ea5a1b29..302e3828077ae599ea2b0b433df1bd97719968e6 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/casts/Filter.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/casts/Filter.java @@ -563,7 +563,8 @@ public abstract class Filter<T, R extends T> { /** * This is an enumeration of possible fixed outcomes of a filter's test method for a given input - * value. It is used now only in connection with {@link RNull} and {@link RMissing} as input values. + * value. It is used now only in connection with {@link RNull} and {@link RMissing} as input + * values. * <P> * The <code>FALSE</code>, resp. <code>TRUE</code>, indicates that the filter will always return * <code>false</code>, resp. <code>true</code>, for the given input value. diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java index bc87ff97fcb7c3947407f3a5c23c5f93d44f0967..18abff07e0105d05e2ffa2ce5536b1abcbec6238 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java @@ -260,9 +260,9 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS } /** - * If there are no parameters, or the target function does not refer to a builtin, or the builtin - * has no special dispatching, then we know that we will just call the function with no special - * dispatch logic. + * If there are no parameters, or the target function does not refer to a builtin, or the + * builtin has no special dispatching, then we know that we will just call the function with no + * special dispatch logic. */ protected boolean isDefaultDispatch(RFunction function) { return (signature != null && signature.isEmpty()) || nullBuiltinProfile.profile(function.getRBuiltin() == null) || function.getRBuiltin().getDispatch() == RDispatch.DEFAULT; @@ -285,9 +285,9 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS } /** - * If the target function refers to a builtin that requires internal generic dispatch and there are - * actual parameters to dispatch on, then we will do an internal generic dispatch on the first - * parameter. + * If the target function refers to a builtin that requires internal generic dispatch and there + * are actual parameters to dispatch on, then we will do an internal generic dispatch on the + * first parameter. */ protected boolean isInternalGenericDispatch(RFunction function) { if (signature != null && signature.isEmpty()) { @@ -751,8 +751,9 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS } /** - * Creates a modified call in which the first N arguments are replaced by {@code replacementArgs}. - * This is only used to support {@code HiddenInternalFunctions.MakeLazy}. + * Creates a modified call in which the first N arguments are replaced by + * {@code replacementArgs}. This is only used to support + * {@code HiddenInternalFunctions.MakeLazy}. */ @TruffleBoundary public static RCallNode createCloneReplacingArgs(RCallNode call, RSyntaxNode... replacementArgs) { @@ -814,8 +815,8 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS /** * Note: s3DefaultArguments is intended to carry default arguments from - * {@link RCallNode#callGroupGeneric} if the R dispatch method has some. Currently this is only the - * case for 'summary' group so this argument is either null or set to + * {@link RCallNode#callGroupGeneric} if the R dispatch method has some. Currently this is + * only the case for 'summary' group so this argument is either null or set to * {@link RArguments#SUMMARY_GROUP_DEFAULT_VALUE_NA_RM} */ public abstract Object execute(VirtualFrame frame, RFunction function, Object varArgs, Object s3Args, Object s3DefaultArguments); @@ -881,7 +882,8 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS } /* - * Use a TruffleBoundaryNode to be able to switch child nodes without invalidating the whole method. + * Use a TruffleBoundaryNode to be able to switch child nodes without invalidating the whole + * method. */ protected final class GenericCall extends TruffleBoundaryNode { diff --git a/com.oracle.truffle.r.test.packages.analyzer/src/com/oracle/truffle/r/test/packages/analyzer/detectors/Detector.java b/com.oracle.truffle.r.test.packages.analyzer/src/com/oracle/truffle/r/test/packages/analyzer/detectors/Detector.java index 33b061aedcfa7ef2ef3338d020c2d3eaa438f953..d3ee4bee211f419dcaa80b8311db3208b6e19ce9 100644 --- a/com.oracle.truffle.r.test.packages.analyzer/src/com/oracle/truffle/r/test/packages/analyzer/detectors/Detector.java +++ b/com.oracle.truffle.r.test.packages.analyzer/src/com/oracle/truffle/r/test/packages/analyzer/detectors/Detector.java @@ -55,8 +55,8 @@ public abstract class Detector<T> { /** * @param pkgTestRun The package test run any problems should be associated with. - * @param startLineLocation The location of the first line, i.e., of body[0], or <code>null</code> - * if body is empty. + * @param startLineLocation The location of the first line, i.e., of body[0], or + * <code>null</code> if body is empty. * @param body The content to analyze (e.g. a list of lines in a file). * @return A list of detected problems (must not be {@code null}). */ diff --git a/com.oracle.truffle.r.test.tck/src/com/oracle/truffle/r/test/tck/RTCKLanguageProvider.java b/com.oracle.truffle.r.test.tck/src/com/oracle/truffle/r/test/tck/RTCKLanguageProvider.java index 3ef42d66324917b0907b26ed8a5de2d9c29bac3c..82d35b82752d20ce4c7a8912276db15eb2eb4f6c 100644 --- a/com.oracle.truffle.r.test.tck/src/com/oracle/truffle/r/test/tck/RTCKLanguageProvider.java +++ b/com.oracle.truffle.r.test.tck/src/com/oracle/truffle/r/test/tck/RTCKLanguageProvider.java @@ -386,8 +386,8 @@ public final class RTCKLanguageProvider implements LanguageProvider { } /** - * Enables result verifier to handle empty arrays. Use this for R expressions, statements which - * accept array but not an empty array + * Enables result verifier to handle empty arrays. Use this for R expressions, + * statements which accept array but not an empty array * * @return the Builder */