From d9ec63fd6804d6fb26c0a200579644118cf565be Mon Sep 17 00:00:00 2001
From: Zbynek Slajchrt <zbynek.slajchrt@oracle.com>
Date: Thu, 1 Dec 2016 15:17:34 +0100
Subject: [PATCH] Unnecessary profiles removed

---
 .../oracle/truffle/r/nodes/attributes/GetAttributeNode.java  | 5 ++---
 .../truffle/r/nodes/attributes/GetFixedAttributeNode.java    | 5 ++---
 .../truffle/r/nodes/attributes/RemoveFixedAttributeNode.java | 4 +---
 3 files changed, 5 insertions(+), 9 deletions(-)

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 9055f8c476..0a28d002af 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
@@ -48,9 +48,8 @@ public abstract class GetAttributeNode extends AttributeAccessNode {
     protected Object getAttrCached(DynamicObject attrs, String name,
                     @Cached("name") String cachedName,
                     @Cached("lookupShape(attrs)") Shape shape,
-                    @Cached("lookupLocation(shape, name)") Location location,
-                    @Cached("createBinaryProfile()") ConditionProfile nullProfile) {
-        return nullProfile.profile(location == null) ? null : location.get(attrs);
+                    @Cached("lookupLocation(shape, name)") Location location) {
+        return location == null ? null : location.get(attrs);
     }
 
     @TruffleBoundary
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 0c6a29dc62..35b79c0d78 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
@@ -65,9 +65,8 @@ public abstract class GetFixedAttributeNode extends FixedAttributeAccessNode {
     @SuppressWarnings("unused")
     protected Object getAttrCached(DynamicObject attrs,
                     @Cached("lookupShape(attrs)") Shape shape,
-                    @Cached("lookupLocation(shape, name)") Location location,
-                    @Cached("createBinaryProfile()") ConditionProfile nullProfile) {
-        return nullProfile.profile(location == null) ? null : location.get(attrs);
+                    @Cached("lookupLocation(shape, name)") Location location) {
+        return location == null ? null : location.get(attrs);
     }
 
     @Specialization(contains = "getAttrCached")
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 9c8b21ee3c..5d41dae1db 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
@@ -64,10 +64,8 @@ public abstract class RemoveFixedAttributeNode extends FixedAttributeAccessNode
                     assumptions = {"shape.getValidAssumption()"})
     protected void removeAttrCached(DynamicObject attrs,
                     @Cached("lookupShape(attrs)") Shape shape,
-                    @Cached("lookupProperty(shape, name)") Property property,
-                    @Cached("create()") BranchProfile notNullProfile) {
+                    @Cached("lookupProperty(shape, name)") Property property) {
         if (property != null) {
-            notNullProfile.enter();
             Shape newShape = attrs.getShape().removeProperty(property);
             attrs.setShapeAndResize(shape, newShape);
         }
-- 
GitLab