Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java @ 2761:d3398b21faf9
Re-enabled CFG optimization (now only on LIRBlock data structure).
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Sat, 21 May 2011 17:46:54 +0200 |
parents | 127db58b044e |
children | 43ffa0e47a46 |
comparison
equal
deleted
inserted
replaced
2760:127db58b044e | 2761:d3398b21faf9 |
---|---|
26 | 26 |
27 import com.oracle.max.asm.*; | 27 import com.oracle.max.asm.*; |
28 import com.sun.c1x.alloc.*; | 28 import com.sun.c1x.alloc.*; |
29 import com.sun.c1x.debug.*; | 29 import com.sun.c1x.debug.*; |
30 import com.sun.c1x.ir.*; | 30 import com.sun.c1x.ir.*; |
31 import com.sun.c1x.util.*; | |
31 import com.sun.c1x.value.*; | 32 import com.sun.c1x.value.*; |
32 import com.sun.cri.ci.*; | 33 import com.sun.cri.ci.*; |
33 | 34 |
34 /** | 35 /** |
35 * The {@code LIRBlock} class definition. | 36 * The {@code LIRBlock} class definition. |
201 } | 202 } |
202 | 203 |
203 public FrameState stateBefore() { | 204 public FrameState stateBefore() { |
204 return stateBefore; | 205 return stateBefore; |
205 } | 206 } |
207 | |
208 public void replaceWith(LIRBlock other) { | |
209 for (LIRBlock pred : predecessors) { | |
210 Util.replaceAllInList(this, other, pred.successors); | |
211 } | |
212 for (int i = 0; i < other.predecessors.size(); ++i) { | |
213 if (other.predecessors.get(i) == this) { | |
214 other.predecessors.remove(i); | |
215 other.predecessors.addAll(i, this.predecessors); | |
216 } | |
217 } | |
218 successors.clear(); | |
219 predecessors.clear(); | |
220 } | |
206 } | 221 } |