Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2602:0c6564c254af
new node layout: BlockBegin, BlockEnd
-Dc1x.dot=regex for pdf output
escape dot graph labels (<, >, &)
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Fri, 06 May 2011 10:25:37 +0200 |
parents | f1bc67c2d453 |
children | 91d3952f7eb7 |
comparison
equal
deleted
inserted
replaced
2601:224e8b4007bd | 2602:0c6564c254af |
---|---|
558 | 558 |
559 if (x.numberOfCases() == 0 || x.numberOfCases() < C1XOptions.SequentialSwitchLimit) { | 559 if (x.numberOfCases() == 0 || x.numberOfCases() < C1XOptions.SequentialSwitchLimit) { |
560 int len = x.numberOfCases(); | 560 int len = x.numberOfCases(); |
561 for (int i = 0; i < len; i++) { | 561 for (int i = 0; i < len; i++) { |
562 lir.cmp(Condition.EQ, tag, x.keyAt(i)); | 562 lir.cmp(Condition.EQ, tag, x.keyAt(i)); |
563 lir.branch(Condition.EQ, CiKind.Int, x.suxAt(i)); | 563 lir.branch(Condition.EQ, CiKind.Int, x.blockSuccessor(i)); |
564 } | 564 } |
565 lir.jump(x.defaultSuccessor()); | 565 lir.jump(x.defaultSuccessor()); |
566 } else { | 566 } else { |
567 visitSwitchRanges(createLookupRanges(x), tag, x.defaultSuccessor()); | 567 visitSwitchRanges(createLookupRanges(x), tag, x.defaultSuccessor()); |
568 } | 568 } |
823 if (x.numberOfCases() == 0 || x.numberOfCases() <= C1XOptions.SequentialSwitchLimit) { | 823 if (x.numberOfCases() == 0 || x.numberOfCases() <= C1XOptions.SequentialSwitchLimit) { |
824 int loKey = x.lowKey(); | 824 int loKey = x.lowKey(); |
825 int len = x.numberOfCases(); | 825 int len = x.numberOfCases(); |
826 for (int i = 0; i < len; i++) { | 826 for (int i = 0; i < len; i++) { |
827 lir.cmp(Condition.EQ, tag, i + loKey); | 827 lir.cmp(Condition.EQ, tag, i + loKey); |
828 lir.branch(Condition.EQ, CiKind.Int, x.suxAt(i)); | 828 lir.branch(Condition.EQ, CiKind.Int, x.blockSuccessor(i)); |
829 } | 829 } |
830 lir.jump(x.defaultSuccessor()); | 830 lir.jump(x.defaultSuccessor()); |
831 } else { | 831 } else { |
832 SwitchRange[] switchRanges = createLookupRanges(x); | 832 SwitchRange[] switchRanges = createLookupRanges(x); |
833 int rangeDensity = x.numberOfCases() / switchRanges.length; | 833 int rangeDensity = x.numberOfCases() / switchRanges.length; |
1148 List<SwitchRange> res = new ArrayList<SwitchRange>(x.numberOfCases()); | 1148 List<SwitchRange> res = new ArrayList<SwitchRange>(x.numberOfCases()); |
1149 int len = x.numberOfCases(); | 1149 int len = x.numberOfCases(); |
1150 if (len > 0) { | 1150 if (len > 0) { |
1151 BlockBegin defaultSux = x.defaultSuccessor(); | 1151 BlockBegin defaultSux = x.defaultSuccessor(); |
1152 int key = x.keyAt(0); | 1152 int key = x.keyAt(0); |
1153 BlockBegin sux = x.suxAt(0); | 1153 BlockBegin sux = x.blockSuccessor(0); |
1154 SwitchRange range = new SwitchRange(key, sux); | 1154 SwitchRange range = new SwitchRange(key, sux); |
1155 for (int i = 1; i < len; i++) { | 1155 for (int i = 1; i < len; i++) { |
1156 int newKey = x.keyAt(i); | 1156 int newKey = x.keyAt(i); |
1157 BlockBegin newSux = x.suxAt(i); | 1157 BlockBegin newSux = x.blockSuccessor(i); |
1158 if (key + 1 == newKey && sux == newSux) { | 1158 if (key + 1 == newKey && sux == newSux) { |
1159 // still in same range | 1159 // still in same range |
1160 range.highKey = newKey; | 1160 range.highKey = newKey; |
1161 } else { | 1161 } else { |
1162 // skip tests which explicitly dispatch to the default | 1162 // skip tests which explicitly dispatch to the default |
1178 SwitchRange[] createLookupRanges(TableSwitch x) { | 1178 SwitchRange[] createLookupRanges(TableSwitch x) { |
1179 // XXX: try to merge this with the code for LookupSwitch | 1179 // XXX: try to merge this with the code for LookupSwitch |
1180 List<SwitchRange> res = new ArrayList<SwitchRange>(x.numberOfCases()); | 1180 List<SwitchRange> res = new ArrayList<SwitchRange>(x.numberOfCases()); |
1181 int len = x.numberOfCases(); | 1181 int len = x.numberOfCases(); |
1182 if (len > 0) { | 1182 if (len > 0) { |
1183 BlockBegin sux = x.suxAt(0); | 1183 BlockBegin sux = x.blockSuccessor(0); |
1184 int key = x.lowKey(); | 1184 int key = x.lowKey(); |
1185 BlockBegin defaultSux = x.defaultSuccessor(); | 1185 BlockBegin defaultSux = x.defaultSuccessor(); |
1186 SwitchRange range = new SwitchRange(key, sux); | 1186 SwitchRange range = new SwitchRange(key, sux); |
1187 for (int i = 0; i < len; i++, key++) { | 1187 for (int i = 0; i < len; i++, key++) { |
1188 BlockBegin newSux = x.suxAt(i); | 1188 BlockBegin newSux = x.blockSuccessor(i); |
1189 if (sux == newSux) { | 1189 if (sux == newSux) { |
1190 // still in same range | 1190 // still in same range |
1191 range.highKey = key; | 1191 range.highKey = key; |
1192 } else { | 1192 } else { |
1193 // skip tests which explicitly dispatch to the default | 1193 // skip tests which explicitly dispatch to the default |