Mercurial > hg > truffle
comparison graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java @ 19333:ae87324c37d6
Do not extend AbstractBlockBase with BciBlock.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 12 Feb 2015 21:37:38 +0100 |
parents | 637ca4d37bca |
children | fc390dcb0ba5 |
comparison
equal
deleted
inserted
replaced
19332:833d0361c3e2 | 19333:ae87324c37d6 |
---|---|
840 int nofCases = bs.numberOfCases(); | 840 int nofCases = bs.numberOfCases(); |
841 double[] keyProbabilities = switchProbability(nofCases + 1, bci); | 841 double[] keyProbabilities = switchProbability(nofCases + 1, bci); |
842 | 842 |
843 Map<Integer, SuccessorInfo> bciToBlockSuccessorIndex = new HashMap<>(); | 843 Map<Integer, SuccessorInfo> bciToBlockSuccessorIndex = new HashMap<>(); |
844 for (int i = 0; i < currentBlock.getSuccessorCount(); i++) { | 844 for (int i = 0; i < currentBlock.getSuccessorCount(); i++) { |
845 assert !bciToBlockSuccessorIndex.containsKey(currentBlock.getSuccessors().get(i).startBci); | 845 assert !bciToBlockSuccessorIndex.containsKey(currentBlock.getSuccessor(i).startBci); |
846 if (!bciToBlockSuccessorIndex.containsKey(currentBlock.getSuccessors().get(i).startBci)) { | 846 if (!bciToBlockSuccessorIndex.containsKey(currentBlock.getSuccessor(i).startBci)) { |
847 bciToBlockSuccessorIndex.put(currentBlock.getSuccessors().get(i).startBci, new SuccessorInfo(i)); | 847 bciToBlockSuccessorIndex.put(currentBlock.getSuccessor(i).startBci, new SuccessorInfo(i)); |
848 } | 848 } |
849 } | 849 } |
850 | 850 |
851 ArrayList<BciBlock> actualSuccessors = new ArrayList<>(); | 851 ArrayList<BciBlock> actualSuccessors = new ArrayList<>(); |
852 int[] keys = new int[nofCases]; | 852 int[] keys = new int[nofCases]; |
867 } else { | 867 } else { |
868 int targetBci = i >= nofCases ? bs.defaultTarget() : bs.targetAt(i); | 868 int targetBci = i >= nofCases ? bs.defaultTarget() : bs.targetAt(i); |
869 SuccessorInfo info = bciToBlockSuccessorIndex.get(targetBci); | 869 SuccessorInfo info = bciToBlockSuccessorIndex.get(targetBci); |
870 if (info.actualIndex < 0) { | 870 if (info.actualIndex < 0) { |
871 info.actualIndex = nextSuccessorIndex++; | 871 info.actualIndex = nextSuccessorIndex++; |
872 actualSuccessors.add(currentBlock.getSuccessors().get(info.blockIndex)); | 872 actualSuccessors.add(currentBlock.getSuccessor(info.blockIndex)); |
873 } | 873 } |
874 keySuccessors[i] = info.actualIndex; | 874 keySuccessors[i] = info.actualIndex; |
875 } | 875 } |
876 } | 876 } |
877 | 877 |