changeset 18512:bcf66634c55c

Make LinearScan.callKillsRegisters final.
author Josef Eisl <josef.eisl@jku.at>
date Tue, 25 Nov 2014 15:23:40 +0100
parents 62aac33db669
children a21a4039ce7b
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Wed Nov 26 01:06:38 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Tue Nov 25 15:23:40 2014 +0100
@@ -66,7 +66,7 @@
     final RegisterAttributes[] registerAttributes;
     final Register[] registers;
 
-    boolean callKillsRegisters;
+    final boolean callKillsRegisters;
 
     public static final int DOMINATOR_SPILL_MOVE_ID = -2;
     private static final int SPLIT_INTERVALS_CAPACITY_RIGHT_SHIFT = 1;
@@ -173,6 +173,10 @@
         this.registers = target.arch.getRegisters();
         this.firstVariableNumber = registers.length;
         this.blockData = new BlockMap<>(ir.getControlFlowGraph());
+
+        // 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.
+        this.callKillsRegisters = this.frameMapBuilder.getRegisterConfig().areAllAllocatableRegistersCallerSaved();
     }
 
     public int getFirstLirInstructionId(AbstractBlock<?> block) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Wed Nov 26 01:06:38 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Tue Nov 25 15:23:40 2014 +0100
@@ -77,10 +77,6 @@
     LinearScanWalker(LinearScan allocator, Interval unhandledFixedFirst, Interval unhandledAnyFirst) {
         super(allocator, unhandledFixedFirst, unhandledAnyFirst);
 
-        // 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.
-        allocator.callKillsRegisters = allocator.frameMapBuilder.getRegisterConfig().areAllAllocatableRegistersCallerSaved();
-
         moveResolver = new MoveResolver(allocator);
         spillIntervals = Util.uncheckedCast(new List[allocator.registers.length]);
         for (int i = 0; i < allocator.registers.length; i++) {