# HG changeset patch # User Josef Eisl # Date 1422525367 -3600 # Node ID 9a3bde73e05a2fb8de1de3fc7edf86e7d1aae0bb # Parent 94ca6ce786ee2d90983667ed78b688dbd13bf1fa StackSlotAllocation: add metric for uninitialized stack slots. diff -r 94ca6ce786ee -r 9a3bde73e05a 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 Thu Jan 29 10:38:01 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Thu Jan 29 10:56:07 2015 +0100 @@ -58,6 +58,11 @@ // @formatter:on } + /** + * The number of allocated stack slots. + */ + static final DebugMetric uninitializedSlots = Debug.metric("StackSlotAllocator[uninitializedSlots]"); + public void allocateStackSlots(FrameMapBuilderTool builder, LIRGenerationResult res) { new Allocator(res.getLIR(), builder).allocate(); } @@ -287,6 +292,9 @@ if (flags.contains(OperandFlag.UNINITIALIZED)) { // Stack slot is marked uninitialized so we have to assume it is live all // the time. + if (Debug.isMeterEnabled() && !(interval.from() == 0 && interval.to() == maxOpId())) { + uninitializedSlots.increment(); + } interval.addDef(0); interval.addUse(maxOpId()); } else {