Mercurial > hg > truffle
changeset 5364:827854645d6c
separated the notion of has-side-effect from may-have-frame-state
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 08 May 2012 20:17:30 +0200 |
parents | 1d760684d958 |
children | 33b8603f180d |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginStateSplitNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StateSplit.java |
diffstat | 4 files changed, 25 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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; + } }
--- 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<Object, Object> getDebugProperties() { Map<Object, Object> debugProperties = super.getDebugProperties();
--- 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));
--- 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(); }