From d58971d49d969409a7b2b79a08e274b64588c29f Mon Sep 17 00:00:00 2001
From: Lukas Stadler <lukas.stadler@oracle.com>
Date: Mon, 9 Jan 2017 18:26:26 +0100
Subject: [PATCH] pass shape to Location.get

---
 .../r/nodes/attributes/FixedAttributeAccessNode.java   |  3 +--
 .../truffle/r/nodes/attributes/GetAttributeNode.java   | 10 ++++------
 .../r/nodes/attributes/GetFixedAttributeNode.java      |  6 ++----
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/FixedAttributeAccessNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/FixedAttributeAccessNode.java
index 325b738216..9a4a27636e 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/FixedAttributeAccessNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/FixedAttributeAccessNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -35,5 +35,4 @@ public abstract class FixedAttributeAccessNode extends AttributeAccessNode {
         assert name.intern() == name;
         this.name = name;
     }
-
 }
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/GetAttributeNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/GetAttributeNode.java
index 858530667f..00cbacb9d1 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/GetAttributeNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/GetAttributeNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -57,12 +57,11 @@ public abstract class GetAttributeNode extends AttributeAccessNode {
     @Specialization(limit = "3", //
                     guards = {"cachedName.equals(name)", "shapeCheck(shape, attrs)"}, //
                     assumptions = {"shape.getValidAssumption()"})
-    @SuppressWarnings("unused")
-    protected Object getAttrCached(DynamicObject attrs, String name,
-                    @Cached("name") String cachedName,
+    protected Object getAttrCached(DynamicObject attrs, @SuppressWarnings("unused") String name,
+                    @SuppressWarnings("unused") @Cached("name") String cachedName,
                     @Cached("lookupShape(attrs)") Shape shape,
                     @Cached("lookupLocation(shape, name)") Location location) {
-        return location == null ? null : location.get(attrs);
+        return location == null ? null : location.get(attrs, shape);
     }
 
     @TruffleBoundary
@@ -96,5 +95,4 @@ public abstract class GetAttributeNode extends AttributeAccessNode {
 
         return recursive.execute(attributes, name);
     }
-
 }
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 5b1b1963fa..e003117e42 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, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -81,11 +81,10 @@ public abstract class GetFixedAttributeNode extends FixedAttributeAccessNode {
     @Specialization(limit = "3", //
                     guards = {"shapeCheck(shape, attrs)"}, //
                     assumptions = {"shape.getValidAssumption()"})
-    @SuppressWarnings("unused")
     protected Object getAttrCached(DynamicObject attrs,
                     @Cached("lookupShape(attrs)") Shape shape,
                     @Cached("lookupLocation(shape, name)") Location location) {
-        return location == null ? null : location.get(attrs);
+        return location == null ? null : location.get(attrs, shape);
     }
 
     @Specialization(contains = "getAttrCached")
@@ -119,5 +118,4 @@ public abstract class GetFixedAttributeNode extends FixedAttributeAccessNode {
 
         return recursive.execute(attributes);
     }
-
 }
-- 
GitLab