< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java

Print this page




  21  * questions.
  22  */
  23 package org.graalvm.compiler.graph;
  24 
  25 import static org.graalvm.compiler.graph.Edges.Type.Inputs;
  26 import static org.graalvm.compiler.graph.Edges.Type.Successors;
  27 import static org.graalvm.compiler.graph.Graph.isModificationCountsEnabled;
  28 import static org.graalvm.compiler.graph.UnsafeAccess.UNSAFE;
  29 
  30 import java.lang.annotation.ElementType;
  31 import java.lang.annotation.RetentionPolicy;
  32 import java.util.Collections;
  33 import java.util.EnumSet;
  34 import java.util.Formattable;
  35 import java.util.FormattableFlags;
  36 import java.util.Formatter;
  37 import java.util.HashMap;
  38 import java.util.Map;
  39 import java.util.Objects;
  40 import java.util.function.Predicate;

  41 
  42 import org.graalvm.compiler.core.common.Fields;
  43 import org.graalvm.compiler.core.common.type.AbstractPointerStamp;
  44 import org.graalvm.compiler.core.common.type.Stamp;
  45 import org.graalvm.compiler.debug.DebugCloseable;
  46 import org.graalvm.compiler.debug.DebugContext;
  47 import org.graalvm.compiler.graph.Graph.NodeEventListener;
  48 import org.graalvm.compiler.graph.Graph.Options;
  49 import org.graalvm.compiler.graph.iterators.NodeIterable;
  50 import org.graalvm.compiler.graph.iterators.NodePredicate;
  51 import org.graalvm.compiler.graph.spi.Simplifiable;
  52 import org.graalvm.compiler.graph.spi.SimplifierTool;
  53 import org.graalvm.compiler.nodeinfo.InputType;
  54 import org.graalvm.compiler.nodeinfo.NodeCycles;
  55 import org.graalvm.compiler.nodeinfo.NodeInfo;
  56 import org.graalvm.compiler.nodeinfo.NodeSize;
  57 import org.graalvm.compiler.nodeinfo.Verbosity;
  58 import org.graalvm.compiler.options.OptionValues;
  59 
  60 import sun.misc.Unsafe;


 578     /**
 579      * The position of the bytecode that generated this node.
 580      */
 581     NodeSourcePosition sourcePosition;
 582 
 583     /**
 584      * Gets the source position information for this node or null if it doesn't exist.
 585      */
 586 
 587     public NodeSourcePosition getNodeSourcePosition() {
 588         return sourcePosition;
 589     }
 590 
 591     /**
 592      * Set the source position to {@code sourcePosition}.
 593      */
 594     public void setNodeSourcePosition(NodeSourcePosition sourcePosition) {
 595         this.sourcePosition = sourcePosition;
 596         if (sourcePosition != null && graph != null && !graph.seenNodeSourcePosition) {
 597             graph.seenNodeSourcePosition = true;









 598         }
 599     }
 600 
 601     public DebugCloseable withNodeSourcePosition() {
 602         return graph.withNodeSourcePosition(this);
 603     }
 604 
 605     public final NodeClass<? extends Node> getNodeClass() {
 606         return nodeClass;
 607     }
 608 
 609     public boolean isAllowedUsageType(InputType type) {
 610         if (type == InputType.Value) {
 611             return false;
 612         }
 613         return getNodeClass().getAllowedUsageTypes().contains(type);
 614     }
 615 
 616     private boolean checkReplaceWith(Node other) {
 617         if (graph != null && graph.isFrozen()) {




  21  * questions.
  22  */
  23 package org.graalvm.compiler.graph;
  24 
  25 import static org.graalvm.compiler.graph.Edges.Type.Inputs;
  26 import static org.graalvm.compiler.graph.Edges.Type.Successors;
  27 import static org.graalvm.compiler.graph.Graph.isModificationCountsEnabled;
  28 import static org.graalvm.compiler.graph.UnsafeAccess.UNSAFE;
  29 
  30 import java.lang.annotation.ElementType;
  31 import java.lang.annotation.RetentionPolicy;
  32 import java.util.Collections;
  33 import java.util.EnumSet;
  34 import java.util.Formattable;
  35 import java.util.FormattableFlags;
  36 import java.util.Formatter;
  37 import java.util.HashMap;
  38 import java.util.Map;
  39 import java.util.Objects;
  40 import java.util.function.Predicate;
  41 import java.util.function.Supplier;
  42 
  43 import org.graalvm.compiler.core.common.Fields;
  44 import org.graalvm.compiler.core.common.type.AbstractPointerStamp;
  45 import org.graalvm.compiler.core.common.type.Stamp;
  46 import org.graalvm.compiler.debug.DebugCloseable;
  47 import org.graalvm.compiler.debug.DebugContext;
  48 import org.graalvm.compiler.graph.Graph.NodeEventListener;
  49 import org.graalvm.compiler.graph.Graph.Options;
  50 import org.graalvm.compiler.graph.iterators.NodeIterable;
  51 import org.graalvm.compiler.graph.iterators.NodePredicate;
  52 import org.graalvm.compiler.graph.spi.Simplifiable;
  53 import org.graalvm.compiler.graph.spi.SimplifierTool;
  54 import org.graalvm.compiler.nodeinfo.InputType;
  55 import org.graalvm.compiler.nodeinfo.NodeCycles;
  56 import org.graalvm.compiler.nodeinfo.NodeInfo;
  57 import org.graalvm.compiler.nodeinfo.NodeSize;
  58 import org.graalvm.compiler.nodeinfo.Verbosity;
  59 import org.graalvm.compiler.options.OptionValues;
  60 
  61 import sun.misc.Unsafe;


 579     /**
 580      * The position of the bytecode that generated this node.
 581      */
 582     NodeSourcePosition sourcePosition;
 583 
 584     /**
 585      * Gets the source position information for this node or null if it doesn't exist.
 586      */
 587 
 588     public NodeSourcePosition getNodeSourcePosition() {
 589         return sourcePosition;
 590     }
 591 
 592     /**
 593      * Set the source position to {@code sourcePosition}.
 594      */
 595     public void setNodeSourcePosition(NodeSourcePosition sourcePosition) {
 596         this.sourcePosition = sourcePosition;
 597         if (sourcePosition != null && graph != null && !graph.seenNodeSourcePosition) {
 598             graph.seenNodeSourcePosition = true;
 599         }
 600     }
 601 
 602     /**
 603      * Update the source position only if it is null.
 604      */
 605     public void updateNodeSourcePosition(Supplier<NodeSourcePosition> sourcePositionSupp) {
 606         if (this.sourcePosition == null) {
 607             setNodeSourcePosition(sourcePositionSupp.get());
 608         }
 609     }
 610 
 611     public DebugCloseable withNodeSourcePosition() {
 612         return graph.withNodeSourcePosition(this);
 613     }
 614 
 615     public final NodeClass<? extends Node> getNodeClass() {
 616         return nodeClass;
 617     }
 618 
 619     public boolean isAllowedUsageType(InputType type) {
 620         if (type == InputType.Value) {
 621             return false;
 622         }
 623         return getNodeClass().getAllowedUsageTypes().contains(type);
 624     }
 625 
 626     private boolean checkReplaceWith(Node other) {
 627         if (graph != null && graph.isFrozen()) {


< prev index next >