# HG changeset patch # User Josef Eisl # Date 1429265052 -7200 # Node ID 0e1e8879b655788980bb1831e2176091f5026ebe # Parent a7f216accfb514ec2663f9949e721e602db2beef {LS,Simple}StackSlotAllocator: use DebugMetric.isEnabled(). diff -r a7f216accfb5 -r 0e1e8879b655 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 Fri Apr 17 11:52:31 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Fri Apr 17 12:04:12 2015 +0200 @@ -108,7 +108,7 @@ private void allocate() { Debug.dump(lir, "After StackSlot numbering"); - long currentFrameSize = Debug.isMeterEnabled() ? frameMapBuilder.getFrameMap().currentFrameSize() : 0; + long currentFrameSize = StackSlotAllocator.allocatedFramesize.isEnabled() ? frameMapBuilder.getFrameMap().currentFrameSize() : 0; Set usePos; // step 2: build intervals try (Scope s = Debug.scope("StackSlotAllocationBuildIntervals"); Indent indent = Debug.logAndIndent("BuildIntervals"); DebugCloseable t = BuildIntervalsTimer.start()) { @@ -136,7 +136,7 @@ assignStackSlots(usePos); } Debug.dump(lir, "After StackSlot assignment"); - if (Debug.isMeterEnabled()) { + if (StackSlotAllocator.allocatedFramesize.isEnabled()) { StackSlotAllocator.allocatedFramesize.add(frameMapBuilder.getFrameMap().currentFrameSize() - currentFrameSize); } } diff -r a7f216accfb5 -r 0e1e8879b655 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java Fri Apr 17 11:52:31 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java Fri Apr 17 12:04:12 2015 +0200 @@ -46,7 +46,7 @@ public void allocateStackSlots(FrameMapBuilderTool builder, LIRGenerationResult res) { StackSlot[] mapping = new StackSlot[builder.getNumberOfStackSlots()]; - long currentFrameSize = Debug.isMeterEnabled() ? builder.getFrameMap().currentFrameSize() : 0; + long currentFrameSize = allocatedFramesize.isEnabled() ? builder.getFrameMap().currentFrameSize() : 0; for (VirtualStackSlot virtualSlot : builder.getStackSlots()) { final StackSlot slot; if (virtualSlot instanceof SimpleVirtualStackSlot) { @@ -63,7 +63,9 @@ mapping[virtualSlot.getId()] = slot; } updateLIR(res, mapping); - allocatedFramesize.add(builder.getFrameMap().currentFrameSize() - currentFrameSize); + if (allocatedFramesize.isEnabled()) { + allocatedFramesize.add(builder.getFrameMap().currentFrameSize() - currentFrameSize); + } } protected void updateLIR(LIRGenerationResult res, StackSlot[] mapping) {