# HG changeset patch # User Doug Simon # Date 1336501050 -7200 # Node ID 827854645d6ce01ec6999b20ef72d33a515786e9 # Parent 1d760684d9586cabcf260c15e50364a3eaa62e15 separated the notion of has-side-effect from may-have-frame-state diff -r 1d760684d958 -r 827854645d6c graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginStateSplitNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginStateSplitNode.java Tue May 08 16:10:00 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginStateSplitNode.java Tue May 08 20:17:30 2012 +0200 @@ -26,4 +26,12 @@ * Base class for {@link BeginNode}s that are associated with a frame state. */ public class BeginStateSplitNode extends BeginNode implements StateSplit { + + /** + * A begin node has no side effect. + */ + @Override + public boolean hasSideEffect() { + return false; + } } diff -r 1d760684d958 -r 827854645d6c graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java Tue May 08 16:10:00 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java Tue May 08 20:17:30 2012 +0200 @@ -45,6 +45,11 @@ stateAfter = x; } + // Subclasses that implement StateSplit but do not represent side-effecting instructions must override this. + public boolean hasSideEffect() { + return true; + } + @Override public Map getDebugProperties() { Map debugProperties = super.getDebugProperties(); diff -r 1d760684d958 -r 827854645d6c graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Tue May 08 16:10:00 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Tue May 08 20:17:30 2012 +0200 @@ -145,6 +145,10 @@ this.stateAfter = stateAfter; } + public boolean hasSideEffect() { + return true; + } + public FrameState stateDuring() { FrameState tempStateAfter = stateAfter(); FrameState stateDuring = tempStateAfter.duplicateModified(bci(), tempStateAfter.rethrowException(), this.callTarget.targetMethod().signature().returnKind(false)); diff -r 1d760684d958 -r 827854645d6c graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StateSplit.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StateSplit.java Tue May 08 16:10:00 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StateSplit.java Tue May 08 20:17:30 2012 +0200 @@ -23,9 +23,7 @@ package com.oracle.graal.nodes; /** - * A state split is a node that has a side effect. Execution of such a node changes - * state visible to other threads. These nodes denote boundaries across which deoptimization - * points cannot be moved. + * A state split is a node that may have a frame state associated with it. */ public interface StateSplit { @@ -38,4 +36,11 @@ * Sets the state of the JVM frame after execution of this node. */ void setStateAfter(FrameState x); + + /** + * Determines if this node has a side-effect. Execution of such a node changes + * state visible to other threads. These nodes denote boundaries across which deoptimization + * points cannot be moved. + */ + boolean hasSideEffect(); }