1 /* 2 * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 package org.graalvm.compiler.nodes.memory; 24 25 import org.graalvm.compiler.core.common.LocationIdentity; 26 import org.graalvm.compiler.core.common.type.Stamp; 27 import org.graalvm.compiler.graph.NodeClass; 28 import org.graalvm.compiler.nodeinfo.InputType; 29 import org.graalvm.compiler.nodeinfo.NodeInfo; 30 import org.graalvm.compiler.nodes.FloatingGuardedNode; 31 import org.graalvm.compiler.nodes.extended.GuardingNode; 32 import org.graalvm.compiler.nodes.memory.address.AddressNode; 33 34 @NodeInfo 35 public abstract class FloatingAccessNode extends FloatingGuardedNode implements Access, MemoryAccess { 36 public static final NodeClass<FloatingAccessNode> TYPE = NodeClass.create(FloatingAccessNode.class); 37 38 @Input(InputType.Association) AddressNode address; 39 protected final LocationIdentity location; 40 41 protected BarrierType barrierType; 42 43 protected FloatingAccessNode(NodeClass<? extends FloatingAccessNode> c, AddressNode address, LocationIdentity location, Stamp stamp) { 44 super(c, stamp); 45 this.address = address; 46 this.location = location; 47 } 48 49 protected FloatingAccessNode(NodeClass<? extends FloatingAccessNode> c, AddressNode address, LocationIdentity location, Stamp stamp, GuardingNode guard, BarrierType barrierType) { 50 super(c, stamp, guard); 51 this.address = address; 52 this.location = location; 53 this.barrierType = barrierType; 54 } 55 56 @Override 57 public AddressNode getAddress() { 58 return address; 59 } 60 61 @Override 62 public LocationIdentity getLocationIdentity() { 63 return location; 64 } 65 66 @Override 67 public BarrierType getBarrierType() { 68 return barrierType; 69 } 70 71 @Override 72 public boolean canNullCheck() { 73 return true; 74 } 75 76 public abstract FixedAccessNode asFixedNode(); 77 }