# HG changeset patch # User Roland Schatz # Date 1409835874 -7200 # Node ID e8c37988a8194dd0f97f324761bf42a8050980fa # Parent c72182ae4476d8e5f90e9f7bdd384a10aebda1fd Split method in OptimizingLinearScanWalker. diff -r c72182ae4476 -r e8c37988a819 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/OptimizingLinearScanWalker.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/OptimizingLinearScanWalker.java Thu Sep 04 13:44:45 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/OptimizingLinearScanWalker.java Thu Sep 04 15:04:34 2014 +0200 @@ -74,34 +74,39 @@ void walk() { try (Scope s = Debug.scope("OptimizingLinearScanWalker")) { for (AbstractBlock block : allocator.sortedBlocks) { - if (block.getPredecessorCount() == 1) { - int nextBlock = allocator.getFirstLirInstructionId(block); - try (Scope s1 = Debug.scope("LSRAOptimization")) { - Debug.log("next block: %s (%d)", block, nextBlock); - } - try (Indent indent0 = Debug.indent()) { - walkTo(nextBlock); + optimizeBlock(block); + } + } + super.walk(); + } + + private void optimizeBlock(AbstractBlock block) { + if (block.getPredecessorCount() == 1) { + int nextBlock = allocator.getFirstLirInstructionId(block); + try (Scope s1 = Debug.scope("LSRAOptimization")) { + Debug.log("next block: %s (%d)", block, nextBlock); + } + try (Indent indent0 = Debug.indent()) { + walkTo(nextBlock); - try (Scope s1 = Debug.scope("LSRAOptimization")) { - boolean changed = true; - // we need to do this because the active lists might change - loop: while (changed) { - changed = false; - try (Indent indent1 = Debug.logAndIndent("Active intervals: (block %s [%d])", block, nextBlock)) { - for (Interval active = activeLists.get(RegisterBinding.Any); active != Interval.EndMarker; active = active.next) { - Debug.log("active (any): %s", active); - if (optimize(nextBlock, block, active, RegisterBinding.Any)) { - changed = true; - break loop; - } - } - for (Interval active = activeLists.get(RegisterBinding.Stack); active != Interval.EndMarker; active = active.next) { - Debug.log("active (stack): %s", active); - if (optimize(nextBlock, block, active, RegisterBinding.Stack)) { - changed = true; - break loop; - } - } + try (Scope s1 = Debug.scope("LSRAOptimization")) { + boolean changed = true; + // we need to do this because the active lists might change + loop: while (changed) { + changed = false; + try (Indent indent1 = Debug.logAndIndent("Active intervals: (block %s [%d])", block, nextBlock)) { + for (Interval active = activeLists.get(RegisterBinding.Any); active != Interval.EndMarker; active = active.next) { + Debug.log("active (any): %s", active); + if (optimize(nextBlock, block, active, RegisterBinding.Any)) { + changed = true; + break loop; + } + } + for (Interval active = activeLists.get(RegisterBinding.Stack); active != Interval.EndMarker; active = active.next) { + Debug.log("active (stack): %s", active); + if (optimize(nextBlock, block, active, RegisterBinding.Stack)) { + changed = true; + break loop; } } } @@ -109,7 +114,6 @@ } } } - super.walk(); } private boolean optimize(int currentPos, AbstractBlock currentBlock, Interval currentInterval, RegisterBinding binding) {