Mercurial > hg > graal-jvmci-8
changeset 5199:b968b71e22a4
Allow tracking nodes responsible for a non-empty liveIn in LinearScan
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 06 Apr 2012 14:41:10 +0200 |
parents | e91f0761c56d |
children | 2f31efbd60ac |
files | graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Fri Apr 06 14:26:33 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Fri Apr 06 14:41:10 2012 +0200 @@ -860,7 +860,7 @@ for (int operandNum = 0; operandNum < blockData.get(ir.cfg.getStartBlock()).liveIn.size(); operandNum++) { if (blockData.get(ir.cfg.getStartBlock()).liveIn.get(operandNum)) { CiValue operand = operandFor(operandNum); - TTY.println(" var %d; operand=%s", operandNum, operand.toString()); + TTY.println(" var %d; operand=%s; node=%s", operandNum, operand.toString(), gen.valueForOperand(operand)); for (int j = 0; j < numBlocks; j++) { Block block = blockAt(j);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Fri Apr 06 14:26:33 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Fri Apr 06 14:41:10 2012 +0200 @@ -27,6 +27,7 @@ import static com.oracle.max.cri.ci.CiValue.*; import java.util.*; +import java.util.Map.Entry; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.util.*; @@ -173,6 +174,15 @@ return nodeOperands.get(node); } + public ValueNode valueForOperand(CiValue value) { + for (Entry<Node, CiValue> entry : nodeOperands.entries()) { + if (entry.getValue() == value) { + return (ValueNode) entry.getKey(); + } + } + return null; + } + /** * Creates a new {@linkplain Variable variable}. * @param kind The kind of the new variable.