From c07c4db3756adaf243dc2be151a06d286d55a0d1 Mon Sep 17 00:00:00 2001
From: stepan <stepan.sindelar@oracle.com>
Date: Fri, 23 Feb 2018 18:26:14 +0100
Subject: [PATCH] Remove dead code

---
 .../com/oracle/truffle/r/engine/REngine.java  |   9 --
 .../r/engine/RRuntimeASTAccessImpl.java       |   1 -
 .../truffle/r/engine/shell/REmbedded.java     |   2 +
 .../truffle/r/launcher/RCmdOptions.java       |  10 +-
 .../r/library/fastrGrid/GridColorUtils.java   |  20 +---
 .../r/library/fastrGrid/GridState.java        |  11 +-
 .../truffle/r/library/fastrGrid/LPoints.java  |   7 +-
 .../r/library/fastrGrid/color/RGB.java        |  13 +--
 .../fastrGrid/device/DrawingContext.java      |  16 +--
 .../library/methods/MethodsListDispatch.java  |   4 +-
 .../truffle/r/library/methods/Slot.java       |   3 +-
 .../r/library/stats/RMultinomNode.java        |   3 +-
 .../r/nodes/access/AccessArgumentNode.java    |   2 -
 .../access/WriteLocalFrameVariableNode.java   |   6 +-
 .../access/vector/PositionCheckNode.java      |   3 +-
 .../nodes/attributes/CopyAttributesNode.java  |   2 -
 .../attributes/GetFixedAttributeNode.java     |   4 +-
 .../attributes/RemoveFixedAttributeNode.java  |   4 +-
 .../attributes/SetFixedAttributeNode.java     |   7 +-
 .../SpecialAttributesFunctions.java           |   2 -
 .../attributes/UnaryCopyAttributesNode.java   |   2 -
 .../truffle/r/nodes/builtin/RBuiltinNode.java |   4 +-
 .../builtin/casts/ExecutionPathVisitor.java   |   4 +-
 .../truffle/r/nodes/control/BlockNode.java    |   4 +-
 .../function/FunctionDefinitionNode.java      |   2 -
 .../function/FunctionExpressionNode.java      |   3 +-
 .../nodes/function/S3FunctionLookupNode.java  |   4 +-
 .../oracle/truffle/r/nodes/unary/MapNode.java |   6 +-
 .../r/runtime/ProcessOutputManager.java       |   3 +-
 .../oracle/truffle/r/runtime/RDeparse.java    |   2 +-
 .../oracle/truffle/r/runtime/RSerialize.java  |   9 +-
 .../truffle/r/runtime/context/RContext.java   |   3 -
 .../r/runtime/data/NativeDataAccess.java      |   4 -
 .../data/RForeignNamedListWrapper.java        |   3 +-
 .../oracle/truffle/r/runtime/data/RList.java  |   4 +-
 .../truffle/r/runtime/data/RVector.java       |   2 -
 .../truffle/r/runtime/ffi/NativeFunction.java |   2 -
 .../truffle/r/runtime/ffi/REmbedRFFI.java     |   8 --
 .../oracle/truffle/r/runtime/nmath/Mach.java  |   4 +-
 .../r/runtime/nmath/distr/RMultinom.java      | 105 ------------------
 mx.fastr/copyrights/overrides                 |   1 -
 41 files changed, 38 insertions(+), 270 deletions(-)
 delete mode 100644 com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/RMultinom.java

diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/REngine.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/REngine.java
index 283b32fc89..9ea740469f 100644
--- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/REngine.java
+++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/REngine.java
@@ -209,15 +209,6 @@ final class REngine implements Engine, Engine.Timings {
         }
     }
 
