changeset 21004:0e1e8879b655

{LS,Simple}StackSlotAllocator: use DebugMetric.isEnabled().
author Josef Eisl <josef.eisl@jku.at>
date Fri, 17 Apr 2015 12:04:12 +0200
parents a7f216accfb5
children e413295a3c95 a84d57d27727
files graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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<LIRInstruction> 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);
             }
         }
--- 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) {