# HG changeset patch # User Tom Rodriguez # Date 1428021745 25200 # Node ID bdd5ad8ce088d816417306fd267218ec3836b42a # Parent 7bf5292dd7ad2d60d10c069e6615b291964fbe2d DebugTimers should be static final when possible diff -r 7bf5292dd7ad -r bdd5ad8ce088 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Thu Apr 02 21:27:25 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Thu Apr 02 17:42:25 2015 -0700 @@ -1738,6 +1738,13 @@ } } + private static final DebugTimer lifetimeTimer = Debug.timer("LinearScan_LifetimeAnalysis"); + private static final DebugTimer registerAllocationTimer = Debug.timer("LinearScan_RegisterAllocation"); + private static final DebugTimer optimizedSpillPositionTimer = Debug.timer("LinearScan_OptimizeSpillPosition"); + private static final DebugTimer resolveDataFlowTimer = Debug.timer("LinearScan_ResolveDataFlow"); + private static final DebugTimer eliminateSpillMoveTimer = Debug.timer("LinearScan_EliminateSpillMove"); + private static final DebugTimer assignLocationsTimer = Debug.timer("LinearScan_AssignLocations"); + void allocate() { /* @@ -1745,7 +1752,7 @@ */ try (Indent indent = Debug.logAndIndent("LinearScan allocate")) { - try (Scope s = Debug.scope("LifetimeAnalysis"); DebugCloseable a = Debug.timer("LinearScan_LifetimeAnalysis").start()) { + try (Scope s = Debug.scope("LifetimeAnalysis"); DebugCloseable a = lifetimeTimer.start()) { numberInstructions(); printLir("Before register allocation", true); computeLocalLiveSets(); @@ -1756,7 +1763,7 @@ throw Debug.handle(e); } - try (Scope s = Debug.scope("RegisterAllocation"); DebugCloseable a = Debug.timer("LinearScan_RegisterAllocation").start()) { + try (Scope s = Debug.scope("RegisterAllocation"); DebugCloseable a = registerAllocationTimer.start()) { printIntervals("Before register allocation"); allocateRegisters(); } catch (Throwable e) { @@ -1764,14 +1771,14 @@ } if (Options.LSRAOptimizeSpillPosition.getValue()) { - try (Scope s = Debug.scope("OptimizeSpillPosition"); DebugCloseable a = Debug.timer("LinearScan_OptimizeSpillPosition").start()) { + try (Scope s = Debug.scope("OptimizeSpillPosition"); DebugCloseable a = optimizedSpillPositionTimer.start()) { optimizeSpillPosition(); } catch (Throwable e) { throw Debug.handle(e); } } - try (Scope s = Debug.scope("ResolveDataFlow"); DebugCloseable a = Debug.timer("LinearScan_ResolveDataFlow").start()) { + try (Scope s = Debug.scope("ResolveDataFlow"); DebugCloseable a = resolveDataFlowTimer.start()) { resolveDataFlow(); } catch (Throwable e) { throw Debug.handle(e); @@ -1787,14 +1794,14 @@ verify(); } - try (Scope s1 = Debug.scope("EliminateSpillMove"); DebugCloseable a = Debug.timer("LinearScan_EliminateSpillMove").start()) { + try (Scope s1 = Debug.scope("EliminateSpillMove"); DebugCloseable a = eliminateSpillMoveTimer.start()) { eliminateSpillMoves(); } catch (Throwable e) { throw Debug.handle(e); } printLir("After spill move elimination", true); - try (Scope s1 = Debug.scope("AssignLocations"); DebugCloseable a = Debug.timer("LinearScan_AssignLocations").start()) { + try (Scope s1 = Debug.scope("AssignLocations"); DebugCloseable a = assignLocationsTimer.start()) { assignLocations(); } catch (Throwable e) { throw Debug.handle(e);