-    public void initializeRNG() {
-        assert REnvironment.globalEnv() != null;
-        RFunction fun = context.lookupBuiltin(".fastr.set.seed");
-        ActiveBinding dotRandomSeed = new ActiveBinding(RType.Any, fun, true);
-        Frame frame = REnvironment.globalEnv().getFrame();
-        FrameSlot slot = FrameSlotChangeMonitor.findOrAddFrameSlot(frame.getFrameDescriptor(), RRNG.RANDOM_SEED, FrameSlotKind.Object);
-        FrameSlotChangeMonitor.setActiveBinding(frame, slot, dotRandomSeed, false, null);
-    }
-
     @Override
     public void checkAndRunStartupShutdownFunction(String name, String... args) {
         Object func = REnvironment.globalEnv().findFunction(name);
diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RRuntimeASTAccessImpl.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RRuntimeASTAccessImpl.java
index 66ac4a2b31..1e8fa828c1 100644
--- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RRuntimeASTAccessImpl.java
+++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RRuntimeASTAccessImpl.java
@@ -686,7 +686,6 @@ class RRuntimeASTAccessImpl implements RRuntimeASTAccess {
                 arg = null;
             } else if (arg.startsWith(">")) {
                 assert !intern;
-                arg = null;
                 throw RError.nyi(RError.NO_CALLER, "stdout redirect");
             }
             if (arg != null) {
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 952f2069c8..0815c3bc09 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
@@ -118,6 +118,8 @@ public class REmbedded {
      */
     private static final Source INIT = Source.newBuilder("R", "1", "<embedded>").buildLiteral();
 
+    // TODO: to be invoked from native
+    @SuppressWarnings("unused")
     private static void endRmainloop(int status) {
         context.leave();
         context.close();
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 d21b3d68e3..54f4d5fa33 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
@@ -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
@@ -337,14 +337,6 @@ public final class RCmdOptions {
         this.arguments = arguments;
     }
 
-    void printHelpAndVersion() {
-        if (getBoolean(HELP)) {
-            throw printHelpAndExit(RCmdOptions.Client.R);
-        } else if (getBoolean(VERSION)) {
-            throw printVersionAndExit();
-        }
-    }
-
     static void printHelp(Client client) {
         System.out.println(client.usage());
         System.out.println("Options:");
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 9f4f4f046c..77cd59a19d 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
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1997-2014, The R Core Team
  * Copyright (c) 2003, The R Foundation
- * Copyright (c) 2017, Oracle and/or its affiliates
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -83,24 +83,6 @@ public final class GridColorUtils {
         return result;
     }
 
-    public static String gridColorToRString(GridColor color) {
-        boolean isOpaque = color.getAlpha() == GridColor.OPAQUE_ALPHA;
-        int size = isOpaque ? 7 : 9;
-        char[] value = new char[size];
-        value[0] = '#';
-        value[1] = getHexDigit(color.getRed() >> 4);
-        value[2] = getHexDigit(color.getRed());
-        value[3] = getHexDigit(color.getGreen() >> 4);
-        value[4] = getHexDigit(color.getGreen());
-        value[5] = getHexDigit(color.getBlue() >> 4);
-        value[6] = getHexDigit(color.getBlue());
-        if (!isOpaque) {
-            value[7] = getHexDigit((color.getAlpha()) >> 4);
-            value[8] = getHexDigit(color.getAlpha());
-        }
-        return new String(value);
-    }
-
     public static GridColor parseHex(String value) {
         // hex format, e.g. #ffffff
         int red = Integer.parseInt(value.substring(1, 3), 16);
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/GridState.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/GridState.java
index 77f8e4293e..df31021b88 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/GridState.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/GridState.java
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2001-3 Paul Murrell
  * Copyright (c) 1998-2013, The R Core Team
- * Copyright (c) 2017, Oracle and/or its affiliates
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -179,15 +179,6 @@ public final class GridState {
                 colors[i] = GridColorUtils.gridColorFromString(colorNames[i]);
             }
         }
-
-        public GridPalette(int[] colors) {
-            this.colors = new GridColor[colors.length];
-            colorNames = new String[colors.length];
-            for (int i = 0; i < colors.length; i++) {
-                this.colors[i] = GridColor.fromRawValue(colors[i]);
-                colorNames[i] = GridColorUtils.gridColorToRString(this.colors[i]);
-            }
-        }
     }
 
     static final class GridDeviceState {
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/LPoints.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/LPoints.java
index 9cb924d7fe..5fd36b0f88 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/LPoints.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/LPoints.java
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2001-3 Paul Murrell
  * Copyright (c) 1998-2015, The R Core Team
- * Copyright (c) 2017, Oracle and/or its affiliates
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -62,7 +62,6 @@ public abstract class LPoints extends RExternalBuiltinNode.Arg4 {
         RList currentVP = ctx.getGridState().getViewPort();
         RList gparList = ctx.getGridState().getGpar();
         GPar gpar = GPar.create(gparList);
-        double cex = GPar.getCex(gparList);
         ViewPortTransform vpTransform = ViewPortTransform.get(currentVP, dev);
         ViewPortContext vpContext = ViewPortContext.fromViewPort(currentVP);
         UnitConversionContext conversionCtx = new UnitConversionContext(vpTransform.size, vpContext, dev, gpar);
@@ -75,13 +74,13 @@ public abstract class LPoints extends RExternalBuiltinNode.Arg4 {
             double size = Unit.convertWidth(sizeVec, i, conversionCtx);
             if (loc.isFinite() && Double.isFinite(size)) {
                 contextCache = contextCache.from(gpar.getDrawingContext(i));
-                drawSymbol(contextCache, dev, cex, pchVec.getDataAt(i % pchVec.getLength()), size * SIZE_FACTOR, loc.x, loc.y);
+                drawSymbol(contextCache, dev, pchVec.getDataAt(i % pchVec.getLength()), size * SIZE_FACTOR, loc.x, loc.y);
             }
         }
         return RNull.instance;
     }
 
-    private static void drawSymbol(ContextCache ctxCache, GridDevice dev, double cex, int pch, double halfSize, double x, double y) {
+    private static void drawSymbol(ContextCache ctxCache, GridDevice dev, int pch, double halfSize, double x, double y) {
         // pch 0 - 25 are interpreted as geometrical shapes, pch from ascii code of ' ' are
         // interpreted as corresponding ascii character, which should be drawn
         // the coordinates should be interpreted as the center of the symbol
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/color/RGB.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/color/RGB.java
index e599a553cd..6cc23c226a 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/color/RGB.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/color/RGB.java
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1997-2014, The R Core Team
  * Copyright (c) 2003, The R Foundation
- * Copyright (c) 2017, Oracle and/or its affiliates
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -85,17 +85,6 @@ public abstract class RGB extends RExternalBuiltinNode.Arg6 {
     @TypeSystemReference(RTypes.class)
     abstract static class RGBBase extends RBaseNode {
 
-        protected static int addColor(boolean alpha, int[] result, int start, GridColor color) {
-            int pos = start;
-            result[pos++] = color.getRed();
-            result[pos++] = color.getGreen();
-            result[pos++] = color.getBlue();
-            if (alpha) {
-                result[pos++] = color.getAlpha();
-            }
-            return pos;
-        }
-
         private static final char[] HexDigits = "0123456789ABCDEF".toCharArray();
 
         protected static String rgb2rgb(int r, int g, int b) {
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/device/DrawingContext.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/device/DrawingContext.java
index dcfb747b4f..a285fb0a2a 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/device/DrawingContext.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/device/DrawingContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -149,18 +149,4 @@ public interface DrawingContext {
      * The fill color of shapes.
      */
     GridColor getFillColor();
-
-    static boolean areSame(DrawingContext ctx1, DrawingContext ctx2) {
-        return ctx1 == ctx2 || (ctx1.getColor().equals(ctx2.getColor()) &&
-                        ctx1.getLineEnd() == ctx2.getLineEnd() &&
-                        ctx1.getLineJoin() == ctx2.getLineJoin() &&
-                        ctx1.getLineType() == ctx2.getLineType() &&
-                        ctx1.getLineHeight() == ctx2.getLineHeight() &&
-                        ctx1.getFontStyle() == ctx2.getFontStyle() &&
-                        ctx1.getFontSize() == ctx2.getFontSize() &&
-                        ctx1.getFontFamily().equals(ctx2.getFontFamily()) &&
-                        ctx1.getLineWidth() == ctx2.getLineWidth() &&
-                        ctx1.getLineMitre() == ctx2.getLineMitre() &&
-                        ctx1.getFillColor().equals(ctx2.getFillColor()));
-    }
 }
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/methods/MethodsListDispatch.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/methods/MethodsListDispatch.java
index b425dc3efb..9929505c65 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/methods/MethodsListDispatch.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/methods/MethodsListDispatch.java
@@ -366,7 +366,6 @@ public class MethodsListDispatch {
 
         @Child private CastToVectorNode castToVector = CastToVectorNodeGen.create(false);
         @Child private ClassHierarchyScalarNode classHierarchyNode = ClassHierarchyScalarNodeGen.create();
-        @Child private PromiseHelperNode promiseHelper;
         @Child private GetFixedAttributeNode getGenericAttrNode = GetFixedAttributeNode.create(RRuntime.GENERIC_ATTR_KEY);
         @Child private GetFixedAttributeNode getPckgAttrNode = GetFixedAttributeNode.create(RRuntime.PCKG_ATTR_KEY);
 
@@ -446,7 +445,6 @@ public class MethodsListDispatch {
     public abstract static class R_nextMethodCall extends RExternalBuiltinNode.Arg2 {
 
         @Child private LocalReadVariableNode readDotNextMethod;
-        @Child private LocalReadVariableNode readDots;
 
         static {
             Casts.noCasts(R_nextMethodCall.class);
@@ -459,7 +457,7 @@ public class MethodsListDispatch {
             // leading to a problem if contains a different frame; should we finesse implementation
             // of LocalReadVariableNode to handle this?
             readDotNextMethod = insert(LocalReadVariableNode.create(RRuntime.R_DOT_NEXT_METHOD, false));
-            readDots = insert(LocalReadVariableNode.create("...", false));
+            // TODO: do we need to handle "..." here? Read it and forward it?
 
             RFunction op = (RFunction) readDotNextMethod.execute(null, ev.getFrame());
             if (op == null) {
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/methods/Slot.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/methods/Slot.java
index d10cc835fe..8b72febafa 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/methods/Slot.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/methods/Slot.java
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1995-2013, The R Core Team
  * Copyright (c) 2003, The R Foundation
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -91,7 +91,6 @@ public class Slot {
     public abstract static class R_hasSlot extends RExternalBuiltinNode.Arg2 {
 
         @Child private HasSlotNode hasSlotNode;
-        @Child private CastToAttributableNode castAttributable = CastToAttributableNodeGen.create(true, true, true);
 
         static {
             Casts casts = new Casts(R_hasSlot.class);
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RMultinomNode.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RMultinomNode.java
index 0fcd70396e..664cedeb1b 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RMultinomNode.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RMultinomNode.java
@@ -6,7 +6,7 @@
  * Copyright (c) 1995, 1996  Robert Gentleman and Ross Ihaka
  * Copyright (c) 1997-2012, The R Core Team
  * Copyright (c) 2003-2008, The R Foundation
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -37,7 +37,6 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractDoubleVector;
 import com.oracle.truffle.r.runtime.data.nodes.VectorAccess;
 import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.SequentialIterator;
 import com.oracle.truffle.r.runtime.nmath.RandomFunctions.RandomNumberProvider;
-import com.oracle.truffle.r.runtime.nmath.distr.RMultinom;
 import com.oracle.truffle.r.runtime.nmath.distr.Rbinom;
 import com.oracle.truffle.r.runtime.nodes.RBaseNode;
 import com.oracle.truffle.r.runtime.rng.RRNG;
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/AccessArgumentNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/AccessArgumentNode.java
index edba93cf22..1010da72fc 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/AccessArgumentNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/AccessArgumentNode.java
@@ -57,8 +57,6 @@ import com.oracle.truffle.r.runtime.nodes.RSyntaxLookup;
  */
 public final class AccessArgumentNode extends RNode {
 
-    @Child private PromiseHelperNode promiseHelper;
-
     /**
      * The formal index of this argument.
      */
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/WriteLocalFrameVariableNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/WriteLocalFrameVariableNode.java
index 19b3ab595d..912472329f 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/WriteLocalFrameVariableNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/WriteLocalFrameVariableNode.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
@@ -49,10 +49,6 @@ public abstract class WriteLocalFrameVariableNode extends BaseWriteVariableNode
         return WriteLocalFrameVariableNodeGen.create(name, mode, rhs);
     }
 
-    public static WriteLocalFrameVariableNode createForRefCount(String name) {
-        return WriteLocalFrameVariableNodeGen.create(name, Mode.INVISIBLE, null);
-    }
-
     private final Mode mode;
 
     private final ValueProfile storedObjectProfile = ValueProfile.createClassProfile();
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/PositionCheckNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/PositionCheckNode.java
index bcd27aa7d7..3c4af86bd2 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/PositionCheckNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/PositionCheckNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -58,7 +58,6 @@ abstract class PositionCheckNode extends RBaseNode {
     protected final boolean replace;
     protected final RType containerType;
     @Child private PositionCastNode castNode;
-    @Child private RLengthNode positionLengthNode = RLengthNode.create();
     @Child private PositionCharacterLookupNode characterLookup;
 
     private final ElementAccessMode mode;
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/CopyAttributesNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/CopyAttributesNode.java
index aad0f72b6b..16a11fcb3e 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/CopyAttributesNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/CopyAttributesNode.java
@@ -33,7 +33,6 @@ import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetDimAt
 import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetDimNamesAttributeNode;
 import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetNamesAttributeNode;
 import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.SetDimNamesAttributeNode;
-import com.oracle.truffle.r.runtime.RRuntime;
 import com.oracle.truffle.r.runtime.data.RDataFactory;
 import com.oracle.truffle.r.runtime.data.RList;
 import com.oracle.truffle.r.runtime.data.RStringVector;
@@ -187,7 +186,6 @@ public abstract class CopyAttributesNode extends RBaseNode {
             if (hasDimNames.profile(newDimNames != null)) {
                 putDimNames.execute(result.getAttributes(), newDimNames);
 
-                newDimNames.elementNamePrefix = RRuntime.DIMNAMES_LIST_ELEMENT_NAME_PREFIX;
                 return result;
             }
             if (result != right) {
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/GetFixedAttributeNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/GetFixedAttributeNode.java
index ede99fc59e..6202383b3b 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/GetFixedAttributeNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/GetFixedAttributeNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -78,7 +78,7 @@ public abstract class GetFixedAttributeNode extends FixedAttributeAccessNode {
         return shape.hasProperty(name);
     }
 
-    @Specialization(limit = "3", //
+    @Specialization(limit = "CACHE_LIMIT", //
                     guards = {"shapeCheck(shape, attrs)"}, //
                     assumptions = {"shape.getValidAssumption()"})
     protected Object getAttrCached(DynamicObject attrs,
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/RemoveFixedAttributeNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/RemoveFixedAttributeNode.java
index ec325f05c1..5dac5faadb 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/RemoveFixedAttributeNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/RemoveFixedAttributeNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -73,7 +73,7 @@ public abstract class RemoveFixedAttributeNode extends FixedAttributeAccessNode
 
     public abstract void execute(Object attrs);
 
-    @Specialization(limit = "3", //
+    @Specialization(limit = "CACHE_LIMIT", //
                     guards = {"shapeCheck(shape, attrs)", "location == null"}, //
                     assumptions = {"shape.getValidAssumption()"})
     protected void removeNonExistantAttr(@SuppressWarnings("unused") DynamicObject attrs,
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SetFixedAttributeNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SetFixedAttributeNode.java
index 0f46af182b..14bd617b1b 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SetFixedAttributeNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SetFixedAttributeNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -53,7 +53,6 @@ import com.oracle.truffle.r.runtime.data.RAttributeStorage;
 public abstract class SetFixedAttributeNode extends FixedAttributeAccessNode {
 
     @Child private SetFixedAttributeNode recursive;
-    @Child private SetSpecialAttributeNode setSpecialAttrNode;
 
     protected SetFixedAttributeNode(String name) {
         super(name);
@@ -85,7 +84,7 @@ public abstract class SetFixedAttributeNode extends FixedAttributeAccessNode {
 
     public abstract void execute(Object attr, Object value);
 
-    @Specialization(limit = "3", //
+    @Specialization(limit = "CACHE_LIMIT", //
                     guards = {"shapeCheck(shape, attrs)", "location != null", "canSet(location, value)"}, //
                     assumptions = {"shape.getValidAssumption()"})
     protected void setAttrCached(DynamicObject attrs, Object value,
@@ -98,7 +97,7 @@ public abstract class SetFixedAttributeNode extends FixedAttributeAccessNode {
         }
     }
 
-    @Specialization(limit = "3", //
+    @Specialization(limit = "CACHE_LIMIT", //
                     guards = {"shapeCheck(oldShape, attrs)", "oldLocation == null", "canStore(newLocation, value)"}, //
                     assumptions = {"oldShape.getValidAssumption()", "newShape.getValidAssumption()"})
     protected static void setNewAttrCached(DynamicObject attrs, Object value,
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 bbf2c3212f..c912a44eec 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
@@ -345,7 +345,6 @@ public final class SpecialAttributesFunctions {
                 // for one dimensional array, "names" is really "dimnames[[1]]" (see R
                 // documentation for "names" function)
                 RList newDimNames = RDataFactory.createList(new Object[]{newNames});
-                newDimNames.elementNamePrefix = RRuntime.DIMNAMES_LIST_ELEMENT_NAME_PREFIX;
                 setDimNamesNode.setDimNames(xProfiled, newDimNames);
             } else {
                 assert newNames != xProfiled;
@@ -836,7 +835,6 @@ public final class SpecialAttributesFunctions {
                     resDimNames.updateDataAt(i, RNull.instance, null);
                 }
             }
-            resDimNames.elementNamePrefix = RRuntime.DIMNAMES_LIST_ELEMENT_NAME_PREFIX;
 
             if (x.getAttributes() == null) {
                 attrNullProfile.enter();
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/UnaryCopyAttributesNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/UnaryCopyAttributesNode.java
index 7d3c0b125a..87dd0112d0 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/UnaryCopyAttributesNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/UnaryCopyAttributesNode.java
@@ -32,7 +32,6 @@ import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetDimNa
 import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetNamesAttributeNode;
 import com.oracle.truffle.r.nodes.function.opt.ShareObjectNode;
 import com.oracle.truffle.r.nodes.function.opt.UpdateShareableChildValueNode;
-import com.oracle.truffle.r.runtime.RRuntime;
 import com.oracle.truffle.r.runtime.data.RDataFactory;
 import com.oracle.truffle.r.runtime.data.RList;
 import com.oracle.truffle.r.runtime.data.RStringVector;
@@ -128,7 +127,6 @@ public abstract class UnaryCopyAttributesNode extends RBaseNode {
         if (hasDimNames.profile(newDimNames != null)) {
             updateRefCountNode.execute(updateChildRefCountNode.updateState(source, newDimNames));
             putDimNames.execute(result.getAttributes(), newDimNames);
-            newDimNames.elementNamePrefix = RRuntime.DIMNAMES_LIST_ELEMENT_NAME_PREFIX;
             return result;
         }
         return result;
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/RBuiltinNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/RBuiltinNode.java
index 11315ae997..9d8c8f61bd 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/RBuiltinNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/RBuiltinNode.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
@@ -132,7 +132,7 @@ public abstract class RBuiltinNode extends RBuiltinBaseNode implements NodeWithA
         Class<?> clazz = argumentClasses[index];
         if (clazz == null) {
             CompilerDirectives.transferToInterpreterAndInvalidate();
-            argumentClasses[index] = clazz = value.getClass();
+            argumentClasses[index] = value.getClass();
             return value;
         } else if (clazz == Object.class) {
             return value;
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/casts/ExecutionPathVisitor.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/casts/ExecutionPathVisitor.java
index a5b1b9b4a4..ac6bebbd25 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/casts/ExecutionPathVisitor.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/casts/ExecutionPathVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -62,7 +62,7 @@ public abstract class ExecutionPathVisitor<T> implements PipelineStepVisitor<T>
 
     @Override
     public final T visit(MapIfStep<?, ?> step, T previous) {
-        boolean visitTrueBranch = bs == null ? false : bs.get(mapIfStepStatuses.get(step));
+        boolean visitTrueBranch;
         if (bs == null) {
             visitTrueBranch = false;
             mapIfStepStatuses.put(step, mapIfCounter++);
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/control/BlockNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/control/BlockNode.java
index 3feff83c7a..184b48c6d5 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/control/BlockNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/control/BlockNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -39,8 +39,6 @@ import com.oracle.truffle.r.runtime.nodes.RSyntaxNode;
  */
 public final class BlockNode extends OperatorNode {
 
-    public static final RNode[] EMPTY_BLOCK = new RNode[0];
-
     @Children protected final RNode[] sequence;
     @Child private SetVisibilityNode visibility;
 
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java
index 0e4dded0da..ce7183dbc7 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java
@@ -141,8 +141,6 @@ public final class FunctionDefinitionNode extends RRootNode implements RSyntaxNo
      */
     private final ConditionProfile returnTopLevelProfile = ConditionProfile.createBinaryProfile();
 
-    @CompilationFinal private IdentityHashMap<RNode, Closure> languageClosureCache;
-
     public static FunctionDefinitionNode create(TruffleRLanguage language, SourceSection src, FrameDescriptor frameDesc, SourceSection[] argSourceSections, SaveArgumentsNode saveArguments,
                     RSyntaxNode body,
                     FormalArguments formals, String name, PostProcessArgumentsNode argPostProcess) {
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionExpressionNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionExpressionNode.java
index 89977152e7..b42898c63e 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionExpressionNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionExpressionNode.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
@@ -54,7 +54,6 @@ public final class FunctionExpressionNode extends RSourceSectionNode implements
 
     @CompilationFinal private RootCallTarget callTarget;
     private final PromiseDeoptimizeFrameNode deoptFrameNode;
-    @CompilationFinal private FastPathFactory fastPath;
 
     @CompilationFinal private boolean initialized = false;
 
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/S3FunctionLookupNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/S3FunctionLookupNode.java
index 19d0954b1c..f759b97f10 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/S3FunctionLookupNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/S3FunctionLookupNode.java
@@ -4,7 +4,7 @@
  * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * Copyright (c) 2014, Purdue University
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -251,7 +251,7 @@ public abstract class S3FunctionLookupNode extends RBaseNode {
             cachedNode = new UseMethodFunctionLookupCachedNode(next.throwsError, next.nextMethod, genericName, type, group, null, unsuccessfulReadsCaller, unsuccessfulReadsTable,
                             reads.methodsTableRead, reads.successfulRead, reads.successfulReadTable, result.function, result.clazz, result.targetFunctionName, result.groupMatch, next);
         } else {
-            RFunction builtin = next.throwsError ? builtin = RContext.getInstance().lookupBuiltin(genericName) : null;
+            RFunction builtin = next.throwsError ? RContext.getInstance().lookupBuiltin(genericName) : null;
             cachedNode = new UseMethodFunctionLookupCachedNode(next.throwsError, next.nextMethod, genericName, type, group, builtin, unsuccessfulReadsCaller, unsuccessfulReadsTable,
                             reads.methodsTableRead, null, null, null, null, null, false, next);
         }
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/MapNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/MapNode.java
index e914f791c7..80b4220542 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/MapNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/MapNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, 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
@@ -37,10 +37,6 @@ public final class MapNode extends CastNode {
         return new MapNode(mapFn);
     }
 
-    public ArgumentMapper getMapper() {
-        return mapFn;
-    }
-
     @Override
     public Object execute(Object x) {
         return mapFn.map(x);
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ProcessOutputManager.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ProcessOutputManager.java
index 84a01016a8..f610e49481 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ProcessOutputManager.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ProcessOutputManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -34,7 +34,6 @@ public class ProcessOutputManager {
     public abstract static class OutputThread extends Thread {
         protected final InputStream is;
         protected int totalRead;
-        protected final Semaphore entry = new Semaphore(0);
         protected final Semaphore exit = new Semaphore(0);
 
         protected OutputThread(String name, InputStream is) {
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java
index 49ca414bb9..e8738cd70b 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java
@@ -1182,7 +1182,7 @@ public class RDeparse {
         }
         int i = 1;
         ch = safeCharAt(name, i);
-        while ((ch != '?' && Character.isAlphabetic(ch)) || Character.isDigit(ch) || ch == '.' | ch == '_') {
+        while ((ch != '?' && Character.isAlphabetic(ch)) || Character.isDigit(ch) || ch == '.' || ch == '_') {
             i++;
             ch = safeCharAt(name, i);
         }
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java
index 33167db999..ee28563e94 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1995-2012, The R Core Team
  * Copyright (c) 2003, The R Foundation
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -201,11 +201,6 @@ public class RSerialize {
     }
 
     public static final class ContextStateImpl implements RContext.ContextState {
-        /**
-         * {@code true} iff we are saving the source from the deparse of an unserialized function
-         * (for debugging later).
-         */
-        boolean saveDeparse;
 
         /**
          * {@code ...getNamespace} in "namespace.R", used to callback to handle a
@@ -306,7 +301,6 @@ public class RSerialize {
      */
     public static void setSaveDeparse(boolean status) {
         ContextStateImpl serializeContextState = getContextState();
-        serializeContextState.saveDeparse = status;
     }
 
     @TruffleBoundary
@@ -579,7 +573,6 @@ public class RSerialize {
                              */
                             if (FastROptions.debugMatches("printUclosure")) {
                                 RPairList pairList = RDataFactory.createPairList(carItem, cdrItem, tagItem, type);
-                                result = pairList;
                                 if (attrItem != RNull.instance) {
                                     setAttributes(pairList, attrItem);
                                 }
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java
index 397beb38be..393a3df3fd 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java
@@ -126,7 +126,6 @@ import com.oracle.truffle.r.runtime.rng.RRNG;
  */
 public final class RContext {
 
-    public static final int CONSOLE_WIDTH = 80;
     public static ChildContextInfo childInfo;
 
     public enum ContextKind {
@@ -169,8 +168,6 @@ public final class RContext {
          * Shares all environments on the search path.
          */
         SHARE_ALL;
-
-        public static final ContextKind[] VALUES = values();
     }
 
     /**
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/NativeDataAccess.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/NativeDataAccess.java
index a1e49b53ab..970c53a91d 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/NativeDataAccess.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/NativeDataAccess.java
@@ -98,10 +98,6 @@ public final class NativeDataAccess {
 
     private static final long EMPTY_DATA_ADDRESS = 0xBAD;
 
-    public static boolean isNativeMirror(Object o) {
-        return o instanceof NativeMirror;
-    }
-
     private static final class NativeMirror {
         /**
          * ID of the mirror, this will be used as the value for SEXP. When native up-calls to Java,
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RForeignNamedListWrapper.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RForeignNamedListWrapper.java
index 5c3be43263..c1c2575af0 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RForeignNamedListWrapper.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RForeignNamedListWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -89,7 +89,6 @@ public final class RForeignNamedListWrapper extends RForeignWrapper implements R
             super(value);
         }
 
-        @Child private Node getSize = Message.GET_SIZE.createNode();
         @Child private Node read = Message.READ.createNode();
         @Child private Foreign2R foreign2r = Foreign2R.create();
 
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RList.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RList.java
index c886692fd1..5a5db9a7e9 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RList.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RList.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
@@ -40,8 +40,6 @@ import com.oracle.truffle.r.runtime.data.nodes.VectorAccess;
  */
 public final class RList extends RListBase implements RAbstractListVector {
 
-    public String elementNamePrefix;
-
     RList(Object[] data) {
         super(data);
     }
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RVector.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RVector.java
index 83105b460c..8642de18d0 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RVector.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RVector.java
@@ -262,7 +262,6 @@ public abstract class RVector<ArrayT> extends RSharingAttributeStorage implement
                 // for one dimensional array, "names" is really "dimnames[[1]]" (see R documentation
                 // for "names" function)
                 RList newDimNames = RDataFactory.createList(new Object[]{newNames});
-                newDimNames.elementNamePrefix = RRuntime.DIMNAMES_LIST_ELEMENT_NAME_PREFIX;
                 putAttribute(RRuntime.DIMNAMES_ATTR_KEY, newDimNames);
             } else {
                 putAttribute(RRuntime.NAMES_ATTR_KEY, newNames);
@@ -342,7 +341,6 @@ public abstract class RVector<ArrayT> extends RSharingAttributeStorage implement
                 }
             }
             putAttribute(RRuntime.DIMNAMES_ATTR_KEY, resDimNames);
-            resDimNames.elementNamePrefix = RRuntime.DIMNAMES_LIST_ELEMENT_NAME_PREFIX;
         }
     }
 
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/NativeFunction.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/NativeFunction.java
index 091ab6b513..93011004c3 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/NativeFunction.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/NativeFunction.java
@@ -87,8 +87,6 @@ public enum NativeFunction {
     rembedded_write_console("(string, sint32):void", "", baseLibrary(), true),
     rembedded_write_err_console("(string, sint32):void", "", baseLibrary(), true),
     rembedded_read_console("(string):string", "", baseLibrary(), true),
-    rembedded_native_clean_up("(sint32, sint32, sint32):void", "", baseLibrary(), true),
-    rembedded_native_suicide("(string):void", "", baseLibrary(), true),
     // user-defined RNG
     unif_init("(sint32): void", "user_", anyLibrary()),
     norm_rand("(): pointer", "user_", anyLibrary()),
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/REmbedRFFI.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/REmbedRFFI.java
index 52a059a155..c5c250fa38 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/REmbedRFFI.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/REmbedRFFI.java
@@ -110,10 +110,6 @@ public final class REmbedRFFI {
         public void execute(String message) {
             call(message);
         }
-
-        public static EmbeddedSuicideNode create() {
-            return RFFIFactory.getREmbedRFFI().createEmbeddedSuicideNode();
-        }
     }
 
     public static final class EmbeddedCleanUpNode extends NativeCallNode {
@@ -124,10 +120,6 @@ public final class REmbedRFFI {
         public void execute(int x, int y, int z) {
             call(x, y, z);
         }
-
-        public static EmbeddedCleanUpNode create() {
-            return RFFIFactory.getREmbedRFFI().createEmbeddedCleanUpNode();
-        }
     }
 
     ReadConsoleNode createReadConsoleNode() {
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/Mach.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/Mach.java
index 2fdee595bc..90b879ca34 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/Mach.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/Mach.java
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 1998 Ross Ihaka
  * Copyright (c) 2000--2014, The R Core Team
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -18,7 +18,7 @@ import com.oracle.truffle.r.runtime.RInternalError;
 import com.oracle.truffle.r.runtime.RRuntime;
 
 public final class Mach {
-    public Mach() {
+    private Mach() {
         // only static members
     }
 
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/RMultinom.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/RMultinom.java
deleted file mode 100644
index 822b14b94a..0000000000
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/RMultinom.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * This material is distributed under the GNU General Public License
- * Version 2. You may review the terms of this license at
- * http://www.gnu.org/licenses/gpl-2.0.html
- *
- * Copyright (c) 1995, 1996  Robert Gentleman and Ross Ihaka
- * Copyright (c) 1997-2012, The R Core Team
- * Copyright (c) 2003-2008, The R Foundation
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates
- *
- * All rights reserved.
- */
-package com.oracle.truffle.r.runtime.nmath.distr;
-
-import static com.oracle.truffle.r.runtime.RError.SHOW_CALLER;
-
-import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
-import com.oracle.truffle.r.runtime.RError;
-import com.oracle.truffle.r.runtime.RError.Message;
-import com.oracle.truffle.r.runtime.RRuntime;
-import com.oracle.truffle.r.runtime.data.nodes.VectorAccess;
-import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.SequentialIterator;
-import com.oracle.truffle.r.runtime.nmath.RandomFunctions.RandomNumberProvider;
-
-public final class RMultinom {
-    private RMultinom() {
-        // only static method rmultinom
-    }
-
-    /**
-     * Returns true if no element of the vector rN got assigned value NA, i.e. is stayed complete if
-     * it was before. GnuR doc: `Return' vector rN[1:K] {K := length(prob)} where rN[j] ~ Bin(n,
-     * prob[j]) , sum_j rN[j] == n, sum_j prob[j] == 1.
-     */
-    @TruffleBoundary
-    public static boolean rmultinom(int nIn, SequentialIterator probsIter, VectorAccess probsAccess, double sum, int[] rN, int rnStartIdx, RandomNumberProvider rand, Rbinom rbinom) {
-        /*
-         * This calculation is sensitive to exact values, so we try to ensure that the calculations
-         * are as accurate as possible so different platforms are more likely to give the same
-         * result.
-         */
-
-        int n = nIn;
-        int maxK = probsAccess.getLength(probsIter);
-        if (RRuntime.isNA(maxK) || maxK < 1 || RRuntime.isNA(n) || n < 0) {
-            if (rN.length > rnStartIdx) {
-                rN[rnStartIdx] = RRuntime.INT_NA;
-            }
-            return false;
-        }
-
-        /*
-         * Note: prob[K] is only used here for checking sum_k prob[k] = 1 ; Could make loop one
-         * shorter and drop that check !
-         */
-        /* LDOUBLE */double pTot = 0.;
-        probsAccess.reset(probsIter);
-        for (int k = 0; probsAccess.next(probsIter); k++) {
-            double pp = probsAccess.getDouble(probsIter) / sum;
-            if (!Double.isFinite(pp) || pp < 0. || pp > 1.) {
-                rN[rnStartIdx + k] = RRuntime.INT_NA;
-                return false;
-            }
-            pTot += pp;
-            rN[rnStartIdx + k] = 0;
-        }
-
-        /* LDOUBLE */double probSum = Math.abs(pTot - 1);
-        if (probSum > 1e-7) {
-            throw RError.error(SHOW_CALLER, Message.GENERIC, String.format("rbinom: probability sum should be 1, but is %g", pTot));
-        }
-        if (n == 0) {
-            return true;
-        }
-        if (maxK == 1 && pTot == 0.) {
-            return true; /* trivial border case: do as rbinom */
-        }
-
-        /* Generate the first K-1 obs. via binomials */
-        probsAccess.reset(probsIter);
-        for (int k = 0; probsAccess.next(probsIter) && k < maxK - 1; k++) {
-            /* (p_tot, n) are for "remaining binomial" */
-            /* LDOUBLE */double probK = probsAccess.getDouble(probsIter) / sum;
-            if (probK != 0.) {
-                double pp = probK / pTot;
-                // System.out.printf("[%d] %.17f\n", k + 1, pp);
-                rN[rnStartIdx + k] = ((pp < 1.) ? (int) rbinom.execute(n, pp, rand) :
-                /* >= 1; > 1 happens because of rounding */
-                                n);
-                n -= rN[rnStartIdx + k];
-            } else {
-                rN[rnStartIdx + k] = 0;
-            }
-            if (n <= 0) {
-                /* we have all */
-                return true;
-            }
-            /* i.e. = sum(prob[(k+1):K]) */
-            pTot -= probK;
-        }
-
-        rN[rnStartIdx + maxK - 1] = n;
-        return true;
-    }
-}
diff --git a/mx.fastr/copyrights/overrides b/mx.fastr/copyrights/overrides
index a0e848c665..cbafb063d5 100644
--- a/mx.fastr/copyrights/overrides
+++ b/mx.fastr/copyrights/overrides
@@ -260,7 +260,6 @@ com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/Rbinom
 com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/Rf.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/RGamma.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/RHyper.java,gnu_r_ihaka.copyright
-com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/RMultinom.java,gnu_r_gentleman_ihaka.copyright
 com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/RNBinom.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/RNchisq.java,gnu_r.copyright
 com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/Rnorm.java,gnu_r.copyright
-- 
GitLab