Mercurial > hg > truffle
changeset 4318:e3374bccaa5f
Merge
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Mon, 23 Jan 2012 08:26:45 -0800 |
parents | ef004bae30ae (diff) b4b16e4e043f (current diff) |
children | e02b67e39aa3 2b7474c492a9 f33f866a12e5 |
files | |
diffstat | 1 files changed, 13 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java Mon Jan 23 14:35:29 2012 +0100 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java Mon Jan 23 08:26:45 2012 -0800 @@ -147,7 +147,9 @@ private CiValue use(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { allowed(curInstruction, value, mode, flags); - if (beforeRegisterAllocation && isVariable(value)) { + if (isVariable(value)) { + assert beforeRegisterAllocation; + int variableIdx = asVariable(value).index; if (!curVariablesLive.get(variableIdx)) { TTY.println("block %s instruction %s", curBlock, curInstruction); @@ -159,9 +161,13 @@ throw Util.shouldNotReachHere(); } - } else if (beforeRegisterAllocation && isAllocatableRegister(value)) { + } else if (isAllocatableRegister(value)) { int regNum = asRegister(value).number; - if (curRegistersLive[regNum] != value) { + if (mode == OperandMode.Alive) { + curRegistersDefined.set(regNum); + } + + if (beforeRegisterAllocation && curRegistersLive[regNum] != value) { TTY.println("block %s instruction %s", curBlock, curInstruction); TTY.println("live registers: %s", Arrays.toString(curRegistersLive)); TTY.println("ERROR: Use of fixed register %s that is not defined in this block", value); @@ -174,7 +180,9 @@ private CiValue def(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { allowed(curInstruction, value, mode, flags); - if (beforeRegisterAllocation && isVariable(value)) { + if (isVariable(value)) { + assert beforeRegisterAllocation; + int variableIdx = asVariable(value).index; if (variableDefinitions[variableIdx] != null) { TTY.println("block %s instruction %s", curBlock, curInstruction); @@ -190,7 +198,7 @@ curVariablesLive.set(variableIdx); } - } else if (beforeRegisterAllocation && isAllocatableRegister(value)) { + } else if (isAllocatableRegister(value)) { int regNum = asRegister(value).number; if (curRegistersDefined.get(regNum)) { TTY.println("block %s instruction %s", curBlock, curInstruction);