comparison graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java @ 2791:6d14aa4fbf90

Gotos removed (except for exception dispatch chains and edge splitting).
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 25 May 2011 20:03:05 +0200
parents aeccd2af4e9e
children 58e65eb6bb5d
comparison
equal deleted inserted replaced
2790:50677668afe3 2791:6d14aa4fbf90
25 import static com.sun.cri.ci.CiUtil.*; 25 import static com.sun.cri.ci.CiUtil.*;
26 import static java.lang.reflect.Modifier.*; 26 import static java.lang.reflect.Modifier.*;
27 27
28 import java.util.*; 28 import java.util.*;
29 29
30 import com.oracle.graal.graph.*;
30 import com.sun.c1x.*; 31 import com.sun.c1x.*;
31 import com.sun.c1x.alloc.Interval.*; 32 import com.sun.c1x.alloc.Interval.*;
32 import com.sun.c1x.debug.*; 33 import com.sun.c1x.debug.*;
33 import com.sun.c1x.gen.*; 34 import com.sun.c1x.gen.*;
34 import com.sun.c1x.graph.*; 35 import com.sun.c1x.graph.*;
811 if (C1XOptions.DetailedAsserts) { 812 if (C1XOptions.DetailedAsserts) {
812 reportFailure(numBlocks); 813 reportFailure(numBlocks);
813 } 814 }
814 815
815 TTY.println("preds=" + startBlock.blockPredecessors().size() + ", succs=" + startBlock.blockSuccessors().size()); 816 TTY.println("preds=" + startBlock.blockPredecessors().size() + ", succs=" + startBlock.blockSuccessors().size());
817 TTY.println("startBlock-ID: " + startBlock.blockID());
816 818
817 // bailout of if this occurs in product mode. 819 // bailout of if this occurs in product mode.
818 throw new CiBailout("liveIn set of first block must be empty"); 820 throw new CiBailout("liveIn set of first block must be empty");
819 } 821 }
820 } 822 }
821 823
822 private void reportFailure(int numBlocks) { 824 private void reportFailure(int numBlocks) {
825 TTY.println(compilation.method.toString());
823 TTY.println("Error: liveIn set of first block must be empty (when this fails, variables are used before they are defined)"); 826 TTY.println("Error: liveIn set of first block must be empty (when this fails, variables are used before they are defined)");
824 TTY.print("affected registers:"); 827 TTY.print("affected registers:");
825 TTY.println(ir.startBlock.liveIn.toString()); 828 TTY.println(ir.startBlock.liveIn.toString());
826 829
827 // print some additional information to simplify debugging 830 // print some additional information to simplify debugging
828 for (int operandNum = 0; operandNum < ir.startBlock.liveIn.size(); operandNum++) { 831 for (int operandNum = 0; operandNum < ir.startBlock.liveIn.size(); operandNum++) {
829 if (ir.startBlock.liveIn.get(operandNum)) { 832 if (ir.startBlock.liveIn.get(operandNum)) {
830 CiValue operand = operands.operandFor(operandNum); 833 CiValue operand = operands.operandFor(operandNum);
831 Value instr = operand.isVariable() ? gen.operands.instructionForResult(((CiVariable) operand)) : null; 834 Value instr = operand.isVariable() ? gen.operands.instructionForResult(((CiVariable) operand)) : null;
832 TTY.println(" var %d (HIR instruction %s)", operandNum, instr == null ? " " : instr.toString()); 835 TTY.println(" var %d (HIR instruction %s)", operandNum, instr == null ? " " : instr.toString());
836
837 if (instr instanceof Phi) {
838 Phi phi = (Phi) instr;
839 TTY.println("phi block begin: " + phi.block());
840 TTY.println("pred count on blockbegin: " + phi.block().predecessors().size());
841 TTY.println("phi values: " + phi.valueCount());
842 TTY.println("phi block preds:");
843 for (Node n : phi.block().predecessors()) {
844 TTY.println(n.toString());
845 }
846 }
833 847
834 for (int j = 0; j < numBlocks; j++) { 848 for (int j = 0; j < numBlocks; j++) {
835 LIRBlock block = blockAt(j); 849 LIRBlock block = blockAt(j);
836 if (block.liveGen.get(operandNum)) { 850 if (block.liveGen.get(operandNum)) {
837 TTY.println(" used in block B%d", block.blockID()); 851 TTY.println(" used in block B%d", block.blockID());