changeset 22889:afff05e25e65

Fix DebugInfoBuilder handling of constant values
author Christian Wimmer <christian.wimmer@oracle.com>
date Mon, 26 Oct 2015 09:14:01 -0700
parents 9021de742f55
children a2bf47587cc1
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Mon Oct 26 00:07:23 2015 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Mon Oct 26 09:14:01 2015 -0700
@@ -30,7 +30,6 @@
 import jdk.vm.ci.code.BytecodeFrame;
 import jdk.vm.ci.code.VirtualObject;
 import jdk.vm.ci.common.JVMCIError;
-import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.JavaType;
 import jdk.vm.ci.meta.JavaValue;
@@ -41,6 +40,7 @@
 import com.oracle.graal.debug.Debug;
 import com.oracle.graal.debug.DebugMetric;
 import com.oracle.graal.graph.Node;
+import com.oracle.graal.lir.ConstantValue;
 import com.oracle.graal.lir.LIRFrameState;
 import com.oracle.graal.lir.LabelRef;
 import com.oracle.graal.lir.Variable;
@@ -289,8 +289,12 @@
                 } else if (value != null) {
                     STATE_VARIABLES.increment();
                     Value operand = nodeValueMap.operand(value);
-                    assert operand != null && (operand instanceof Variable || operand instanceof JavaConstant) : operand + " for " + value;
-                    return (JavaValue) operand;
+                    if (operand instanceof ConstantValue && ((ConstantValue) operand).isJavaConstant()) {
+                        return ((ConstantValue) operand).getJavaConstant();
+                    } else {
+                        assert operand instanceof Variable : operand + " for " + value;
+                        return (JavaValue) operand;
+                    }
 
                 } else {
                     // return a dummy value because real value not needed