# HG changeset patch # User Josef Eisl # Date 1422468777 -3600 # Node ID b646e37bc9891bcad7092067b76bc5387aa92849 # Parent beb7c10b77475e6db7d3e8b4bf7c714b2499a321 StackSlotAllocation: handle uninitialized stack slots. diff -r beb7c10b7747 -r b646e37bc989 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Tue Jan 13 17:52:18 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Wed Jan 28 19:12:57 2015 +0100 @@ -247,7 +247,7 @@ private void useConsumer(LIRInstruction inst, Value operand, OperandMode mode, EnumSet flags) { if (isVirtualStackSlot(operand)) { VirtualStackSlot vslot = asVirtualStackSlot(operand); - addUse(vslot, inst); + addUse(vslot, inst, flags); Debug.log("set operand: %s", operand); currentSet.set(vslot.getId()); } @@ -272,9 +272,16 @@ } - private void addUse(VirtualStackSlot stackSlot, LIRInstruction inst) { + private void addUse(VirtualStackSlot stackSlot, LIRInstruction inst, EnumSet flags) { StackInterval interval = getOrCreateInterval(stackSlot); - interval.addUse(inst.id()); + if (flags.contains(OperandFlag.UNINITIALIZED)) { + // Stack slot is marked uninitialized so we have to assume it is live all + // the time. + interval.addDef(0); + interval.addUse(maxOpId()); + } else { + interval.addUse(inst.id()); + } } private void addDef(VirtualStackSlot stackSlot, LIRInstruction inst) {