From 0005a82dab0789ab732400f59522c73f5d0722e1 Mon Sep 17 00:00:00 2001
From: Florian Angerer <florian.angerer@oracle.com>
Date: Wed, 13 Dec 2017 14:03:45 +0100
Subject: [PATCH] Revert "Using 'asAbstractVector' instead of
 'BoxPrimitiveNode'."

This reverts commit 85cb339f88293640bd9bf7d2d7cd93969de8d916.
---
 .../nodes/access/vector/CachedExtractVectorNode.java  | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java
index 157f94597a..5101c995fa 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java
@@ -39,6 +39,7 @@ import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetDimNa
 import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetNamesAttributeNode;
 import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.SetDimAttributeNode;
 import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.SetDimNamesAttributeNode;
+import com.oracle.truffle.r.nodes.binary.BoxPrimitiveNode;
 import com.oracle.truffle.r.nodes.profile.AlwaysOnBranchProfile;
 import com.oracle.truffle.r.nodes.profile.VectorLengthProfile;
 import com.oracle.truffle.r.runtime.RRuntime;
@@ -80,6 +81,8 @@ final class CachedExtractVectorNode extends CachedVectorNode {
     @Child private GetDimNamesAttributeNode getDimNamesNode;
     @Child private GetNamesAttributeNode getNamesNode;
     @Child private GetNamesAttributeNode getNamesFromDimNamesNode;
+    @Child private BoxPrimitiveNode boxOldDimNames;
+    @Child private BoxPrimitiveNode boxNewDimName;
     @Children private final CachedExtractVectorNode[] extractNames;
     @Children private final CachedExtractVectorNode[] extractNamesAlternative;
 
@@ -280,7 +283,13 @@ final class CachedExtractVectorNode extends CachedVectorNode {
                     } else if (positionsCheckNode.isEmptyPosition(i, positions[i])) {
                         result = RNull.instance;
                     } else {
-                        result = RRuntime.asAbstractVector(extract(i, (RAbstractStringVector) RRuntime.asAbstractVector(dataAt), positions[i], positionProfile[i]));
+                        if (boxOldDimNames == null) {
+                            boxOldDimNames = insert(BoxPrimitiveNode.create());
+                        }
+                        if (boxNewDimName == null) {
+                            boxNewDimName = insert(BoxPrimitiveNode.create());
+                        }
+                        result = boxNewDimName.execute(extract(i, (RAbstractStringVector) boxOldDimNames.execute(dataAt), positions[i], positionProfile[i]));
                     }
                     newDimNames[dimIndex] = result;
                     if (newDimNamesNames != null) {
-- 
GitLab