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 24 25 package org.graalvm.compiler.nodes.extended; 26 27 import org.graalvm.compiler.graph.NodeClass; 28 import org.graalvm.compiler.nodeinfo.NodeInfo; 29 import org.graalvm.compiler.nodes.StateSplit; 30 import org.graalvm.compiler.nodes.ValueNode; 31 import org.graalvm.compiler.nodes.memory.AbstractWriteNode; 32 import org.graalvm.compiler.nodes.memory.MemoryAccess; 33 import org.graalvm.compiler.nodes.memory.MemoryCheckpoint; 34 import org.graalvm.compiler.nodes.memory.address.AddressNode; 35 import org.graalvm.compiler.nodes.spi.Lowerable; 36 import org.graalvm.compiler.nodes.spi.LoweringTool; 37 import jdk.internal.vm.compiler.word.LocationIdentity; 38 39 import jdk.vm.ci.meta.JavaKind; 40 41 /** 42 * Write a raw memory location according to Java field or array write semantics. It will perform 43 * write barriers, implicit conversions and optionally oop compression. 44 */ 45 @NodeInfo(nameTemplate = "JavaWrite#{p#location/s}") 46 public final class JavaWriteNode extends AbstractWriteNode implements Lowerable, StateSplit, MemoryAccess, MemoryCheckpoint.Single { 54 this.writeKind = writeKind; 55 this.compressible = compressible; 56 } 57 58 @Override 59 public void lower(LoweringTool tool) { 60 tool.getLowerer().lower(this, tool); 61 } 62 63 @Override 64 public boolean canNullCheck() { 65 return true; 66 } 67 68 public JavaKind getWriteKind() { 69 return writeKind; 70 } 71 72 public boolean isCompressible() { 73 return compressible; 74 } 75 } | 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 24 25 package org.graalvm.compiler.nodes.extended; 26 27 import org.graalvm.compiler.core.common.type.Stamp; 28 import org.graalvm.compiler.core.common.type.StampFactory; 29 import org.graalvm.compiler.graph.NodeClass; 30 import org.graalvm.compiler.nodeinfo.NodeInfo; 31 import org.graalvm.compiler.nodes.StateSplit; 32 import org.graalvm.compiler.nodes.ValueNode; 33 import org.graalvm.compiler.nodes.memory.AbstractWriteNode; 34 import org.graalvm.compiler.nodes.memory.MemoryAccess; 35 import org.graalvm.compiler.nodes.memory.MemoryCheckpoint; 36 import org.graalvm.compiler.nodes.memory.address.AddressNode; 37 import org.graalvm.compiler.nodes.spi.Lowerable; 38 import org.graalvm.compiler.nodes.spi.LoweringTool; 39 import jdk.internal.vm.compiler.word.LocationIdentity; 40 41 import jdk.vm.ci.meta.JavaKind; 42 43 /** 44 * Write a raw memory location according to Java field or array write semantics. It will perform 45 * write barriers, implicit conversions and optionally oop compression. 46 */ 47 @NodeInfo(nameTemplate = "JavaWrite#{p#location/s}") 48 public final class JavaWriteNode extends AbstractWriteNode implements Lowerable, StateSplit, MemoryAccess, MemoryCheckpoint.Single { 56 this.writeKind = writeKind; 57 this.compressible = compressible; 58 } 59 60 @Override 61 public void lower(LoweringTool tool) { 62 tool.getLowerer().lower(this, tool); 63 } 64 65 @Override 66 public boolean canNullCheck() { 67 return true; 68 } 69 70 public JavaKind getWriteKind() { 71 return writeKind; 72 } 73 74 public boolean isCompressible() { 75 return compressible; 76 } 77 78 @Override 79 public Stamp getAccessStamp() { 80 return StampFactory.forKind(writeKind); 81 } 82 } |