# HG changeset patch # User Christian Wimmer # Date 1359985528 28800 # Node ID fca53a04eabcf6593401c17701b7a928815deff6 # Parent fae0b2f0279ec8c0301423ee41cf8988a602eb59 Do not call inferStamp when it is already known that a node is a Word. When the input operand is already rewritten, this could cause an exception. Example: CheckCastNode.inferStamp expect that the input has an objectStamp, but at the point of inferStamp it would already be a primitive stamp. diff -r fae0b2f0279e -r fca53a04eabc graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Mon Feb 04 05:41:14 2013 -0800 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Mon Feb 04 05:45:28 2013 -0800 @@ -284,7 +284,19 @@ } public boolean isWord(ValueNode node) { + /* + * If we already know that we have a word type, we do not need to infer the stamp. This + * avoids exceptions in inferStamp when the inputs have already been rewritten to word, + * i.e., when the expected input is no longer an object. + */ + if (isWord0(node)) { + return true; + } node.inferStamp(); + return isWord0(node); + } + + private boolean isWord0(ValueNode node) { if (node.stamp() == StampFactory.forWord()) { return true; }