src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
30 import org.graalvm.compiler.core.common.type.Stamp; |
30 import org.graalvm.compiler.core.common.type.Stamp; |
31 import org.graalvm.compiler.core.common.type.StampFactory; |
31 import org.graalvm.compiler.core.common.type.StampFactory; |
32 import org.graalvm.compiler.graph.IterableNodeType; |
32 import org.graalvm.compiler.graph.IterableNodeType; |
33 import org.graalvm.compiler.graph.Node; |
33 import org.graalvm.compiler.graph.Node; |
34 import org.graalvm.compiler.graph.NodeClass; |
34 import org.graalvm.compiler.graph.NodeClass; |
|
35 import org.graalvm.compiler.graph.Position; |
35 import org.graalvm.compiler.graph.iterators.NodeIterable; |
36 import org.graalvm.compiler.graph.iterators.NodeIterable; |
36 import org.graalvm.compiler.nodeinfo.InputType; |
37 import org.graalvm.compiler.nodeinfo.InputType; |
37 import org.graalvm.compiler.nodeinfo.NodeInfo; |
38 import org.graalvm.compiler.nodeinfo.NodeInfo; |
38 import org.graalvm.compiler.nodes.extended.AnchoringNode; |
39 import org.graalvm.compiler.nodes.extended.AnchoringNode; |
39 import org.graalvm.compiler.nodes.extended.GuardingNode; |
40 import org.graalvm.compiler.nodes.extended.GuardingNode; |
95 if (withSpeculationFence) { |
96 if (withSpeculationFence) { |
96 gen.getLIRGeneratorTool().emitSpeculationFence(); |
97 gen.getLIRGeneratorTool().emitSpeculationFence(); |
97 } |
98 } |
98 } |
99 } |
99 |
100 |
|
101 public boolean isUsedAsGuardInput() { |
|
102 if (this.hasUsages()) { |
|
103 for (Node n : usages()) { |
|
104 for (Position inputPosition : n.inputPositions()) { |
|
105 if (inputPosition.getInputType() == InputType.Guard && inputPosition.get(n) == this) { |
|
106 return true; |
|
107 } |
|
108 } |
|
109 } |
|
110 } |
|
111 return false; |
|
112 } |
|
113 |
100 public NodeIterable<GuardNode> guards() { |
114 public NodeIterable<GuardNode> guards() { |
101 return usages().filter(GuardNode.class); |
115 return usages().filter(GuardNode.class); |
102 } |
116 } |
103 |
117 |
104 public NodeIterable<Node> anchored() { |
118 public NodeIterable<Node> anchored() { |
105 return usages(); |
119 return usages(); |
|
120 } |
|
121 |
|
122 public boolean hasAnchored() { |
|
123 return this.hasUsages(); |
106 } |
124 } |
107 |
125 |
108 public NodeIterable<FixedNode> getBlockNodes() { |
126 public NodeIterable<FixedNode> getBlockNodes() { |
109 return new NodeIterable<FixedNode>() { |
127 return new NodeIterable<FixedNode>() { |
110 |
128 |