# HG changeset patch # User Christian Wimmer # Date 1351620755 25200 # Node ID c162fcf45ce79588e9f18efb7b65aaf09460d3a0 # Parent ea38da80dd29b9f9bbf0eec34eaab8a7a9f56aa7 CodeCacheProvider.callKillsRegisters is not necessary because this information can be inferred from the register configuration diff -r ea38da80dd29 -r c162fcf45ce7 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java Tue Oct 30 13:54:39 2012 +0100 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java Tue Oct 30 11:12:35 2012 -0700 @@ -70,12 +70,6 @@ int getCustomStackAreaSize(); /** - * Determines if a call instruction in compiled code can assume all allocatable - * registers are killed by the call. - */ - boolean callKillsRegisters(); - - /** * Minimum size of the stack area reserved for outgoing parameters. This area is reserved in all cases, even when * the compiled method has no regular call instructions. * diff -r ea38da80dd29 -r c162fcf45ce7 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java Tue Oct 30 13:54:39 2012 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java Tue Oct 30 11:12:35 2012 -0700 @@ -29,7 +29,7 @@ import java.util.*; import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.Register.*; +import com.oracle.graal.api.code.Register.RegisterFlag; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.alloc.Interval.RegisterBinding; import com.oracle.graal.compiler.alloc.Interval.RegisterPriority; @@ -37,7 +37,7 @@ import com.oracle.graal.compiler.alloc.Interval.State; import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; -import com.oracle.graal.lir.StandardOp.*; +import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.util.*; @@ -73,7 +73,13 @@ LinearScanWalker(LinearScan allocator, Interval unhandledFixedFirst, Interval unhandledAnyFirst) { super(allocator, unhandledFixedFirst, unhandledAnyFirst); - this.callKillsRegisters = allocator.frameMap.runtime.callKillsRegisters(); + + // If all allocatable registers are caller saved, then no registers are live across a call site. + // The register allocator can save time not trying to find a register at a call site. + HashSet registers = new HashSet<>(Arrays.asList(allocator.frameMap.registerConfig.getAllocatableRegisters())); + registers.removeAll(Arrays.asList(allocator.frameMap.registerConfig.getCallerSaveRegisters())); + callKillsRegisters = registers.size() == 0; + moveResolver = new MoveResolver(allocator); spillIntervals = Util.uncheckedCast(new List[allocator.registers.length]); for (int i = 0; i < allocator.registers.length; i++) { diff -r ea38da80dd29 -r c162fcf45ce7 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRuntime.java Tue Oct 30 13:54:39 2012 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRuntime.java Tue Oct 30 11:12:35 2012 -0700 @@ -123,11 +123,6 @@ } @Override - public boolean callKillsRegisters() { - return true; - } - - @Override public Register threadRegister() { return r15; }