changeset 10961:d0c9278fe471

move callKillsRegisters to LinearScan
author twisti
date Sun, 04 Aug 2013 11:26:16 -0700
parents 8aba11322f4e
children ebaef68b38f9
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(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Sun Aug 04 11:24:55 2013 -0700
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Sun Aug 04 11:26:16 2013 -0700
@@ -63,6 +63,8 @@
     final RegisterAttributes[] registerAttributes;
     final Register[] registers;
 
+    boolean callKillsRegisters;
+
     private static final int INITIAL_SPLIT_INTERVALS_CAPACITY = 32;
 
     public static class BlockData {
@@ -1702,7 +1704,7 @@
     }
 
     private void computeDebugInfo(IntervalWalker iw, final LIRInstruction op, LIRFrameState info) {
-        BitSet registerRefMap = op.destroysCallerSavedRegisters() ? null : frameMap.initRegisterRefMap();
+        BitSet registerRefMap = op.destroysCallerSavedRegisters() && callKillsRegisters ? null : frameMap.initRegisterRefMap();
         BitSet frameRefMap = frameMap.initFrameRefMap();
         computeOopMap(iw, op, registerRefMap, frameRefMap);
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Sun Aug 04 11:24:55 2013 -0700
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Sun Aug 04 11:26:16 2013 -0700
@@ -45,8 +45,6 @@
  */
 final class LinearScanWalker extends IntervalWalker {
 
-    private final boolean callKillsRegisters;
-
     private Register[] availableRegs;
 
     private final int[] usePos;
@@ -77,7 +75,7 @@
         // The register allocator can save time not trying to find a register at a call site.
         HashSet<Register> registers = new HashSet<>(Arrays.asList(allocator.frameMap.registerConfig.getAllocatableRegisters()));
         registers.removeAll(Arrays.asList(allocator.frameMap.registerConfig.getCallerSaveRegisters()));
-        callKillsRegisters = registers.size() == 0;
+        allocator.callKillsRegisters = registers.size() == 0;
 
         moveResolver = new MoveResolver(allocator);
         spillIntervals = Util.uncheckedCast(new List[allocator.registers.length]);
@@ -784,8 +782,7 @@
     }
 
     boolean noAllocationPossible(Interval interval) {
-
-        if (callKillsRegisters) {
+        if (allocator.callKillsRegisters) {
             // fast calculation of intervals that can never get a register because the
             // the next instruction is a call that blocks all registers
             // Note: this only works if a call kills all registers