Mercurial > hg > graal-jvmci-8
diff graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java @ 2756:bfcdda4fdd73
Removed the direct connection between BlockBegin and BlockEnd.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Fri, 20 May 2011 14:51:45 +0200 |
parents | c1a9bf38da28 |
children | 27512ea6bbcb |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java Fri May 20 14:34:36 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java Fri May 20 14:51:45 2011 +0200 @@ -22,6 +22,8 @@ */ package com.sun.c1x.ir; +import java.util.*; + import com.oracle.graal.graph.*; import com.sun.c1x.*; import com.sun.c1x.value.*; @@ -112,10 +114,11 @@ @Override public BlockBegin block() { Instruction cur = this; - while (!(cur instanceof BlockEnd)) { - cur = cur.next(); + while (!(cur instanceof BlockBegin)) { + List<Node> preds = cur.predecessors(); + cur = (Instruction) preds.get(0); } - return ((BlockEnd) cur).begin(); + return (BlockBegin) cur; } /**