# HG changeset patch # User Roland Schatz # Date 1403602982 -7200 # Node ID ef1834ac566c1a4e5c7b600f28c1d51f9cb62e8a # Parent 5785eca138b08f340d4476a8b144751b4d4816fd Fold nodes with alwaysNull stamp into constant. diff -r 5785eca138b0 -r ef1834ac566c graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java Mon Jun 23 18:04:15 2014 -0700 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java Tue Jun 24 11:43:02 2014 +0200 @@ -64,4 +64,13 @@ } return false; } + + @Override + public Constant asConstant() { + if (alwaysNull()) { + return Constant.NULL_OBJECT; + } else { + return null; + } + } } diff -r 5785eca138b0 -r ef1834ac566c graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java Mon Jun 23 18:04:15 2014 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java Tue Jun 24 11:43:02 2014 +0200 @@ -26,6 +26,7 @@ import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.HotSpotVMConfig.CompressEncoding; +import com.oracle.graal.hotspot.meta.*; public class NarrowOopStamp extends AbstractObjectStamp { @@ -100,4 +101,13 @@ } return super.equals(other); } + + @Override + public Constant asConstant() { + if (alwaysNull()) { + return HotSpotCompressedNullConstant.COMPRESSED_NULL; + } else { + return null; + } + } }