< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java

Print this page




   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.replacements.nodes;
  24 
  25 import static org.graalvm.compiler.nodeinfo.InputType.Memory;
  26 import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1024;
  27 import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_1024;
  28 
  29 import org.graalvm.compiler.core.common.type.StampFactory;
  30 import org.graalvm.compiler.graph.Node;
  31 import org.graalvm.compiler.graph.NodeClass;
  32 import org.graalvm.compiler.graph.spi.Canonicalizable;
  33 import org.graalvm.compiler.graph.spi.CanonicalizerTool;

  34 import org.graalvm.compiler.nodeinfo.NodeInfo;

  35 import org.graalvm.compiler.nodes.ConstantNode;
  36 import org.graalvm.compiler.nodes.FixedWithNextNode;
  37 import org.graalvm.compiler.nodes.NamedLocationIdentity;
  38 import org.graalvm.compiler.nodes.ValueNode;
  39 import org.graalvm.compiler.nodes.ValueNodeUtil;
  40 import org.graalvm.compiler.nodes.memory.MemoryAccess;
  41 import org.graalvm.compiler.nodes.memory.MemoryNode;
  42 import org.graalvm.compiler.nodes.spi.LIRLowerable;
  43 import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
  44 import org.graalvm.compiler.nodes.spi.Virtualizable;
  45 import org.graalvm.compiler.nodes.spi.VirtualizerTool;
  46 import org.graalvm.compiler.nodes.util.GraphUtil;
  47 import org.graalvm.compiler.nodes.virtual.VirtualObjectNode;
  48 import org.graalvm.word.LocationIdentity;
  49 
  50 import jdk.vm.ci.meta.ConstantReflectionProvider;
  51 import jdk.vm.ci.meta.JavaConstant;
  52 import jdk.vm.ci.meta.JavaKind;
  53 import jdk.vm.ci.meta.Value;
  54 
  55 // JaCoCo Exclude
  56 
  57 /**
  58  * Compares two arrays with the same length.
  59  */
  60 @NodeInfo(cycles = CYCLES_1024, size = SIZE_1024)
  61 public final class ArrayEqualsNode extends FixedWithNextNode implements LIRLowerable, Canonicalizable, Virtualizable, MemoryAccess {
  62 
  63     public static final NodeClass<ArrayEqualsNode> TYPE = NodeClass.create(ArrayEqualsNode.class);
  64     /** {@link JavaKind} of the arrays to compare. */
  65     protected final JavaKind kind;
  66 
  67     /** One array to be tested for equality. */
  68     @Input ValueNode array1;
  69 
  70     /** The other array to be tested for equality. */
  71     @Input ValueNode array2;
  72 
  73     /** Length of both arrays. */
  74     @Input ValueNode length;
  75 
  76     @OptionalInput(Memory) MemoryNode lastLocationAccess;
  77 
  78     public ArrayEqualsNode(ValueNode array1, ValueNode array2, ValueNode length, @ConstantNodeParameter JavaKind kind) {
  79         super(TYPE, StampFactory.forKind(JavaKind.Boolean));
  80         this.kind = kind;




   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.replacements.nodes;
  24 
  25 import static org.graalvm.compiler.nodeinfo.InputType.Memory;


  26 
  27 import org.graalvm.compiler.core.common.type.StampFactory;
  28 import org.graalvm.compiler.graph.Node;
  29 import org.graalvm.compiler.graph.NodeClass;
  30 import org.graalvm.compiler.graph.spi.Canonicalizable;
  31 import org.graalvm.compiler.graph.spi.CanonicalizerTool;
  32 import org.graalvm.compiler.nodeinfo.NodeCycles;
  33 import org.graalvm.compiler.nodeinfo.NodeInfo;
  34 import org.graalvm.compiler.nodeinfo.NodeSize;
  35 import org.graalvm.compiler.nodes.ConstantNode;
  36 import org.graalvm.compiler.nodes.FixedWithNextNode;
  37 import org.graalvm.compiler.nodes.NamedLocationIdentity;
  38 import org.graalvm.compiler.nodes.ValueNode;
  39 import org.graalvm.compiler.nodes.ValueNodeUtil;
  40 import org.graalvm.compiler.nodes.memory.MemoryAccess;
  41 import org.graalvm.compiler.nodes.memory.MemoryNode;
  42 import org.graalvm.compiler.nodes.spi.LIRLowerable;
  43 import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
  44 import org.graalvm.compiler.nodes.spi.Virtualizable;
  45 import org.graalvm.compiler.nodes.spi.VirtualizerTool;
  46 import org.graalvm.compiler.nodes.util.GraphUtil;
  47 import org.graalvm.compiler.nodes.virtual.VirtualObjectNode;
  48 import org.graalvm.word.LocationIdentity;
  49 
  50 import jdk.vm.ci.meta.ConstantReflectionProvider;
  51 import jdk.vm.ci.meta.JavaConstant;
  52 import jdk.vm.ci.meta.JavaKind;
  53 import jdk.vm.ci.meta.Value;
  54 
  55 // JaCoCo Exclude
  56 
  57 /**
  58  * Compares two arrays with the same length.
  59  */
  60 @NodeInfo(cycles = NodeCycles.CYCLES_UNKNOWN, size = NodeSize.SIZE_128)
  61 public final class ArrayEqualsNode extends FixedWithNextNode implements LIRLowerable, Canonicalizable, Virtualizable, MemoryAccess {
  62 
  63     public static final NodeClass<ArrayEqualsNode> TYPE = NodeClass.create(ArrayEqualsNode.class);
  64     /** {@link JavaKind} of the arrays to compare. */
  65     protected final JavaKind kind;
  66 
  67     /** One array to be tested for equality. */
  68     @Input ValueNode array1;
  69 
  70     /** The other array to be tested for equality. */
  71     @Input ValueNode array2;
  72 
  73     /** Length of both arrays. */
  74     @Input ValueNode length;
  75 
  76     @OptionalInput(Memory) MemoryNode lastLocationAccess;
  77 
  78     public ArrayEqualsNode(ValueNode array1, ValueNode array2, ValueNode length, @ConstantNodeParameter JavaKind kind) {
  79         super(TYPE, StampFactory.forKind(JavaKind.Boolean));
  80         this.kind = kind;


< prev index next >