Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2767:cc2b98e2b832
Reduced moveToPhi usages to 1.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Mon, 23 May 2011 16:23:28 +0200 |
parents | b72e6638b9e6 |
children | 43ffa0e47a46 |
comparison
equal
deleted
inserted
replaced
2764:99912abb3ff7 | 2767:cc2b98e2b832 |
---|---|
563 @Override | 563 @Override |
564 public void visitLookupSwitch(LookupSwitch x) { | 564 public void visitLookupSwitch(LookupSwitch x) { |
565 CiValue tag = load(x.value()); | 565 CiValue tag = load(x.value()); |
566 setNoResult(x); | 566 setNoResult(x); |
567 | 567 |
568 // move values into phi locations | |
569 moveToPhi(x.stateAfter()); | |
570 | |
571 if (x.numberOfCases() == 0 || x.numberOfCases() < C1XOptions.SequentialSwitchLimit) { | 568 if (x.numberOfCases() == 0 || x.numberOfCases() < C1XOptions.SequentialSwitchLimit) { |
572 int len = x.numberOfCases(); | 569 int len = x.numberOfCases(); |
573 for (int i = 0; i < len; i++) { | 570 for (int i = 0; i < len; i++) { |
574 lir.cmp(Condition.EQ, tag, x.keyAt(i)); | 571 lir.cmp(Condition.EQ, tag, x.keyAt(i)); |
575 lir.branch(Condition.EQ, CiKind.Int, getLIRBlock(x.blockSuccessor(i))); | 572 lir.branch(Condition.EQ, CiKind.Int, getLIRBlock(x.blockSuccessor(i))); |
822 value.setDestroysRegister(); | 819 value.setDestroysRegister(); |
823 value.loadItem(); | 820 value.loadItem(); |
824 | 821 |
825 CiValue tag = value.result(); | 822 CiValue tag = value.result(); |
826 setNoResult(x); | 823 setNoResult(x); |
827 | |
828 // move values into phi locations | |
829 moveToPhi(x.stateAfter()); | |
830 | 824 |
831 // TODO: tune the defaults for the controls used to determine what kind of translation to use | 825 // TODO: tune the defaults for the controls used to determine what kind of translation to use |
832 if (x.numberOfCases() == 0 || x.numberOfCases() <= C1XOptions.SequentialSwitchLimit) { | 826 if (x.numberOfCases() == 0 || x.numberOfCases() <= C1XOptions.SequentialSwitchLimit) { |
833 int loKey = x.lowKey(); | 827 int loKey = x.lowKey(); |
834 int len = x.numberOfCases(); | 828 int len = x.numberOfCases(); |