< prev index next >

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

Print this page
rev 52509 : [mq]: graal

*** 43,52 **** --- 43,54 ---- @NodeInfo(allowedUsageTypes = {InputType.Guard, InputType.Anchor}) public abstract class AbstractBeginNode extends FixedWithNextNode implements LIRLowerable, GuardingNode, AnchoringNode, IterableNodeType { public static final NodeClass<AbstractBeginNode> TYPE = NodeClass.create(AbstractBeginNode.class); + private boolean withSpeculationFence; + protected AbstractBeginNode(NodeClass<? extends AbstractBeginNode> c) { this(c, StampFactory.forVoid()); } protected AbstractBeginNode(NodeClass<? extends AbstractBeginNode> c, Stamp stamp) {
*** 89,99 **** return super.verify(); } @Override public void generate(NodeLIRBuilderTool gen) { ! // nop } public NodeIterable<GuardNode> guards() { return usages().filter(GuardNode.class); } --- 91,103 ---- return super.verify(); } @Override public void generate(NodeLIRBuilderTool gen) { ! if (withSpeculationFence) { ! gen.getLIRGeneratorTool().emitSpeculationFence(); ! } } public NodeIterable<GuardNode> guards() { return usages().filter(GuardNode.class); }
*** 110,119 **** --- 114,131 ---- return new BlockNodeIterator(AbstractBeginNode.this); } }; } + /** + * Set this begin node to be a speculation fence. This will prevent speculative execution of + * this block. + */ + public void setWithSpeculationFence() { + this.withSpeculationFence = true; + } + private static class BlockNodeIterator implements Iterator<FixedNode> { private FixedNode current; BlockNodeIterator(FixedNode next) {
< prev index next >