# HG changeset patch # User Christian Wimmer # Date 1324673040 28800 # Node ID 7d5a6569275e900a2806d5be9848cf866b5f61ad # Parent a47535c91bf1bfc0989b31e71b9ed49ca07ee16a Remove unnecessary field from MoveResolver diff -r a47535c91bf1 -r 7d5a6569275e graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LIRInsertionBuffer.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LIRInsertionBuffer.java Fri Dec 23 12:21:46 2011 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LIRInsertionBuffer.java Fri Dec 23 12:44:00 2011 -0800 @@ -76,6 +76,10 @@ return lir != null; } + public List lirList() { + return lir; + } + /** * Enqueue a new instruction that will be appended to the instruction list when {@link #finish()} is called. * The new instruction is added before the existing instruction with the given index. This method can only be called diff -r a47535c91bf1 -r 7d5a6569275e graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java Fri Dec 23 12:21:46 2011 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java Fri Dec 23 12:44:00 2011 -0800 @@ -36,7 +36,6 @@ private final LinearScan allocator; - private List insertList; private int insertIdx; private LIRInsertionBuffer insertionBuffer; // buffer where moves are inserted @@ -88,7 +87,7 @@ private boolean verifyBeforeResolve() { assert mappingFrom.size() == mappingFromOpr.size() : "length must be equal"; assert mappingFrom.size() == mappingTo.size() : "length must be equal"; - assert insertList != null && insertIdx != -1 : "insert position not set"; + assert insertIdx != -1 : "insert position not set"; int i; int j; @@ -187,14 +186,13 @@ } assert !insertionBuffer.initialized() : "must be uninitialized now"; - insertList = null; insertIdx = -1; } private void insertMove(Interval fromInterval, Interval toInterval) { assert fromInterval.operand != toInterval.operand : "from and to interval equal: " + fromInterval; assert Util.archKindsEqual(fromInterval.kind(), toInterval.kind()) : "move between different types"; - assert insertList != null && insertIdx != -1 : "must setup insert position first"; + assert insertIdx != -1 : "must setup insert position first"; CiValue fromOpr = fromInterval.operand; CiValue toOpr = toInterval.operand; @@ -208,7 +206,7 @@ private void insertMove(CiValue fromOpr, Interval toInterval) { assert Util.archKindsEqual(fromOpr.kind, toInterval.kind()) : "move between different types"; - assert insertList != null && insertIdx != -1 : "must setup insert position first"; + assert insertIdx != -1 : "must setup insert position first"; CiValue toOpr = toInterval.operand; insertionBuffer.append(insertIdx, StandardOpcode.MOVE.create(toOpr, fromOpr)); @@ -303,27 +301,25 @@ } void setInsertPosition(List insertList, int insertIdx) { - assert this.insertList == null && this.insertIdx == -1 : "use moveInsertPosition instead of setInsertPosition when data already set"; + assert this.insertIdx == -1 : "use moveInsertPosition instead of setInsertPosition when data already set"; createInsertionBuffer(insertList); - this.insertList = insertList; this.insertIdx = insertIdx; } void moveInsertPosition(List newInsertList, int newInsertIdx) { - if (this.insertList != null && (this.insertList != newInsertList || this.insertIdx != newInsertIdx)) { + if (insertionBuffer.lirList() != null && (insertionBuffer.lirList() != newInsertList || this.insertIdx != newInsertIdx)) { // insert position changed . resolve current mappings resolveMappings(); } - if (this.insertList != newInsertList) { + if (insertionBuffer.lirList() != newInsertList) { // block changed . append insertionBuffer because it is // bound to a specific block and create a new insertionBuffer appendInsertionBuffer(); createInsertionBuffer(newInsertList); } - this.insertList = newInsertList; this.insertIdx = newInsertIdx; }