comparison graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/MoveResolver.java @ 4323:df5547057954

Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
author Christian Wimmer <Christian.Wimmer@Oracle.com>
date Wed, 25 Jan 2012 14:34:53 -0800
parents 48cbd78fa964
children cf13124efdd9
comparison
equal deleted inserted replaced
4322:49b33f8fcad7 4323:df5547057954
32 import com.oracle.max.graal.compiler.alloc.*; 32 import com.oracle.max.graal.compiler.alloc.*;
33 import com.oracle.max.graal.compiler.lir.*; 33 import com.oracle.max.graal.compiler.lir.*;
34 import com.oracle.max.graal.compiler.util.*; 34 import com.oracle.max.graal.compiler.util.*;
35 35
36 public abstract class MoveResolver { 36 public abstract class MoveResolver {
37 private final LIR lir;
37 private final FrameMap frameMap; 38 private final FrameMap frameMap;
38 private final int[] registersBlocked; 39 private final int[] registersBlocked;
39 private final Map<CiValue, Integer> valuesBlocked; 40 private final Map<CiValue, Integer> valuesBlocked;
40 private final List<CiValue> mappingFrom; 41 private final List<CiValue> mappingFrom;
41 private final List<Location> mappingTo; 42 private final List<Location> mappingTo;
42 private final LIRInsertionBuffer insertionBuffer; 43 private final LIRInsertionBuffer insertionBuffer;
43 private int insertPos; 44 private int insertPos;
44 45
45 public MoveResolver(FrameMap frameMap) { 46 public MoveResolver(LIR lir, FrameMap frameMap) {
47 this.lir = lir;
46 this.frameMap = frameMap; 48 this.frameMap = frameMap;
47 49
48 registersBlocked = new int[frameMap.target.arch.registers.length]; 50 registersBlocked = new int[frameMap.target.arch.registers.length];
49 valuesBlocked = new HashMap<>(); 51 valuesBlocked = new HashMap<>();
50 52
290 insertMove(scratchSaved, asLocation(scratch)); 292 insertMove(scratchSaved, asLocation(scratch));
291 } 293 }
292 294
293 } else { 295 } else {
294 assert trace("mr MOV %s -> %s", src, dst); 296 assert trace("mr MOV %s -> %s", src, dst);
295 insertionBuffer.append(insertPos, StandardOpcode.SPILL_MOVE.create(dst, src)); 297 insertionBuffer.append(insertPos, lir.spillMoveFactory.createMove(dst, src));
296 } 298 }
297 } 299 }
298 300
299 /** 301 /**
300 * Provides a register that can be used by the move resolver. If the returned value is a 302 * Provides a register that can be used by the move resolver. If the returned value is a