Mercurial > hg > truffle
changeset 17070:6e45ae59781c
Let linear scan DetailedAsserts deal with missing intervals
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Tue, 09 Sep 2014 11:37:57 +0200 |
parents | 2740dad59eb7 |
children | 1b7b4eb6e0ef |
files | graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java |
diffstat | 1 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Tue Sep 09 11:36:43 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Tue Sep 09 11:37:57 2014 +0200 @@ -894,15 +894,26 @@ BitSet startBlockLiveIn = blockData.get(ir.getControlFlowGraph().getStartBlock()).liveIn; try (Indent indent2 = Debug.logAndIndent("Error: liveIn set of first block must be empty (when this fails, variables are used before they are defined):")) { for (int operandNum = startBlockLiveIn.nextSetBit(0); operandNum >= 0; operandNum = startBlockLiveIn.nextSetBit(operandNum + 1)) { - Value operand = intervalFor(operandNum).operand; - Debug.log("var %d; operand=%s; node=%s", operandNum, operand, getValueForOperandFromDebugContext(operand)); + Interval interval = intervalFor(operandNum); + if (interval != null) { + Value operand = interval.operand; + Debug.log("var %d; operand=%s; node=%s", operandNum, operand, getValueForOperandFromDebugContext(operand)); + } else { + Debug.log("var %d; missing operand", operandNum); + } } } // print some additional information to simplify debugging for (int operandNum = startBlockLiveIn.nextSetBit(0); operandNum >= 0; operandNum = startBlockLiveIn.nextSetBit(operandNum + 1)) { - Value operand = intervalFor(operandNum).operand; - try (Indent indent2 = Debug.logAndIndent("---- Detailed information for var %d; operand=%s; node=%s ----", operandNum, operand, getValueForOperandFromDebugContext(operand))) { + Interval interval = intervalFor(operandNum); + Value operand = null; + ValueNode valueForOperandFromDebugContext = null; + if (interval != null) { + operand = interval.operand; + valueForOperandFromDebugContext = getValueForOperandFromDebugContext(operand); + } + try (Indent indent2 = Debug.logAndIndent("---- Detailed information for var %d; operand=%s; node=%s ----", operandNum, operand, valueForOperandFromDebugContext)) { Deque<AbstractBlock<?>> definedIn = new ArrayDeque<>(); HashSet<AbstractBlock<?>> usedIn = new HashSet<>();